Unnecessary HTTP Methods Enabled

The server accepts HTTP methods the application does not need, such as PUT, DELETE or WebDAV methods, widening what an attacker can attempt.

SeverityLow
CVSS 3.13.7 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N Open in the calculator
CVSS 4.06.3 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-749: Exposed Dangerous Method or Function
OWASP Top 10A01:2025 Broken Access Control
CategorySecurity Misconfiguration

Description

The web server or application accepts HTTP methods beyond those the application needs, which for most web applications are GET, HEAD and POST, with PUT, PATCH and DELETE added only where an API is designed to use them. Commonly found are PUT and DELETE, which can create, replace or remove files where a handler or WebDAV module processes them; the WebDAV methods, such as PROPFIND, MKCOL, COPY, MOVE and LOCK, which can list and change content; and arbitrary or unknown methods that the server treats as GET.

Where an unnecessary method is honoured, an attacker may be able to upload files, including web shells that run code on the server, alter or delete content, or list directory contents. Access rules written for particular methods can also be bypassed: rules in Apache <Limit GET POST> blocks, or Java EE security constraints that list specific methods, leave every other method unrestricted, so the same request sent with another method may reach the protected resource without authentication. In the typical case, however, the methods are accepted but no damaging effect can be shown, because file permissions or handlers prevent it, and the finding represents unnecessary attack surface that a later configuration change could make exploitable.

The methods are identified by sending an OPTIONS request and reading the Allow header but, because that header is not always accurate, each method is also tested directly, for example with curl or the Nmap http-methods script. A method that is shown to change or reveal content, such as a successful PUT upload, is normally reported as a more serious finding in its own right.

Remediation

Accept only the methods each part of the application needs, and refuse the rest, ideally with 405 Method Not Allowed:

  • Disable WebDAV where it is not used, for example by removing the WebDAV Publishing feature on IIS, or by disabling mod_dav and mod_dav_fs on Apache.
  • Restrict methods at the web server, as below, and in API frameworks, where each route should accept only the methods it implements. Allow OPTIONS only where cross-origin preflight requests need it.
  • Write access rules that apply to every method and deny by default: use <LimitExcept> rather than <Limit> in Apache, and <deny-uncovered-http-methods/> in Java web.xml files.
# nginx location / { limit_except GET POST { deny all; } } # Apache <Location "/"> <LimitExcept GET POST> Require all denied </LimitExcept> </Location> <!-- IIS (web.config) --> <system.webServer> <security> <requestFiltering> <verbs allowUnlisted="false"> <add verb="GET" allowed="true" /> <add verb="HEAD" allowed="true" /> <add verb="POST" allowed="true" /> </verbs> </requestFiltering> </security> </system.webServer>

In nginx and Apache, allowing GET also allows HEAD. Confirm the fix by sending each unneeded method to the application's paths: each should be refused.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Web Applications Findings

Every Web Applications finding