HTTP PUT method is enabled. This may result in letting malicious user upload malicious content or code to the web server, thus further causing further security compromise.


What is HTTP PUT method?
The PUT method requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. .i.e. HTTP PUT method makes another asset or replaces a representation of the target asset with the new request payload at the origin of server.
PUT /root.html HTTP 1.1

The PUT method demands that the attached file be put under the provided URL. In the event that the URL points to an already existing file, the attached file shall be considered as an modified version of the one present on the server. On the off chance that the URL does not point to a current file, and that URL is capable for being characterized as another file by requesting user agent, the server can make the file with that URL.
PUT /root.html HTTP 1.1
Content-Type: text/html
Content-length: 30

<p> file via PUT method <p>

Verification of vulnerability:

If HTTP PUT request gives response as ?201 Create? then file in PUT request was successfully created on specified URI.
If HTTP PUT request gives response as ?200 OK? then file in PUT request was successfully modified on specified URI if it was in accordance with the file type present on server.


To disable HTTP PUT in Apache:
RewriteRule .* - [F]

To disable HTTP PUT in IIS:

  1. Open IIS Manager
  2. Select the name of the machine to configure this globally (or change to the specific web site for which you need to configure this)
  3. Double click on ?Request Filtering?
  4. Change to the HTTP Verbs tab
  5. From the Actions pane, select ?Deny Verb?
  6. Insert ?PUT? in the Verb, and press OK to save changes

To disable HTTP PUT in Tomcat:
<web-resource-name><strong>restricted methods</strong></web-resource-name>
<auth-constraint />