Safeguard
Application Security•

ASVS 5.0 V13.4.4: Disable the HTTP TRACE Method

ASVS 5.0 V13.4.4 (Level 2) says production must not support HTTP TRACE. How to turn it off in common servers and prove it with curl.

Safeguard Security Team
2 min read

ASVS 5.0 V13.4.4 is a Level 2 requirement. Production systems must not support the HTTP TRACE method.

TRACE echoes the request back to the client. That is a diagnostic feature nobody needs on a live site.

Why it matters

An echoed request includes headers added along the path. Historically, cross site tracing could be used to read headers that scripts should not see. Modern browsers block most of that, but the requirement stays because the echo can still reveal internal headers added by proxies, such as addresses and authentication hints.

How to implement it

nginx rejects TRACE with 405 in most builds, but make it explicit:

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

Apache:

TraceEnable off

Tomcat disables it by default through allowTrace="false" on the connector. Confirm that the value was not changed.

Also check every layer: the load balancer, the CDN, the application server and any sidecar.

How to test it

curl -i -X TRACE https://example.com/ -H "X-Probe: abc123"

Pass: a 405, 403 or 501 and no echo of X-Probe in the body. Fail: a 200 with message/http content that repeats your header.

Common mistakes

  • Testing only the CDN hostname and not the origin.
  • Assuming the framework handles it when a separate reverse proxy answers TRACE itself.
  • Blocking TRACE but allowing arbitrary methods through to the application.

Quick check

Which status code should I expect?

Any refusal is fine: 405 Method Not Allowed is the most accurate, and 501 or 403 also pass. The thing to verify is that nothing is echoed back.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.