Merge pull request #36455 from Hystepik/fix-prevent-use-of-trace-method

Fix prevent use of TRACE REQUEST_METHOD in waf
This commit is contained in:
Laurent Destailleur 2025-11-28 16:19:52 +01:00 committed by GitHub
commit 0d5c63e6d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -309,6 +309,13 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type, $stopcode = 1)
}
}
// Prevent the use of method TRACE
if ($_SERVER["REQUEST_METHOD"] == "TRACE") {
print 'Access refused with request method TRACE';
http_response_code(405);
exit();
}
// Sanity check on URL
if (!defined('NOSCANPHPSELFFORINJECTION') && !empty($_SERVER["PHP_SELF"])) {
$morevaltochecklikepost = array($_SERVER["PHP_SELF"]);