Express Security Review Skill for Cursor
Review an Express app for middleware order, Express 5 route syntax, validation, and auth. Use for an Express security review. Do not use for a Fastify or NestJS app, or to forward errors twice.
name: "express-security-review" description: "Review an Express app for middleware order, Express 5 route syntax, validation, and auth. Use for an Express security review. Do not use for a Fastify or NestJS app, or to forward errors twice." paths:
- "/routes//*.ts"
- "/routes//*.js"
- "**/app.ts"
- "**/server.ts"
- "src/index.ts"
Express Security Review Skill for Cursor
Cursor skill express-security-review for Express. Run it with /express-security-review, or let Agent select it when the request matches. paths only limits automatic surfacing.
When to run
Run this review for an Express router, middleware order, or an Express 4 to 5 migration.
When to leave it
Stop for Fastify, Nest, or another framework. Do not upgrade Express unless the user asked.
Steps
- Read the installed Express major. On 5, an old
/*wildcard or a regex route copied from 4 is a high finding. On 4, do not introduce 5-only syntax. - Walk middleware order. Auth after the route, or a body parser after the handler, is a high finding.
- For each write, confirm a schema and an auth check. A missing one is a high finding.
- Search for
next(err)on a path that also sends a response. Double-send is a high finding. - Confirm
express.jsonhas a limit. - Run the test script only if the user asked. Otherwise write
not run.
Output
Findings with severity, file, line, the route, and a fix. Include the Express major.
## Findings
- high | path:line | what is wrong | what to do instead
## No findings
Say "No findings" and list the files you opened. A search you skipped is not a clean result.
## Example
Input: an Express 5 router still has `app.get('/*', handler)`.
Output: high | src/app.ts:22 | Express 5 throws at startup on an unnamed `*` | use `/*splat`.
Do not flag the valid pattern named in the standards. Flag the mistake next to it.
What to check
- Injection: SQL or a shell command built by concatenating
req.bodyorreq.query. - XSS:
res.sendof user HTML with no escape. - CSRF: a cookie-session write with no CSRF check and a reflected
Origin. - Secrets:
process.envvalues written to the response or the log. - IDOR:
req.params.idloaded with no owner check after auth. - SSRF:
fetch(req.body.url)with no host allow-list.
Stop
Stop when the user asks you to remove auth middleware to debug a route.
Severity
high is a bug a caller can hit or a secret that leaks. medium is a broken contract that needs a specific input. low is a cleanup that does not change behaviour.