Admin endpoint with no access check in sight
Partialhigh severity · reads .ts .js .mjs .cjsBeta
Anyone who knows or guesses the address can call an endpoint. An admin endpoint that never looks at who is calling gives every visitor admin actions (CWE-862, CWE-285). When Lintsure finds this, it marks it as Partial: it may be fine, depending on context only you can confirm.
What it looks like
A line Lintsure flags in its own test app:
// app/api/admin/users/route.ts
export async function DELETE(req: Request) {How to fix it
Check the caller's role at the top of the handler and return 403 when it is not an admin. Do it on the server: hiding the admin page in the browser does not protect the endpoint behind it.
Through a coding agent, Lintsure suggests the change and waits. Nothing is edited until you approve it.
Controls it relates to
- API5:2023Broken Function Level Authorization
- OWASP Top 10A01:2025Broken Access Control
What the framework asks
API5:2023: Broken Function Level Authorization
Admin and other privileged endpoints must check the caller's role on the server. Hiding the button in the app does not protect the endpoint.
Evidence a reviewer may ask for: A list of privileged endpoints and where each one checks the role.
Summaries are our own reading of the public texts, not the official wording.
Check your code for this
Runs on your machine. Your code is never uploaded.
npx lintsure scanThis rule is in Beta: its mapping to framework controls is our own reading of the public texts, not independently reviewed. Lintsure is a readiness tool, not an audit or legal advice. A finding, or the lack of one, doesn't make you compliant. Disclaimer
We improve these rules all the time. If you see a false alarm, a missed problem or anything that could work better, tell us in a review and we will use it to improve your experience.
Related rules
- Personal data written to logs
- Secret or private key committed to source
- Data sent over plain HTTP
- Personal data or tokens in a URL
Did this rule flag something that's fine, or miss a real problem? Tell us on GitHub. Every report becomes a test case, so the same mistake can't come back.