Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
righettod authored Jul 2, 2024
1 parent cf4d87f commit da5b681
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions other/httpMethodOverrideCapability.bcheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
metadata:
language: v2-beta
name: "HTTP method override capability detected"
description: "Check for the support for a request parameter or a request header allowing to override the HTTP method."
author: "Dominique Righetto"
tags: "active"

define:
test_method = "OPTIONS"

# To prevent causing any trouble on the target app then only apply the check on GET requests
# Sources:
# https://github.com/PortSwigger/param-miner/blob/master/resources/headers
# https://github.com/PortSwigger/param-miner/blob/master/resources/params
# https://owasp.org/www-project-web-security-testing-guide/stable/4-Web_Application_Security_Testing/02-Configuration_and_Deployment_Management_Testing/06-Test_HTTP_Methods
# https://www.sidechannel.blog/en/http-method-override-what-it-is-and-how-a-pentester-can-use-it/
given path then
if {base.request.method} is "GET" then
send request called checkOverrideSupport:
appending headers:
"x-method-override": `{test_method}`,
"x-http-method-override": `{test_method}`,
"x-http-method": `{test_method}`,
"request-method": `{test_method}`
appending queries:
`method={test_method}`,
`_method={test_method}`

if {checkOverrideSupport.response.headers} matches "(?i)allow:\s+[A-Z,]+" then
report issue:
severity: info
confidence: firm
detail: "Endpoints support a hidden parameter/header, allowing to override the HTTP method effectively used to handle the HTTP requests."
remediation: "Remove the support for the hidden request parameters/headers."
end if
end if

0 comments on commit da5b681

Please sign in to comment.