Skip to main content

Claude/ChatGPT Prompt to Run an OWASP Top 10 Review of an API Endpoint

Targeted OWASP Top 10 2025 review of one API endpoint: per-risk verdict, code evidence, severity, remediation code, and a regression test.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt

                                

What this prompt does

This prompt runs a focused OWASP Top 10 (2025) review of a single API endpoint and demands evidence, not opinions. The model walks each risk category, states present yes or no, and — for every yes — cites the exact line of code as proof. It then assigns a rough CVSS severity, writes real remediation code, and produces a regression test that fails before the fix and passes after. Forcing line-level evidence is what stops it inventing phantom vulnerabilities.

The variables scope the review tightly. [method] and [path] identify the endpoint under test. [endpoint_code] is the substance — you paste the route and controller so the model has something to cite rather than guess at. [auth_model] tells it how authentication and authorization actually work, which is decisive for the access-control checks the prompt asks it to scrutinize hardest.

When to use it

  • You are reviewing one endpoint before it ships and want a per-risk verdict
  • You suspect broken object-level authorization — the classic edit-the-id-read-someone-elses-record bug
  • You want findings backed by exact line evidence, not generic security advice
  • You need remediation code you can apply, plus a test that proves the fix
  • You want a rough CVSS severity to prioritize what to fix first
  • You are checking injection or SSRF risk in an endpoint that takes user input

Example output

The model returns a table with columns for risk, present, evidence, and severity covering the 2025 OWASP Top 10. Below it come remediation snippets for each real issue and the matching regression tests. Findings marked yes point to specific lines from the [endpoint_code] you pasted, with a one-line CVSS justification, so you can trace every claim back to the source.

Pro tips

  • Paste the full [endpoint_code] — route, controller, and any middleware — so the model can cite real lines instead of assuming
  • Describe [auth_model] precisely ("Sanctum bearer token, policy-gated"); access-control findings hinge on how authorization actually runs
  • Push hard on broken access control, injection, and SSRF, which the prompt already flags for extra scrutiny
  • Verify the access-control fix manually with a second user's token before shipping — that is the bug class the prompt is best at catching
  • Treat the CVSS numbers as rough triage signals, not audited scores; they exist to rank, not to certify
  • For endpoints that call other services, make sure the SSRF section accounts for any user-controlled URLs or identifiers
  • Include any middleware or policy class in [endpoint_code], not just the controller method, since authorization often lives a layer up from the handler
  • Run the generated regression test in your suite before and after the fix, so you have proof the vulnerability is closed rather than just a patched line

Frequently Asked Questions

Does the review require evidence or does it just guess at vulnerabilities?
It requires evidence. For every risk it marks present, the prompt makes the model cite the exact lines from the code you paste into `[endpoint_code]`. This is deliberately designed to stop it reporting phantom findings you would otherwise have to chase down.
Will it catch broken object-level authorization?
Yes, the prompt puts extra scrutiny on broken access control specifically. That includes the common case where a user edits an id in the request and reads another user's record. Still verify the fix yourself with a second user's token before shipping.
Are the CVSS severities authoritative?
No, they are rough estimates with a one-line justification each, meant to help you triage which findings to fix first. Treat them as prioritization signals rather than formally scored, audited CVSS ratings for a compliance report.
Does it give me a way to verify the fix actually works?
Yes, deliverable 5 is a regression test that fails before the remediation and passes after. That gives you a repeatable check so the same vulnerability cannot silently return in a later change to the endpoint.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in Cybersecurity Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support