Skip to main content
MediumAPIOWASP A05:2021CWE-16

How to fix: HTTP TRACE method enabled

HTTP TRACE method is enabled on the server. TRACE reflects the full request including headers, enabling Cross-Site Tracing (XST) attacks.

Why it matters

Cross-Site Tracing (XST) exploits TRACE to reflect the victim's cookies and Authorization headers, including HttpOnly cookies that JavaScript cannot read, back through the browser in a cross-origin context, enabling session theft even when HttpOnly is correctly set.

HTTP TRACE is intended for diagnostic loop-back testing but is rarely needed in production. When enabled, it can be exploited via XST to steal credentials from authenticated users.

How to fix it

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

Code examples

Nginx: disable TRACE

nginx
server {
    if ($request_method = TRACE) {
        return 405;
    }
}

Apache: TraceEnable Off

APACHE
# In httpd.conf
TraceEnable Off

Express.js: reject TRACE globally

JavaScript
app.use((req, res, next) => {
  if (req.method === 'TRACE') {
    return res.status(405).set('Allow', 'GET, POST, PUT, DELETE').end();
  }
  next();
});

References

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

See every api check

Questions

How severe is HTTP TRACE method enabled?
VulnRadar rates this medium 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 trace-method-enabled, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does HTTP TRACE method enabled 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 http trace method enabled

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

How to fix: HTTP TRACE method enabled | VulnRadar