
HiringsAI blog
Access control, secrets, injection, XSS, auth, webhooks, rate limits, SSRF, prompt injection, the supply chain, logging, headers, and a 60-minute pass.
A first security review of an AI-built app starts with five checks.
A first security review of an AI-built app starts with five checks. One: a logged-in user cannot read or change another user's data, which you prove with a test, not a hope: make two accounts, put a private record in the first, and try to reach it from the second by changing the URL or the request. Two: no secret, not a database password, not an API key, sits in code the browser can see or in your git history. Three: text a user types never becomes a command or a script: database queries are parameterized, other interpreters get their own context-specific defenses, output is encoded for the browser, and server-side validation acts as the first filter rather than the fix. That layering, not validation alone, is what fights the injection and XSS families that AI code generators keep reintroducing. Four: anything your app exposes to the internet, a webhook endpoint, a login form, an AI feature, assumes strangers will find it and poke it a thousand times, so webhooks verify signatures, forms rate-limit, and AI features treat the content they read as untrusted instructions. Five: you can see what happened, because you log the events that matter, sign-ins, permission denials, payment events, and you never log passwords or session tokens. That list is a starting review, not a certificate of safety, and it is short on purpose. The OWASP Top 10, the industry's periodic ranking of the most critical web application risks, kept broken access control at number one in its 2025 edition, and the contributed testing data behind that ranking is specific: on average, 3.73% of applications tested had one or more of the 40 weaknesses in this category, which also carries the highest total occurrences in that data. So the first item on your list is the first item on theirs. The rest of this article walks each item at working depth, with the exact checks to run, and ends with a 60-minute pass you can do on your own app today.
Strip the jargon away and a web app is a door with rules.
Strip the jargon away and a web app is a door with rules. People arrive with requests: show me this page, save this form, email me that report. Your app's job is to decide, for every request, whether to allow it, and the rules it applies are always the same three questions in order. Who are you: authentication. What are you allowed to do: authorization. Is what you sent well-formed and safe to use: validation. Security bugs are places where one of those questions was never asked, was asked in the wrong place, or was answered by trusting the asker. AI builders write the rules fast, and most of what they write is fine, but speed has a specific side effect: the generated code implements the happy path you described, the logged-in user viewing their own invoice, and the rule for the path you did not describe, the logged-in user viewing someone else's, exists only if someone thought to ask for it. Security work for an AI-built app is mostly asking, feature by feature: what stops the wrong person, the wrong input, the wrong sender. This article gives you the questions in the order attackers ask them.
If you only take one section of this article seriously, take this one.
If you only take one section of this article seriously, take this one. Broken access control sits at number one in the OWASP Top 10 for 2025, maintaining its position from 2021, and the edition's introduction reports the prevalence behind the ranking with precise scope: across the application-testing data organizations contributed for this edition, an average of 3.73% of applications tested had one or more of the 40 weaknesses grouped under this category, and the category document reports the highest total number of occurrences in that data plus the second-highest number of related CVEs. That is a population of real, tested applications, not a claim about every app ever built, and it is still the strongest signal in the edition. The category covers failures where the app checks who you are but not what you may touch: you log in as yourself, and by changing an ID in a URL, a number in a request, or a parameter in a form, you reach another user's records, or act with an administrator's powers. The related weakness list in the same edition includes information exposure, server-side request forgery, and cross-site request forgery, which all appear later in this article under their own names. Why AI-built apps are prone: the generator writes the screen you asked for, a page that loads invoice 1042 and shows it, and the check that the invoice belongs to the viewer is a separate sentence nobody prompted. The code looks finished. It handles the happy path beautifully. The missing rule is invisible precisely because nothing on screen misbehaves. OWASP's name for the URL-changing version is insecure direct object reference, IDOR, and its cheat sheet's advice is the fix in one line: every request that touches an object verifies, on the server, that the current user is allowed to touch that object. Not hides the link. Server-side verification, every time.
Here is the highest-value hour in this article, and it needs no tools beyond a second browser.
Here is the highest-value hour in this article, and it needs no tools beyond a second browser. Create two accounts in your app, Ada and Bea. As Ada, create one private thing: an invoice, a document, a project, whatever your app keeps per user. Note its URL and anything in the page or the network requests that looks like an identifier: /invoices/1042, ?doc=abc123, a record id in a JSON response. Now, as Bea, in the other browser, try to reach Ada's thing. Paste the URL. Change 1042 to 1043, then to 1041, then to 1. If your app has an API, open the request your own UI made as Ada and replay it with Bea's session. What you want to see every time: a flat refusal. And where the record's existence is itself sensitive, the OWASP IDOR cheat sheet's prescription applies: map missing and forbidden to the same public response, its example is a shared 404, so probing cannot reveal which records exist. What you might see instead, and what testers find constantly: Bea sees Ada's invoice, or an error page that leaks part of it, or a 403 on the page while the JSON endpoint underneath still answers. Every place data comes out, page, JSON, file download, export, search result, needs the check. Run this once per object type, not once per app: the invoices check says nothing about the documents. When a place fails, the fix you ask your builder for is exact: verify ownership or permission on the server for every object access, and where an object's existence is sensitive, return the same public response for missing and forbidden. Prompt it as a requirement, because it is one.
A secret is any string that grants power by being known: database passwords, API keys, signing secrets for webhooks, session-signing keys, tokens for third-party services.
A secret is any string that grants power by being known: database passwords, API keys, signing secrets for webhooks, session-signing keys, tokens for third-party services. OWASP's Secrets Management Cheat Sheet urges centralizing the storage, provisioning, auditing, rotation and management of secrets in a dedicated secrets-management solution, with code reading them at runtime rather than containing them; on a small app the platform's secret store plays that role, and the cheat sheet explicitly cautions that plain environment variables are a fallback rather than a first choice, because they are generally accessible to all processes and can leak into logs and system dumps. AI-built apps leak secrets in four characteristic places, and all four come from the same root: the generator puts the key where it works fastest. First, the frontend bundle: anything shipped to the browser is public, full stop, so a key referenced in client-side JavaScript is a published key, no matter how obscure the variable name. Second, git history: deleting the key from the file does not delete it from the commits, and the cheat sheet's rule for a potentially compromised secret is revocation and rotation, and a key sitting in git history counts as potentially compromised: issue a new one, because removal alone leaves the old one working. Third, prompts and AI-tooling logs: pasting a key into a chat to help the generator use it hands the key to that tool's logs. Fourth, application logs: a debug line that prints a request header or an environment dump prints the secret with it. The habit that covers all four: keys live in the platform's secret store, code reads them at runtime, the browser never sees the powerful ones, and anything that was ever committed or pasted gets rotated, not just removed. Services increasingly help: Stripe's webhook signing secrets are prefixed whsec_ so scanners and humans recognize them, and many providers now detect their own key patterns pushed to public repositories and notify you.
Try this on your own project right now.
Try this on your own project right now. Search the codebase for the shapes secrets take: api_key, apikey, secret, token, password, Bearer, sk_, whsec_, AKIA. Any hit inside a file that ships to the browser, anything under a public, static, client, or dist folder, is a live leak. Any hit in a server file is not automatically a leak, the question is whether the value is hardcoded or read from the environment; process.env.X or your platform's equivalent is the correct pattern, a quoted string literal is not. Then check history: your git host's search, or git log -p piped to a search for the same shapes, answers whether a key ever lived in a commit. Found one? The sequence matters: first rotate the key at the provider so the old value dies, then remove it from code and replace it with an environment read, then commit. Rotating first means no window where the app is broken while you edit, and no version of history holds a working key. Do not paste the key into your AI builder to have it make the change: describe the change, let it write code that reads the environment, and put the new key into the env store yourself. This whole pass takes twenty minutes the first time and five after that, and it is the single most common real-world way small apps get emptied, because automated harvesting of public repositories is continuous, so a published key should be treated as already found.
Injection is what happens when text a user typed gets executed as a command.
Injection is what happens when text a user typed gets executed as a command. The classic shape is SQL: the app builds a database query by gluing strings together, "SELECT * FROM users WHERE name = '" plus whatever you typed plus "'", and a visitor who types quote characters of their own gets to rewrite the query. The same family exists anywhere text meets an interpreter: shell commands, template engines, email headers. OWASP's Input Validation Cheat Sheet gives the layered defense, and the layers matter because each one assumes the others can fail. Validate input on the server against what the field is allowed to be, an allowlist where one exists, a strict type and length where it does not; client-side validation is a usability feature, not a security one, since the caller can skip your page entirely. Use parameterized queries, the database API that takes the statement and the values separately, so user text can never become query structure; this is the actual fix, not escaping by hand. And keep the database account's permissions narrow, so a successful injection meets an account that cannot drop tables or read other schemas. One nuance for AI-built apps: the generator often uses an ORM, and ORMs parameterize their own query methods, which leads to a comforting and incomplete story. The moment generated code drops to raw SQL for a custom search, a sort parameter, or a filter, and AI writes that raw SQL surprisingly often, the ORM's protection no longer applies. The question to ask of every data-touching feature is not "did you use an ORM" but "is there any place user input is concatenated into a query string."
Make it concrete with the feature nearly every app has: a search box.
Make it concrete with the feature nearly every app has: a search box. The generated code builds "SELECT * FROM customers WHERE name LIKE '%" plus the box's contents plus "%'". Type smith and it works. Now type the probe: ' OR '1'='1. If the code concatenates, the condition becomes name LIKE '%' OR '1'='1%', which is true for every row, and the search returns the whole table. That is the entire attack, and a child can run it; the damage versions add UNION SELECT to pull other tables, or write statements where the database allows them. Test your own app the safe way, against your own data: try the quote probe in every input that filters or sorts, the search box, the sort dropdown, the date filter, and watch for two tells: results that clearly include everything, or a database error page, which is the bug announcing itself even when the attack string was clumsy. Then read the generated code for the feature and look for the shape: a query string with a plus sign or a template literal with a variable inside it. The fix you hand the builder is one sentence: use the database library's parameterized form for every query, including search, sort, and pagination, and validate sort directions and column names against an allowlist, because those cannot be parameterized. Re-run the probe after the fix: it should return nothing, quietly, and the log should show a validation failure, which is the logging section's cue.
Cross-site scripting is injection's browser-side twin: attacker text stops being displayed and starts being executed, as JavaScript, in the page, in the victim's session.
Cross-site scripting is injection's browser-side twin: attacker text stops being displayed and starts being executed, as JavaScript, in the page, in the victim's session. A stored version lives in your database, a comment, a profile field, a support message, and runs in the browser of everyone who views it, including you, the admin, which is the version that hands over the whole app. AI builders reintroduce XSS through a predictable door: modern frameworks escape output by default, but the moment a feature needs to render user-provided formatting, generated code reaches for the escape hatches, innerHTML, dangerouslySetInnerHTML, v-html, and the default protection is gone for exactly the field that needed it most. The defense has two layers and you want both. Output encoding first: every framework's default rendering path encodes, so the rule is to stay on it, and where rich content is genuinely required, sanitize through a dedicated library rather than a regex of your own. Then the backstop, Content Security Policy. MDN's CSP guide describes the mechanism: an HTTP header that tells the browser which sources may load which resource types, and a policy like default-src 'self' with a nonce-based script-src means injected inline scripts and inline event handlers simply do not run, because the browser executes only scripts carrying the server-issued nonce. CSP does not fix the bug; it converts many exploitable bugs into broken pages, which is the difference between an incident and a shrug. Ask your builder for it by name: a Content-Security-Policy header on every page, no unsafe-inline in script-src.
Authentication answers "who are you," and the mechanics are simpler than the vocabulary.
Authentication answers "who are you," and the mechanics are simpler than the vocabulary. You prove yourself once, password, magic link, Google button, and the app hands your browser a credential it resends on every request: usually a session cookie, a random string the server maps to your account, sometimes a signed token like a JWT that carries its own proof. MDN's HTTP authentication documentation and cookie documentation cover the two properties that make a session cookie safe: HttpOnly, so JavaScript cannot read it and an XSS bug cannot steal it, and Secure with SameSite, so it travels only over HTTPS and is not sent along by other sites' requests. The rule that outranks every detail: do not build your own authentication. OWASP's Authentication Cheat Sheet catalogs that surrounding machinery, registration, reset, lockout, session rotation, which is where homegrown systems fail, in ways the login screen never shows. Use the platform's auth, a hosted identity provider, or a maintained library, and spend your attention on the configuration, which is where the real choices live: session lifetimes, whether sessions die on password change, what the reset flow reveals. AI builders will happily generate a custom login system; it will look complete and be wrong in four places. Redirect that effort: prompt for the integrated, maintained option your platform offers, and keep generated code away from password storage entirely. Two configuration choices deserve the attention you saved. Session lifetime: how long a logged-in browser stays trusted, shorter for anything touching money or admin actions, and what happens on the important changes, a password change or reset should kill every other live session, otherwise a stolen session survives the password fix. And token hygiene where tokens replace cookies: a signed token the server cannot revoke is a credential that outlives its welcome, so token-based designs pair short-lived access tokens with refresh rotation, which a maintained library does for you and a generated from-scratch one usually does not.
Three rules carry most of the weight here, from OWASP's authentication and password-storage guidance.
Three rules carry most of the weight here, from OWASP's authentication and password-storage guidance. Storage: passwords are never stored, only hashed, each with a unique salt and a modern password-hashing algorithm: the Password Storage Cheat Sheet's current preference is Argon2id, then scrypt, with bcrypt documented for legacy systems, while a fast general hash like SHA-256 is explicitly unsuitable. Slow, salted algorithms are what make a leaked database expensive to crack instead of trivial. Reset: the reset link is a single-use, expiring token sent to the account's email, and the response to a reset request is identical whether or not the email exists, otherwise the feature doubles as an account-discovery tool. Failure handling: repeated failed logins get throttled, per the logging cheat sheet's reasoning, failed authentications are the early signal of brute-force, credential-stuffing, and password-spraying attacks, so you both limit them and log them. A fourth rule for AI-built apps specifically: check the generated reset flow end to end with your own account, because the part generators most often skip is expiry, a reset link that works forever is a master key taped to the internet. And where you can offer it, a second factor means a stolen password alone is no longer enough to sign in; passkeys and authenticator apps both beat SMS.
These two words name the first two questions from the mental model, and confusing them is the design error behind the number-one bug class.
These two words name the first two questions from the mental model, and confusing them is the design error behind the number-one bug class. Authentication: the app knows who you are, the session is valid, the token checks out. Authorization: given who you are, may you do this specific thing to this specific object. Generated code routinely proves the first and assumes the second: the endpoint checks that a session exists, then loads whatever ID the request named. That is a fully authenticated data breach. The test from section 3 is precisely an authorization test, it runs while logged in, which is why "but we have login" is never the answer to "is my data safe." Where the check belongs: on the server, inside every handler that touches an object, as close to the data access as possible, not in the UI, where hiding a button is a convenience rather than a boundary, and not only in middleware, which knows the route but not the record. Roles follow the same rule: "admin" is a claim to verify against the user's stored role at the moment of action, not a flag the client sends. If your data layer supports row-level security, it moves the check into the database itself, which is the one place generated code cannot accidentally skip it.
The moment your app has a webhook endpoint, a URL that receives events from Stripe, GitHub, your email provider, you have published a door that accepts orders from the whole internet.
The moment your app has a webhook endpoint, a URL that receives events from Stripe, GitHub, your email provider, you have published a door that accepts orders from the whole internet. Stripe's webhook documentation states the risk and the fix plainly: without verification, an attacker could send fake events to your endpoint to trigger actions like fulfilling orders or granting account access, so you verify that events actually originate from Stripe before acting on them. The mechanism: Stripe signs every event and puts the signature in the Stripe-Signature header, and your code verifies it with the official library, calling constructEvent with the raw request body, the header, and your endpoint's signing secret, the whsec_ value from the dashboard. Two details matter and both are in the docs. Verify the raw body, before any JSON parsing, because parsing and re-serializing changes the bytes and breaks the signature. And the header carries a timestamp alongside the signature, which the library checks against a tolerance window, closing replay attacks where an attacker re-sends a captured valid event. Stripe additionally publishes the IP addresses its webhooks come from, so an allowlist at the server or firewall is a second layer. The general principle transfers to every webhook provider: the endpoint must establish who sent the event from the request itself, a shared secret and a signature, never from the payload's contents. Ask your builder one question: does the webhook handler verify the signature with the official library before it touches the database? "It checks the event type" is not an answer.
Every unauthenticated endpoint has a question attached: what does it cost when a script hits it a thousand times a minute.
Every unauthenticated endpoint has a question attached: what does it cost when a script hits it a thousand times a minute. For a login form the cost is account guessing, which the password section's throttling handles. For a signup form it is a database full of fake accounts. For anything that calls a paid API, sends email or SMS, or runs an AI model, the cost is money, yours, at machine speed. Rate limiting is the control: per identity, per IP, per endpoint, a budget of requests per window, with a clear refusal when it runs out. AI-built apps need this called out because the generator builds the feature, not the budget: a "summarize this document" endpoint with no limit is an invitation to run your inference bill up for fun. What to ask for, concretely: limits on every public form and endpoint, stricter limits on anything expensive or anything that sends messages, and a response that fails closed, a 429 with a retry hint, rather than a queue that pretends to accept. This is also the place where per-user quotas belong, the daily allowance a signed-in user gets, which is a product decision with a security function: it caps the blast radius of any single stolen account or leaked key. Two practical notes. Limit by the expensive thing, not just the request count: an endpoint that calls an AI model needs a cap measured in calls or tokens per identity per day, because a thousand tiny requests and ten huge ones are different bills. And decide the failure behavior before it happens: a user who hits the limit should get a clear 429 with when to retry, your logs should record the limit event so abuse patterns are visible, and your own monitoring should never be able to lock you out of your own app, which means an operator override you control.
Server-side request forgery is the bug where your server becomes the attacker's web client.
Server-side request forgery is the bug where your server becomes the attacker's web client. Any feature that fetches a URL the user supplies, screenshot this page, import from this link, check this webhook target, preview this feed, can be pointed inward: at cloud metadata endpoints that hand out instance credentials, at internal services that trust the network, at your own admin panel from inside the firewall. OWASP's 2025 list files SSRF among the weakness classes feeding broken access control, which is a fair map: the server has authority the user lacks, and the feature lets the user spend it. The defenses, in order of strength: do not take arbitrary URLs where a fixed set of targets would do; where URLs must be accepted, validate the destination against an allowlist of hosts and resolve the name yourself, rejecting anything that resolves to a private, loopback, or link-local address; and run the fetch from an environment with no internal powers worth stealing. For AI-built apps the tell is a feature description containing "fetch," "import," "preview," or "screenshot" plus a user-editable URL: find each one and ask what stops it from fetching 169.254.169.254, the cloud metadata address, because the generated code's honest answer is usually nothing. The test is five minutes: find the feature, paste the metadata address, then http://localhost, then http://127.0.0.1, and see what the feature returns. A page of JSON about your cloud instance, your own app's admin page, or anything at all from those addresses means the feature needs the allowlist treatment before launch, not after. Also check redirects: validation that inspects only the URL you entered misses a short link that redirects inward, so the check belongs on the final resolved address, or redirects get followed with the same rules applied at every hop.
Cross-site request forgery: your browser attaches your session cookie to any request it makes to your app, including requests a malicious page tricks it into making, so a form on evil.example can spend your logged-in session.
Cross-site request forgery: your browser attaches your session cookie to any request it makes to your app, including requests a malicious page tricks it into making, so a form on evil.example can spend your logged-in session. The modern default defense is mostly already in place if your cookies are set correctly: SameSite on the session cookie stops browsers from attaching it to cross-site requests, which is why the cookie flags in the authentication section do double duty. Where it still matters: cookie-based apps with state-changing GET endpoints or legacy form posts, and any flow where you explicitly relaxed SameSite. The classic fix, a per-session token the real page embeds and the server requires, remains the answer where SameSite cannot go. One concrete shape so it is not abstract: your app has a settings form that changes the account email via POST, protected only by the session cookie. You are logged in. In another tab you open a page that auto-submits a hidden form to that endpoint; the browser attaches your cookie, the server sees a valid session, and the account email is now the attacker's, which routes the next password reset to them. SameSite=Lax or Strict on the session cookie stops the browser from attaching it to that cross-site POST, and a CSRF token stops the attack even where the cookie must be shared. One paragraph is enough because the check is one question: are state-changing requests protected by SameSite cookies, a CSRF token, or both.
Every AI feature you ship has a new injection surface, and OWASP's GenAI project ranks prompt injection first on its LLM Top 10.
Every AI feature you ship has a new injection surface, and OWASP's GenAI project ranks prompt injection first on its LLM Top 10. The direct version is familiar: a user types instructions into your chat feature to pry out its system prompt or exceed its role. The indirect version is the one that bites real products: your AI feature reads content from the world, an email to summarize, a web page to analyze, a document to answer questions about, and that content contains instructions addressed to the model. The model cannot reliably tell data from commands; that is the vulnerability, and OWASP's GenAI project is blunt about the ceiling: its LLM01 entry says it is unclear whether any foolproof prevention exists, so the listed mitigations reduce impact rather than eliminate the risk. So the defenses are architectural, the same questions as always, aimed at the model: what can this AI feature do, send mail, run queries, change records, and what is the worst thing it does if the text it reads turns out to be orders. Constrain the tools the model can call to the minimum the feature needs. Keep human approval on actions that spend money, send messages, or change data. Treat the model's output as untrusted input everywhere else in the app, because it is derived from untrusted input. And never let secrets sit in the prompt context, because anything in context is one persuasive document away from being repeated.
Walk the indirect-injection path once, end to end, with the feature every AI-built product seems to grow: a support assistant that reads incoming customer email and drafts replies, with access to the orders database so it can answer status questions.
Walk the indirect-injection path once, end to end, with the feature every AI-built product seems to grow: a support assistant that reads incoming customer email and drafts replies, with access to the orders database so it can answer status questions. An attacker emails the support address. The message is not for your team; it is for the model: embedded in the text, instructions to look up recent orders and include the results in the reply, which the feature helpfully sends back to the attacker. No password was guessed, no server was entered, and every component did what it was told: the mailbox received mail, the model summarized and used its tools, the reply went out. The vulnerability is the combination: a model that reads untrusted input plus tools with real powers plus an outbound channel. The redesign, piece by piece: the assistant's database tool gets narrowed to the single query it needs, order status for the address the ticket came from, not open-ended lookup; outbound replies get human approval, which converts the exfiltration channel into a draft folder; and the system prompt stops carrying anything secret, on the assumption that persistent users can extract it. Run the test yourself: email your own feature a message containing polite, direct instructions for the model, and see what comes back. What it does under that input is its real permission set, whatever the prompt claims.
Your app's code is mostly other people's code: the frameworks and libraries your builder chose, and their dependencies, recursively.
Your app's code is mostly other people's code: the frameworks and libraries your builder chose, and their dependencies, recursively. OWASP's 2025 list calls this software supply chain failures, ranks it A03, and reports a striking pair of facts: the community survey behind the list ranked it first, with exactly half of respondents putting it at number one, while the edition's introduction notes the category has the fewest occurrences in the contributed data, because testing for supply-chain failures is genuinely hard, but the highest average exploit and impact scores from CVEs. The same entry's scenario section describes the 2025 Shai-Hulud attack, the first successful self-propagating npm worm: malicious versions of popular packages ran a post-install script that harvested sensitive data, used found npm tokens to publish malicious versions of every package the victim could publish to, and reached over 500 package versions before npm disrupted it. That is the modern shape: the attack arrives through a routine install or update, on a developer machine or a build server, and spreads by impersonating its victims. Your defenses, scaled to a small app. Commit your lockfile and install from it, so every build gets exactly the versions you last chose, not whatever published this morning. Update deliberately, on your schedule, with a read of what changed, rather than auto-pulling latest into production. Run the package manager's audit and your platform's dependency alerts and actually read what they flag. And treat install-time scripts as the power they are: a package that runs code at install is running code as you. When the AI builder adds a dependency for something small, that is a standing offer to review the choice, because the generator picks by familiarity, not by your risk budget.
Three questions, in descending order of how much they protect.
Three questions, in descending order of how much they protect. First: what do you store at all. Data you never collected cannot be breached, and AI builders default to generous, full request bodies logged, every form field kept forever, analytics on everything, so pruning the schema and the logs is a security act. Second: how it is protected where it lives. In transit, HTTPS everywhere, which your platform almost certainly handles, verify rather than assume. At rest, many managed databases and storage services encrypt by default, verify yours does rather than assume, which covers the lost-disk scenario; what encryption at rest does not cover is the scenario this article is about, an attacker reaching data through your app or your credentials, which is why access control and secrets management carry the real weight. Third: can you restore. Backups that exist but have never been restored are a hope, not a backup; the test that counts is restoring one, once, to a throwaway environment, which also tells you how long a bad day would last. And a note that belongs here because nowhere else wants it: exports and admin CSV downloads are data leaving every protection you have, so treat who can export as a permission of its own, and log every export, which the logging guidance explicitly names as high-risk functionality worth recording. One more storage habit that pays off in AI-built apps: ask what the builder put in the database versus what it left in places you cannot see, analytics events, error trackers, support inboxes, AI prompts sent to a provider. Personal data scattered across four services is four retention policies, four breach surfaces, and four places a deletion request must reach. The pruning question from the top of this section applies to each: what arrives, what stays, and what never needed to be collected.
Without logs, the two-account test failing in production looks exactly like success: nothing to see, nothing happened.
Without logs, the two-account test failing in production looks exactly like success: nothing to see, nothing happened. OWASP's Logging Cheat Sheet lists what to always record, and the security-relevant core is short: authentication successes and failures, because repeated failures are the early indicator of brute-force, credential-stuffing, and password-spraying attacks; authorization failures, the denials from section 3's checks, which is what probing looks like; input validation failures, treated as suspicious events rather than proof of attack, since unexpected input can also come from misuse or client defects, with severity judged by repetition and context; session management failures; application errors; and use of higher-risk functionality, user administration, privilege changes, sensitive-data access, data export. The same cheat sheet's second list is just as important, what never to record: passwords, session identifiers, access tokens, and similar secrets, which must be removed, masked, or hashed, because a log full of session tokens is a second database of keys, and the cheat sheet warns that logs containing technical secrets become a stepping stone for deeper attacks. Practical shape for a small app: structured events with a timestamp, an actor, an action, and an outcome, kept somewhere off the app server with a retention window, plus one alert wired to the one pattern that always matters, many failed logins or many denials from one source in a short window. You are not building a security operations center; you are making sure that the day something happens, the evidence exists.
HTTP response headers are instructions the browser enforces for you, and four of them do outsized work.
HTTP response headers are instructions the browser enforces for you, and four of them do outsized work. Content-Security-Policy, from the XSS section: restricts which sources may load which resources, and a script-src without unsafe-inline stops injected inline scripts from running; MDN's guide walks through the directives and the nonce pattern. X-Content-Type-Options with the value nosniff: stops the browser from second-guessing a response's declared type, closing a class where a file uploaded as one thing gets interpreted as another. Referrer-Policy: controls how much of your URLs, which can carry tokens and record IDs, leaks to third parties through the Referer header; strict-origin-when-cross-origin is a sane floor and the one MDN lists as the default. And frame protection, frame-ancestors in CSP or the older X-Frame-Options: stops other sites from embedding your app in an invisible frame and tricking clicks, the clickjacking family. Check your own app in a minute: open the browser's network tools, load your pages, and read the response headers. Whatever is missing is a one-line ask to your builder or platform config, with the caveat that CSP deserves care: a strict policy on an app that depends on inline scripts will break the app first, which is the correct order, fix the inline scripts, then tighten the policy.
Each bug class so far predates AI builders.
Each bug class so far predates AI builders. What the builder changes is your relationship to the code's surface. Generated code is tidy, commented, and conventionally structured, it reads like code that someone already checked, and that plausibility is the trap: the review you would have done while writing it line by line never happened, and the code's polished look argues, falsely, that it did. The counter is not reading everything, which was never realistic; it is reviewing by question instead of by line. Take each feature and ask the three questions from the door model: who can reach this, what are they allowed to touch, what can their input become. Those questions have testable answers, the two-account test, the quote probe, the signature check, and tests survive your not reading the implementation. Where to look hardest: anywhere the generated code leaves the framework's protected defaults, raw SQL beside the ORM, innerHTML beside the templating, a custom auth helper beside the library, a fetch of a user-supplied URL. Builders leave the defaults exactly where the feature stops fitting them, which is also exactly where the risk concentrates. If you keep one habit from this article: every time the builder says done, answer with a probe, not a skim.
The picture is not all holes, and pretending otherwise wastes the real advantage of building on a platform.
The picture is not all holes, and pretending otherwise wastes the real advantage of building on a platform. HTTPS is provisioned and renewed for you. Databases on managed services are typically network-isolated by default, not sitting on the open internet the way a self-installed one so often is; verify the setting rather than inheriting the assumption. Frameworks escape template output by default, which is why XSS now arrives through explicit escape hatches rather than every page. Hosted auth, where you use it, means the password machinery, hashing, reset tokens, session rotation, is maintained by people whose job is exactly that. Platform secrets stores keep keys out of code, and the big providers scan public repositories for their own key formats and warn you. None of this makes the five checks from the short answer optional, the platform cannot know that invoice 1043 belongs to someone else, that is application logic, and application logic is yours. The right division of credit: platforms have quietly solved the infrastructure half of web security for you; the application half, authorization, validation, secrets hygiene, verification of what reaches your endpoints, is what this article's hour is for.
Everything above, compressed into one sitting, ordered by payoff.
Everything above, compressed into one sitting, ordered by payoff. Minutes 0-15, the two-account test on your core object type: Ada's private record, reached from Bea's browser by URL and by replayed request, refused everywhere it appears, page, JSON, download, export. Minutes 15-25, the secret sweep: search the codebase for the key shapes, confirm nothing powerful ships to the browser, check git history for anything that ever did, and rotate whatever you find. Minutes 25-35, the input probes: the quote test in search and filter fields, a script tag in anything that displays back, and a check that the responses come back encoded or rejected, never executed. Minutes 35-45, the endpoints: confirm every webhook verifies its signature with the official library, every public form has a rate limit, and any fetch-a-URL feature refuses private addresses. Minutes 45-55, the lights: response headers on your main pages, CSP at least on the roadmap, nosniff and referrer policy present; logs recording sign-ins, denials, and admin actions, and not recording passwords or tokens. Final five minutes: write down what failed, because the list is the deliverable, and each item is a one-sentence fix request to your builder. Run it again after every big generated change. An app that passes this hour is not hardened against a motivated professional, that is the next section's topic, but it is no longer low-hanging fruit for the automated, opportunistic scanning that runs continuously against everything on the internet.
The 60-minute pass addresses the automated-opportunist tier.
The 60-minute pass addresses the automated-opportunist tier. Some situations call for more, and the triggers are recognizable. You hold regulated data, health, financial, children's, and a compliance framework enters the picture with its own control lists and evidence requirements; that is specialist territory by definition. You are about to sign a customer whose security review asks how you test, which is really asking whether anyone skilled has ever attacked your app with permission; a penetration test is the answer they are looking for, and the two-account test is not a substitute for it. Your app is gaining enough users that a breach would be a news event for your customers, not just for you: the economics of a few days of professional testing start beating the economics of apology. And anything that already went wrong, a key leaked, a strange spike in the logs, a user reporting data that was not theirs, is a professional-review trigger, not a prompt-engineering problem. A bug bounty, where invited researchers probe you for rewards, makes sense only after the basics hold, otherwise you are paying strangers to find what section 24 finds free. The ordering is the point: pass your own hour first, because a professional should spend their time on what you cannot see, not on invoice 1043.
Six, each seen constantly in small apps.
Six, each seen constantly in small apps. Hiding instead of checking: removing the link to the admin panel or the delete button from the page while the endpoint underneath still answers anyone who asks; the endpoint is the boundary, the UI is decoration. Security through obscurity: long random URLs as the only protection, which leak through referrers, logs, screenshots, and forwarding; a URL anyone can share is a key, treat it like one. Trusting client-side checks: validation or permission logic in JavaScript the user can read and bypass, because the browser is the user's territory, not yours. Logging the wrong things: full request bodies and headers for debugging, which quietly build a database of passwords and tokens beside the real one. Assuming the framework covers the exception: ORM protection that ends at the one raw query, template escaping that ends at the one innerHTML, defaults that end exactly where the interesting feature begins. And the meta-mistake that enables the rest: treating "the AI wrote it" as a review verdict, when generation and review are different acts and only one of them happened. A seventh that deserves its own sentence: fixing a found bug silently and moving on. Every failure the 60-minute pass surfaces is also a test case; the two-account probe that once showed Bea an invoice should become a check you re-run after every change to the data layer, because authorization bugs regress quietly whenever a new endpoint, export, or view appears and nobody asks it the question.
Is my app too small to be attacked?
Is my app too small to be attacked? No, because the first wave is not aimed at you: scanners sweep the internet for known shapes, published keys, open databases, unverified webhooks, and whatever they find gets used, for crypto mining, spam, or a foothold. Size changes who attacks you, not whether. Do I need to learn to code to run these checks? No: every check in the 60-minute pass is clicking, typing probes, and reading, and the fixes are one-sentence requests your builder understands. Is AI-generated code less secure than human code? That is the wrong comparison; the honest one is generated-and-unreviewed versus written-and-reviewed, and the fix is to supply the missing review as questions and probes rather than line-reading. My platform says it is secure, am I done? The platform secures its infrastructure; the rules about your users' data are your application logic, and no platform can write those for you. How often should I re-run the pass? After every significant generated change to data handling, auth, or endpoints, and on a schedule otherwise; the checks take an hour because they are habits, and habits decay. Should I tell my AI builder to "make the app secure"? As a single instruction, no: it produces reassuring-looking additions nobody verified. What works is the specific version, per feature: verify ownership on the server for every record access, parameterize every query including search, verify webhook signatures with the official library before handling, add a rate limit to this endpoint. Specific, testable, and each one maps to a probe in the 60-minute pass that confirms the fix actually landed.
Security for an AI-built app is not a new discipline stacked on the old one; it is the old discipline, access control first of all, applied to code nobody reviewed while writing.
Security for an AI-built app is not a new discipline stacked on the old one; it is the old discipline, access control first of all, applied to code nobody reviewed while writing. The model that organizes it fits on a card: your app is a door with three questions, who are you, what may you touch, is this input safe, and a bug is a question nobody asked. OWASP's 2025 data says the industry still fails the second question more than any other, so start there: two accounts, one private record, one changed URL. Then the leaks, keys in bundles and history, the injections, probes in every input, the endpoints, signatures and limits, and the lights, logs that see attacks without hoarding secrets. One hour, run today and re-run after big changes, moves your app out of the tier the scanners eat. For the adjacent pieces of the same craft, the auth-explained article goes deeper on sessions and reset flows, and the databases article covers the storage side this one touches only at the query boundary.
The checklists, worked examples, and judgment calls are editorial; verify security-critical configuration against the current documentation of the services you use.
The checklists, worked examples, and judgment calls are editorial; verify security-critical configuration against the current documentation of the services you use.

Long-form guides on building, automating and AI computing.