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.

One permission error and five fixes that all make it go away: putting the master key in the client lets a stranger holding only the app id read, edit and delete another person's row, list every account and read the whole schema, while two other fixes let a stranger write to the database, and nothing in the app looks different in any of the five cases

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.

Video: We Analyzed 130,000 Vibe Coder Posts. These Are the Problems That Actually Hurt.
Watch it instead We Analyzed 130,000 Vibe Coder Posts. These Are the Problems That Actually Hurt.
From the Back4app channel. This guide is the long version of its first position; the countdown itself is in the companion post. Open on YouTube →

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

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.

The symptom is identical in all five cases. Nothing in the error, the logs or the app’s behaviour separates the safe fix from the catastrophic one.

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:

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:

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.

Five fixes for one permission error
5 of 5make the error go away
→
3 of 5also hand access to someone who should not have it
5 of 5probes a stranger passes once the master key is in the client
Every probe runs against a row that is unambiguously somebody else's. Identical across two runs.

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:

// 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 — five fixes, a fresh backend for each, and the probes that tell them apart.

Tagssecuritypermissionsaclcloud-functionsapi-keysvibe-coding

Frequently asked questions

Why do AI assistants suggest fixes that break security?

Because the goal they are given is to make the error stop, and every one of the fixes does. We measured five plausible ones against the same permission error: all five removed it, and three also handed access to someone who should not have had it. Nothing in the app's behaviour distinguishes them afterwards.

What happens if the master key ends up in my front-end code?

Everything stops applying. We measured it: a stranger holding only the app id from the bundle could read another person's private row, edit it, delete it, list every account and read the entire schema — five of five probes. The master key is not a key to one thing, it is the switch that turns the rules off.

Is it safe to open create permissions on a class?

It lets anyone with your app id write rows into your database, which we confirmed with a request carrying no account at all. It did not expose existing rows in our test, because reads still required sign-in and per-row access lists still applied — but spam, junk and storage costs all arrive through that door.

Is using the master key in a cloud function dangerous?

Only if the function forgets to ask who is calling. We ran two functions that both use the master key: the one with no check could be called by a stranger, and the rows it wrote had no owner, so any signed-in account could read them. The one that required a signed-in user and stamped ownership opened nothing.

Does giving a user an admin role expose other people's data?

Not in our measurement, and that surprised us. Granting the role changed class-level permissions, but per-row access lists still applied, 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.

How do I tell a safe permission fix from a dangerous one?

Ask four questions of it. Does it change what someone with no account can do? Does it move a secret into something the browser downloads? Does the row it creates have an owner? And is the access it grants bounded by who is asking, or only by what is being asked for?

Further reading

Reviewed & verified by Back4app Engineering, Editorial review at Back4app

Tested Oct 27, 2026 — 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.

Changelog

  • Nov 9, 2026 — The companion repository is not published yet, so the link to it and the button were removed; they come back when it is.
  • Oct 28, 2026 — The companion repository is published, so the button and the inline link to it are back.

More from Back4app Engineering

Backend · tutorial

Your Frontend Talks Straight to the Database. Here Is How to Lock It Down [Full Repo]

Backend · report

Why Vibe-Coded Apps Break: 13 Problems From 130,000 Posts, Ranked, With the Fix for Each

Backend · tutorial

How to Ban and Unban Users in Your App, and Make the Ban Stick [Full Repo]