Help for owners
An AI assistant wrote my backend and I do not know if it is safe
Short answer
Working and safe are different. Code from any author, human or AI, needs the same review. The OWASP Top 10 is the standard list of critical web risks; first on its list is broken access control, such as one user seeing another user's account by changing an identifier. A developer reviews who can reach what, how secrets and logins are handled and what happens on errors.
Does this sound like your situation?
- The server works in tests, but nobody has reviewed it.
- I do not know whether one customer could see another customer's data.
- The code has keys and passwords in it, or in the repository.
- Logins, admin pages or APIs were added quickly and never reviewed.
- A customer, investor or insurer asked for a security review.
Why does this happen?
The code runs, so it looks finished
A backend can pass every test the owner can think of and still allow requests it should refuse. These checks are not visible on a normal click-through, so they are the easiest to miss, whoever wrote the code.
Broken access control is first on the OWASP list
OWASP describes it as a failure to enforce policy so that users cannot act outside their intended permissions. Its examples include changing an identifier in a URL to view another user's account, an admin page reachable just by typing its address, and checks that exist only in front-end JavaScript.
Confirmed by top10.owasp.org
The list has nine other categories to check
The OWASP Top 10 also names security misconfiguration, software supply chain failures, cryptographic failures, injection, insecure design, authentication failures, software or data integrity failures, logging and alerting failures, and mishandling of exceptional conditions.
Confirmed by top10.owasp.org
OWASP is meant as a starting point
OWASP calls the Top 10 a standard awareness document that reflects a broad consensus about the most critical security risks to web applications, and a first step toward more secure software. It is not a full audit.
Confirmed by owasp.org
What can I do about it today?
- Do not share the code or keys publiclyKeep the repository private. If a key or password appeared in a chat or repository, treat it as exposed and ask a developer to replace it.
- Keep real customer data out until reviewedUse test data in the meantime. A review first costs less than telling customers about an exposure.
- Make a list of what the server doesWho can log in, what admin screens exist, what data is stored and what other services it calls. Even a rough list helps a reviewer.
- Check that backups existAsk your host whether the database is backed up and who can restore it. Only look; do not change anything.
- Ask the AI tool nothing new about security yetMore suggestions applied without review can add more unknowns. Gather questions and give them to the reviewer.
- Book a review before launchA written review, not a verbal 'looks fine', is what you can show a client or insurer.
When should I bring someone in?
- The backend stores personal data, payments or private documents.
- Several user roles exist, such as customer and admin.
- A secret has already been pasted into a chat, a commit or a public place.
How do I handle it?
- Read the code as I would any otherI review it the same way whoever wrote it: access checks on every route, input handling, secrets, logins, error handling and dependencies.
- Test the risky pathsI try the cases from the OWASP list on a copy: reaching another user's data, calling admin routes without rights, and sending bad input.
- Write the findings in plain languageYou get a ranked list: what is wrong, how serious, and what it takes to fix. It cannot prove that no issue exists.
- Fix and retestI make the changes after a backup, retest the same cases and keep a way to roll back.
- Set a routineFuture AI-written or human-written changes are reviewed before release.
The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.
What do owners ask about this?
Is AI-written code less safe than human code?
I do not make that claim. Any code needs review, and the risks in the OWASP list apply whoever wrote it.
Will it be certain to be secure afterwards?
No. A review reduces known risks and gives you a written record. It cannot prove that nothing is wrong.
Is OWASP enough as a checklist?
It is a good starting point, but OWASP describes it as awareness, not a full audit. I add checks specific to your app.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.
For your developer: the technical fixes
remote: error: GH013: Repository rule violations found for refs/heads/main. (a push blocked because it contains a secret)An API key or .env file was committed to a Git repositoryJsonWebTokenError: jwt malformedjsonwebtoken rejects a token: invalid signature, jwt expired or jwt malformedAccess to fetch at 'https://api.example.com/orders' from origin 'https://app.example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.The browser blocks your API response: no Access-Control-Allow-Origin headerNOAUTH Authentication required.Redis answers NOAUTH Authentication required