# Five Fixes for a Permission Error. Three Open Your Database to Everyone

Security is number one on our countdown because it is invisible. The clearest example is the moment you hit a permission error and are offered a fix that works — and what working costs.

URL: https://www.back4app.com/blog/permission-error-fixes-that-open-your-database
Published: 2026-11-09 · Tested: 2026-10-27
Tested on: Local: Docker 29.4.3 on macOS, arm64 · Parse Server 7.4.0 with MongoDB 7 · Probes made with the app id only, never the master key, except where the fix itself exposes it · Back4app, free plan
Publisher: Back4app Engineering

Security is first on our countdown for a reason that has nothing to do with how hard it is. Only 1.3% of posts discuss it, while 98% of 1,072 scanned AI-built apps had at least one flaw, and 172 of them let anyone delete data without logging in.

Nobody writes about a vulnerability they do not know they shipped. So rather than list flaws, we picked the exact moment most of them are created: you hit a permission error, and something offers you a fix.

Five plausible fixes, one error, one freshly built backend each time. Then we asked the backend what else had become possible.

## Watch it instead

Security is number 1 in our countdown of what actually goes wrong for people building with AI.

## What did each fix actually open?

Five different answers to a question that looked like it had one:

![Five fixes for the same permission error: all five remove the error, three also open access, with the master key in the client scoring five of five probes for a stranger holding only the app id, while the admin role opens nothing](/blog/blog-assets/the-fix-that-opens-the-door/five-fixes.png)

Read the first column before anything else. **Every single fix works.** The error is gone, the feature saves, the app does what it was asked to do, and the person who applied it has no reason to look further.

That is what makes this the top of the list rather than a footnote. It is not that the dangerous fix is tempting; it is that it is indistinguishable afterwards.

## What does the master key in the client cost?

Everything, and it is worth seeing the probes rather than the principle:

```text
B. put the master key in the client
   a stranger can read ana's note, edit ana's note, delete ana's note,
   see other people's accounts, read every class and field          5 of 5
```

That is a client with no account, holding only the app id out of your bundle. The master key is not a key to one thing. It is the switch that turns the rules off, and once it is in anything the browser downloads, it belongs to everyone.

## Is opening the class permission as bad?

Narrower than feared, and still a door. Opening `create` to everyone let a request with no account write rows into the database. It did not expose existing rows, because reads still required sign-in and per-row permissions still applied.

So the loss is not confidentiality — it is that anyone on the internet can put things in your database. Spam, junk, storage you pay for, and data your own app will later read back and trust.

## What about handing out an admin role?

This one did not do what we expected, and the measurement is the measurement:

```text
C. give the user an admin role
   nothing beyond its own data
```

Granting the role changed what the class allowed. It did not change the per-row access lists, so the promoted account still could not read, edit or delete anybody else's row.

The permission model has two layers and the role only moved the outer one. That is a genuinely reassuring result about this backend — and it is also why reasoning about these fixes by name does not work. You have to run them.

## What separates the last two fixes?

One question, asked once. Both run with the master key, which bypasses every rule — that is legitimate, and it is what server-side code is for. The difference is what they do with it:

```js
// D — the error goes away
await note.save(null, { useMasterKey: true });

// E — the error goes away, and the row belongs to someone
if (!req.user) throw new Parse.Error(119, 'sign in first');
note.setACL(new Parse.ACL(req.user));
await note.save(null, { useMasterKey: true });
```

Without those two lines, a stranger can call the function, and the rows it writes have no owner — which our probe confirmed meant any signed-in account could read them.

Using the master key on the server is not the mistake. Using it without establishing who is asking is.

## What should you ask of a suggested fix?

Four questions, and they take less time than applying it:

1. Does this change what someone with **no account** can do?

2. Does it move a secret into anything the **browser downloads**?

3. Does the row it creates have an **owner**?

4. Is the access it grants bounded by **who is asking**, or only by what is being asked for?

Fix E passes all four. Fix B fails the second so badly that the rest stop mattering.

## What should you do first?

Reproduce your own permission error with a request that carries no account at all — curl with just your app id. That is the baseline, and it is the thing you will re-run afterwards.

Then apply the fix on a copy and run that same account-less request again. If it does anything new, the fix did more than you asked. That loop takes two minutes and it is the only part of this that cannot be guessed.

[The lab is in the repo](https://github.com/templates-back4app/permission-lab) — five fixes, a fresh backend for each, and the probes that tell them apart.
