How to fix: PATCH method listed in Allow header
PATCH partially mutates a resource. This is a passive observation that the endpoint's Allow header advertises PATCH support (normal for any REST API with a PATCH route, including properly authenticated ones); it does not confirm the endpoint accepts unauthenticated writes.
Why it matters
If PATCH is genuinely unauthenticated, attackers can flip boolean fields (isAdmin, isActive, isVerified), change ownership IDs, or modify billing state: privilege escalation with no brute-force required.
An Allow header listing PATCH only confirms the verb is routed on this path, which is expected for any REST API with a PATCH endpoint. It says nothing about whether that endpoint enforces authentication; a properly protected PATCH route still advertises PATCH in Allow for CORS purposes.
How to fix it
- 1Require authentication on PATCH at the middleware layer before any routing
- 2Validate the JSON merge patch against an explicit allowlist of mutable fields
- 3Reject patches to privilege fields (role, isAdmin, isVerified) for non-admin callers
Code examples
Express: safe PATCH with field allowlist
const PATCHABLE_FIELDS = new Set(['name', 'bio', 'avatarUrl']);
router.patch('/users/:id', requireAuth, async (req, res) => {
if (req.user.id !== req.params.id) {
return res.status(403).json({ error: 'Forbidden' });
}
const patch = Object.fromEntries(
Object.entries(req.body).filter(([k]) => PATCHABLE_FIELDS.has(k))
);
if (Object.keys(patch).length === 0) {
return res.status(400).json({ error: 'No valid fields to update.' });
}
await db.users.patch(req.params.id, patch);
res.json({ success: true });
});References
Detected automatically by VulnRadar. The check id is api-rest-allow-methods-patch-no-auth, stable across every scan so you can filter or diff on it.
More api checks
- LowTRACE method referenced in API response body
- InfoREST endpoint allows DELETE
- LowGraphQL introspection field suggestions
- MediumGraphQL endpoint has no rate-limit headers
- LowOpenAPI server URL leaks internal host
- LowCORS preflight result not cached
- HighBearer token in URL query string
- MediumJSONP callback parameter accepted
Questions
- How severe is PATCH method listed in Allow header?
- VulnRadar rates this info severity in the api category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id api-rest-allow-methods-patch-no-auth, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does PATCH method listed in Allow header map to?
- It maps to CWE-862. In the OWASP Top 10 it falls under A01:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.