Skip to main content
InfoAPIOWASP A05:2021CWE-200

How to fix: OPTIONS response exposes state-changing HTTP methods

The OPTIONS response Allow header lists a state-changing method (TRACE, DELETE, or PUT), one of the higher-risk verbs to have reachable if the corresponding handler isn't properly authenticated. This is distinct from the separate 'full method allowlist' finding, which flags on verb count rather than which specific verbs are present.

Why it matters

Confirming TRACE, DELETE, or PUT are routed on this endpoint tells attackers exactly which higher-risk verbs to prioritize when probing for missing authentication or input validation.

An HTTP OPTIONS request returns the Allow header listing all methods the server accepts on that path. This check flags when a specific higher-risk verb (TRACE, DELETE, PUT) is present, regardless of how many total methods are listed.

How to fix it

  1. 1Restrict the Allow header to only methods that endpoint actually serves
  2. 2Disable OPTIONS on endpoints that do not need CORS
  3. 3Return 405 for any method not in the Allow list

Code examples

Express: explicit Allow header per route

JavaScript
router.all('/resource', (req, res, next) => {
  if (req.method === 'OPTIONS') {
    return res.set('Allow', 'GET, POST').status(204).end();
  }
  next();
});

Nginx: restrict HTTP methods

nginx
location /api/resource {
    limit_except GET POST OPTIONS {
        deny all;
    }
}

References

Detected automatically by VulnRadar. The check id is options-method-exposed, stable across every scan so you can filter or diff on it.

See every api check

Questions

How severe is OPTIONS response exposes state-changing HTTP methods?
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 options-method-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does OPTIONS response exposes state-changing HTTP methods map to?
It maps to CWE-200. In the OWASP Top 10 it falls under A05: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.

Propose a checkHow a check is built

Scan your own site for options response exposes state-changing http methods

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

OPTIONS response exposes state-changing HTTP methods | VulnRadar