PromptCode reviewOutput shown

Security review of one function

Look for the common web vulnerabilities, with no invented problems.

What you get

You should get a list of findings grouped by category: injection, deserialisation, authorisation, secrets, file paths and input validation. Each finding names the line, the attack in one sentence and the smallest fix. Categories without a problem should say 'no issue found' rather than inventing something. It is a quick first pass, not a security audit.

Example output (illustration of the shape of a result, not a recorded test)

SQL injection: line 12 builds the query with string concatenation. An attacker sends ' OR '1'='1. Fix: use a parameterised query.
Authorisation: no issue found.
Secrets: no issue found.

How to use it

  1. Scroll to the end of this page and copy the prompt.
  2. Replace each [bracket] and paste your code or diff at the end of the prompt.
  3. Read the answer as a second opinion. Check each finding against the code before you act on it.

Fill in these fields

Change only the parts in [brackets]. The rest of the wording keeps the answer on task.

FieldWhat to enter
[language]Your own details.
[paste the function and how it is called]Your own details.

Change it for your case

  • For a web endpoint, add the framework and how authentication is done.
  • If you want a fix as code, add 'show the corrected function after the list'.
  • For a script that handles files, add 'the input comes from a user upload'.

Tips

  • Include how the function is called. Many problems depend on who can reach it.
  • This does not replace a proper security audit.

The prompt

Copy it, then fill in the [brackets]. We have not tested this prompt; we call a prompt tested only when a test result is shown.

Review this [language] function for security problems: injection, unsafe deserialisation, missing authorisation, secrets in code, unsafe file paths, and unvalidated input.
For each finding give: the line, the attack in one sentence, and the smallest fix.
If a category has no issue, write 'no issue found'. Do not invent problems to look thorough.

[paste the function and how it is called]