Dev.to AI 🤖 Ai 👁 0 📖 7 min read

The Exposure Layer — Or, "It's Reachable" Is Not the Same as "It's Meant to Be Reachable"

Two days ago the top of Hacker News was a report that applications built with an AI app generator had exposed passport scans and more than two hundred thousand private messages. I have not read the technical root cause,

Two days ago the top of Hacker News was a report that applications built with an AI app generator had exposed passport scans and more than two hundred thousand private messages. I have not read the technical root cause, so I am not going to describe it. What I can say is that the class of failure is not new, and it is not about attackers being clever. It is about nobody ever making a decision.

That is the distinction this piece is about, and it is worth stating plainly before the usual advice arrives.

Reachable is a network fact. Exposed is a decision.

"Reachable" describes what a packet can do. "Exposed" describes what a person intended a packet to be able to do. These are different properties, they are measured by different instruments, and only one of them can be configured.

You can check reachability from outside: open a connection, see if something answers. That is a fact about routing, firewalls, and whether a process is listening.

Exposure is not that. Exposure is the claim that this specific data, to this specific audience, was a decision someone made and can point to. If no one made that decision, then the correct word is not "exposed." The correct word is "defaulted." The data went out because the system's default was permissive and the default was never overridden, and "we never decided" is a very different finding from "we decided wrong."

The distinction matters because it changes the fix. A wrong decision is corrected by revisiting it. An absent decision is corrected by finding every place where a decision was skipped — and you cannot do that by reviewing the code you remember writing, because the whole point is that nobody wrote it.

The generator made a choice. Nobody made a decision.

Modern app generators — low-code builders, scaffolders, AI coding agents — ship with defaults that make the first hour feel magical. Create a table, and it is queryable. Upload a file, and it has a URL. Deploy a function, and it responds.

Every one of those defaults is permissive, and for a good reason: a scaffolding tool that produces an app which does nothing until you configure nine policies does not get used twice. Permissive defaults are a shipping feature. They are also the exact thing that shows up in the incident report.

So the honest framing is not "the tool was insecure." It is: the tool made a choice on your behalf, at a moment when you did not know a choice was being made. You were evaluating whether the app works. The generator was deciding who can read the table. Those are different questions, and only one of them was on your screen.

The default is load-bearing

The advice that follows these incidents is always "lock it down." That advice fails more often than it should, for a mechanical reason: the permissive default is usually doing work.

The browser client talks to the database directly using a public key. That is why there is no backend to write, why the demo loaded in four minutes, why the prototype survived a weekend. Turn off anonymous access and the app stops working — not because it was insecure, but because anonymous access was the architecture. The key in the frontend bundle was the access control.

This is why "just add auth" is not a fix and why the fix takes longer than the incident writeup implies. You are not flipping a switch. You are inserting a component that did not exist, and every screen that used to read the table directly now needs a path through it.

Worth saying out loud: a team that ships a permissive default and knows it is in a different position from a team that ships one and does not. The first can schedule the work. The second finds out from a journalist.

Three surfaces, one question

Most of these failures land on one of three surfaces, and all three are usually configured in the same afternoon by the same person who was trying to get the demo to load.

Rows. A table readable by anyone holding the public key. The failure is not that the key leaked — the key is supposed to be public. The failure is that the table's policy says "anyone" and the sentence "anyone" was never read back as a sentence about passport scans.

Objects. A storage bucket where the file is protected by the URL being long and random. This is the most common form of "we thought about it," and it is not a policy. URLs travel: they appear in referrer headers, in access logs, in support tickets pasted into a chat window, in screenshots in a deck, in a browser history someone syncs. An unguessable URL is a delay, not a control.

Functions. An endpoint that checks nothing because the frontend always sends a token. The check lives in the client, which means the check lives in the attacker's environment, which means there is no check. This one is especially common in generated code because the generated client and the generated server were produced together, by something that was optimizing for them agreeing with each other.

You cannot see it, because you are always logged in

Here is the reason these survive internal review: the person reviewing is signed in.

Every manual test is performed with a session. Every screen loads. Every table returns rows. The app "works." The reviewer concludes the app works, and they are right — for users who are allowed to be there.

The failure only appears for a request that carries no credentials, and nobody on the team ever makes one, because there is no reason to: they are testing their product, and their product is experienced as a logged-in user.

This is a structural blind spot, not carelessness. It is the same shape as testing a backup by restoring it on the machine that made it. The instrument shares the assumption being tested.

So the only reliable measurement is deliberately adversarial and deliberately boring: make the request the stranger makes. No cookie, no token, no header, private window, curl with nothing attached. Then read the response as data, not as an error message.

The question that produces a number

"Are we exposed?" is unanswerable, which is why it produces meetings.

"What does an unauthenticated request to this surface return, and who wrote down that it should return that?" is answerable, per surface, in about four minutes.

The second question has a property the first one lacks: it can come back empty. If the answer to "who wrote it down" is nobody — not "the team," not "we discussed it," but an actual document with a date — then that surface was never decided, and its current behavior is a default that happened to be in the room.

That is the finding. Not "there is a vulnerability." The honest sentence is: this surface has been answering strangers since the day it was created, and no one has ever recorded what it should answer.

The artifact: an exposure receipt

Five columns, one row per surface. It fits on a page, and filling it in is the audit.

  1. Surface — the table, bucket, or endpoint, named the way the config names it.
  2. What an unauthenticated request returns today — the actual response, captured, not remembered. A count of rows is usually enough to make the point.
  3. What it should return — an empty set, a 401, or a specific public projection. "Nothing sensitive" is not an answer; it is a hope.
  4. Who decided that, and when — a name and a date, or the word "nobody."
  5. Last time it was tested without credentials — a date, or "never."

The fifth column is the one that ends arguments. Teams routinely discover that a surface has been public for a year and has never once been requested anonymously by anyone on the team, which means its behavior in production has never been observed by the people responsible for it.

The number worth reporting

Count the surfaces where column four says "nobody." That is the exposure surface count. It is not a severity score and it is not a CVSS vector; it is a count of places where the system is making a decision on your behalf without your knowledge.

Then count the ones where column five says "never." Those are adjacent: the undecided surfaces are almost always the untested ones, because the reason nobody tested them is the same reason nobody decided them — from inside the product, they look like working features.

Friday exercise, twenty minutes

Open a private window. Log out completely. Then hit three things: the table that holds your most sensitive rows, one object URL from your storage bucket, and one endpoint your frontend calls after login.

For each, write down the response in one line, and next to it write what you expected. Where the two disagree, you have found a default. Where you have no expectation written down, you have found something more useful: a place where the decision was never made.

Do not fix anything on Friday. Just write the five columns. The fixing is a different conversation, and it goes much better when it starts from a page of measurements instead of a page of adjectives.

If you have a table or an endpoint that has been answering strangers since launch and you have never made the request yourself, say so in the comments — no detail needed, just the surface. We keep a five-column exposure worksheet (surface, what anonymous gets, what it should get, who decided, last tested), and I will send it over. No form, no list.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.