Skip to content
GHSA 5pww 8rfg 9crf

GHSA 5pww 8rfg 9crf

github.com • November 9, 2026

OWASP CRS multipart filename-inspection rules (CRS rule 920120, 922100, 922110, etc.) extract the filename from the Content-Disposition header using regex or ModSecurity's MULTIPART_NAME / MULTIPART_FILENAME variables. These operate on the raw header bytes as parsed by ModSecurity's multipart parser.

ModSecurity's multipart parser does not implement RFC 2231 (MIME parameter value extensions — language/charset encoded parameters using name*=charset''value syntax). RFC-compliant application parsers do, and when both filename and filename* are present in a Content-Disposition , they prefer the RFC 2231 decoded value of filename* over the plain filename . This is not a Go-specific quirk — it is the behaviour of every mainstream server-side multipart parser that implements the RFC:

Go's mime.ParseMediaType is used as the primary reference below because its stdlib source is compact and unambiguous, but the bypass applies identically to the Python, Node, and Java backends above.

Result: An attacker can put a benign filename in the filename= parameter (passes WAF rules) and a malicious filename in the filename*=UTF-8'' parameter (parsed by Go, ignored by WAF):

ModSecurity / OWASP CRS: sees filename="safe.jpg" — passes all filename extension rules

Go backend p.FileName() via mime.ParseMediaType : returns shell.php

If the Go application uses the returned filename for any security-relevant operation (file storage, extension checking, content-type inference), the WAF protection is entirely bypassed.

Malicious multipart request

Extracted Entities