Skip to main content
LowAPIOWASP A05:2021CWE-16

How to fix: TRACE method referenced in API response body

A response body explicitly lists TRACE as a supported method (e.g. in a route config or API documentation payload the server exposes), which is unusual enough to be worth checking even though it doesn't confirm the verb is actually enabled.

Why it matters

Cross-Site Tracing (XST) lets an attacker reflect a victim's cookies and Authorization headers, including HttpOnly cookies, back through the browser, bypassing the HttpOnly restriction and enabling session theft, if TRACE is genuinely enabled.

This is a content match on the response body only, not a live TRACE request. See the separate 'HTTP TRACE method enabled' finding for the Allow-header signal, which is the more direct indicator that the verb is active.

How to fix it

  1. 1Disable TRACE on the server or reverse proxy
  2. 2In Nginx: return 405 for TRACE requests
  3. 3In Apache: add TraceEnable Off to httpd.conf
  4. 4In Express: reject TRACE at the middleware layer before routing

Code examples

Nginx: disable TRACE

nginx
# In your server block
if ($request_method = TRACE) {
    return 405;
}

Apache: disable TRACE

APACHE
# In httpd.conf or .htaccess
TraceEnable Off

Express.js: reject TRACE

JavaScript
app.use((req, res, next) => {
  if (req.method === 'TRACE') {
    return res.status(405).end();
  }
  next();
});

References

Detected automatically by VulnRadar. The check id is api-rest-allow-methods-trace, stable across every scan so you can filter or diff on it.

See every api check

Questions

How severe is TRACE method referenced in API response body?
VulnRadar rates this low 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-trace, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does TRACE method referenced in API response body map to?
It maps to CWE-16. 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 trace method referenced in api response body

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

TRACE method referenced in API response body fix | VulnRadar