Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10303 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

[PATCH] accept only known HTTP methods

Reported by: tarmo Assigned to: core
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc:

Description

Currently actionpack does not validate REQUEST_METHOD nor params[:_method]. Most applications can only handle a small set of methods so it makes sense to make sure that only those methods are accepted.

Also, the current implementation requires the http method name to be converted to a symbol, this means that if the server does not limit the accepted http methods it is possible to cause the server to leak a lot of memory just by sending it repeated http requests with long random _method parameters (or REQUST_METHOD heaader if the http server does not validate REQUEST_METHOD, (Apache) ).

In case you're implementing a webdav server make sure to add the accepted webdav methods into the ActionController::AbstractRequest.ACCEPTED_HTTP_METHODS set.

Attachments

http_method_validation.patch (3.1 kB) - added by tarmo on 11/28/07 21:41:44.

Change History

11/28/07 21:41:44 changed by tarmo

  • attachment http_method_validation.patch added.

11/29/07 02:08:54 changed by rick

  • status changed from new to closed.
  • resolution set to fixed.

(In [8235]) Raise UnknownHttpMethod exception for unknown HTTP methods. Closes #10303 [tarmo]