HTTP Methods Check
HTTP methods like TRACE, PUT, DELETE, and CONNECT can expose your server to Cross-Site Tracing (XST) attacks, unauthorized file manipulation, and server-side request forgery if left enabled unnecessarily. Most web applications only need GET, POST, and HEAD.
Results in 1–3 minutes · Free · No signup required
Why It Matters
TRACE enables Cross-Site Tracing (XST) attacks — attackers can steal HttpOnly cookies and Authorization headers by tricking a browser into sending a TRACE request. PUT and DELETE can allow unauthorized file uploads or deletions if not protected. OPTIONS responses leaking allowed methods give attackers a roadmap of your attack surface. These misconfigurations are actively scanned by automated vulnerability tools and appear in OWASP testing guides (OTG-CONFIG-006).
How We Check
We send an OPTIONS request to discover the server's advertised allowed methods, then specifically test for TRACE support with a direct TRACE request. We flag any methods beyond GET, POST, and HEAD that are accessible without authentication.
Good vs Bad Values
| Value | Verdict | Why |
|---|---|---|
Allow: GET, HEAD, POST, OPTIONS | Good | The set a typical website needs. OPTIONS is required for CORS preflights on APIs. |
TRACE returns 405, 403 or 501 | Good | Disabled. This is the expected response. |
TRACE returns 200 and echoes the request | Bad | Enables Cross-Site Tracing: script can read headers a browser would otherwise hide, including some credentials. |
OPTIONS lists PUT, DELETE, TRACE, CONNECT | Bad | Advertises state-changing and proxy methods and shows attackers what to try. |
PUT or DELETE succeeds without authentication | Bad | Anyone can upload or remove files on the server. Treat as critical. |
CONNECT accepted on a web server | Bad | May turn the server into an open proxy that tunnels traffic to arbitrary hosts. |
PUT, PATCH, DELETE on a REST API, 401 for anonymous callers | Good | Expected. The methods exist but are guarded by authentication and authorisation. |
Unknown method (for example FOO) returns 405, 501 or 400 | Good | The server rejects methods it does not implement instead of passing them to the application. |
How to Fix
Restrict HTTP methods to only those your application uses:
Apache — add to .htaccess or VirtualHost:
<LimitExcept GET POST HEAD>
Require all denied
</LimitExcept>
Nginx — add to your server or location block:
if ($request_method !~ ^(GET|POST|HEAD)$) {
return 405;
}
IIS — in web.config, remove handler mappings for unused verbs:
<system.webServer>
<security>
<requestFiltering>
<verbs allowUnlisted="false">
<add verb="GET" allowed="true" />
<add verb="POST" allowed="true" />
<add verb="HEAD" allowed="true" />
</verbs>
</requestFiltering>
</security>
</system.webServer>
Caddy — add to your Caddyfile:
@blocked {
not method GET POST HEAD
}
respond @blocked 405
Node.js / Express — add early middleware:
app.use((req, res, next) => {
if (!['GET','POST','HEAD'].includes(req.method)) {
return res.sendStatus(405);
}
next();
});
Apache — turn TRACE off globally in the main config (the LimitExcept rule above does not cover it):
TraceEnable Off
Next.js — route handlers only respond to the HTTP methods you export (GET, POST, …); any other method gets an automatic 405, so no extra code is needed.
Cloudflare — WAF → Custom rules → expression (http.request.method eq "TRACE") or (http.request.method eq "CONNECT"), action Block.
Test from a terminal:
curl -i -X TRACE https://example.com/
curl -i -X OPTIONS https://example.com/ | grep -i '^allow'
Common Mistakes
- Blocking OPTIONS on a site whose API is called from another origin. Browsers send a preflight OPTIONS first; if it is refused, every cross-origin call fails. Add OPTIONS to the allowed list.
- Restricting methods at the application but not the proxy in front of it (or vice versa). Test the public URL.
- Assuming a framework disables TRACE. Older Apache and Tomcat builds, and some hardware load balancers, answer TRACE unless told not to.
- Allowing WebDAV modules (`mod_dav`, IIS WebDAV) that were installed for a past project and still accept PUT and PROPFIND.
Frequently Asked Questions
Which HTTP methods are dangerous and should be disabled?
TRACE, PUT, DELETE, CONNECT, and PATCH should be disabled on most production web servers. TRACE enables Cross-Site Tracing (XST) attacks that can steal cookies and credentials. PUT and DELETE can allow unauthorized file manipulation. Only GET, POST, and HEAD are required for typical web applications.
How do I check which HTTP methods my server allows?
Send an OPTIONS request to your server: `curl -X OPTIONS -v https://yourdomain.com/`. The response will include an `Allow` header listing enabled methods. Alternatively, use SecScanner's free HTTP Methods Checker to instantly test your site and get a pass/fail result with remediation steps.
How do I disable the TRACE method in Nginx?
Add this to your Nginx server or location block: `if ($request_method !~ ^(GET|POST|HEAD)$) { return 405; }`. This returns HTTP 405 Method Not Allowed for all methods except GET, POST, and HEAD.
How do I disable the TRACE method in Apache?
Add `TraceEnable off` to your Apache configuration (httpd.conf or .htaccess). To restrict all non-essential methods, use `<LimitExcept GET POST HEAD>` with `Require all denied` inside.
What is a Cross-Site Tracing (XST) attack?
XST is an attack that uses the HTTP TRACE method to read request headers — including HttpOnly cookies and Authorization headers — that JavaScript cannot normally access. An attacker tricks a victim's browser into sending a TRACE request; the server echoes all headers back, which the attacker's script can read. Disabling TRACE completely prevents this attack.
Related Security Checks
Check Your Website Now
Run a free security scan to check for HTTP Methods Check issues and 61 other security checks.
Scan Your Website Free