Impact
HTTPX2 FileField.render_headers() concatenates the content_type and any custom headers supplied in the files tuple directly into multipart/form-data part headers without validation; this is a header injection vulnerability (CWE-93). An attacker can inject CR or LF characters to prematurely terminate a header, insert additional headers, or close the header block early. This manipulation can lead a downstream parser to treat attacker‑supplied lines as legitimate headers, thereby altering request semantics and potentially bypassing header‑based checks. The vulnerability does not provide direct code execution but enables the attacker to change how the server interprets the request, which could be used to redirect traffic, trigger unintended behavior, or facilitate other attacks.
Affected Systems
The library pydantic:httpx2, in all releases prior to v2.11.0, is affected. The vulnerability resides in the FileField.render_headers() function used by applications that construct multipart/form-data requests containing file uploads. Any deployment of httpx2 older than v2.11.0 that passes unsanitized content_type or custom header values to the files parameter is at risk.
Risk and Exploitability
The CVSS score of 5.3 classifies the issue as moderate severity. An EPSS score is not available, and it is not listed in CISA’s KEV catalog. The attack requires the ability to craft multipart/form‑data requests with injectable content_type or custom headers, which is typically available to an application that uses HTTPX2 to send outgoing requests. Exploitation could allow an attacker to manipulate downstream request handling by adding or altering headers, potentially leading to bypass of security controls or request smuggling.
OpenCVE Enrichment