From 621da6eb0d5f248cd677e39afc6437e1109bb789 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Fri, 28 Nov 2025 11:19:16 +0100 Subject: [PATCH] Fix prevent use of TRACE method in waf --- htdocs/waf.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/waf.inc.php b/htdocs/waf.inc.php index f514b46af26..60fc4e9c453 100644 --- a/htdocs/waf.inc.php +++ b/htdocs/waf.inc.php @@ -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"]);