CVE-2022-50995: WWW::Form::UrlEncoded::XS versions before 0.27 for Perl read one byte before the input buffer when parsing an empty string
WWW::Form::UrlEncoded::XS versions before 0.27 for Perl read one byte before the input buffer when parsing an empty string.
parseurlencoded and parseurlencodedarrayref check for a trailing "&" or ";" by reading the last byte of the input, without first checking that the input has any bytes.
A remote client that sends an empty query string or request body to an application parsing it with this module can crash the process.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
WWW-Form-UrlEncoded-XSto a version that resolves this vulnerability.Fixed in 0.27
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using WWW::Form::UrlEncoded::XS before 0.27 are exposed when they parse client-controlled query strings or request bodies with parse_urlencoded or parse_urlencoded_arrayref. A remote client can trigger the condition by supplying an empty value.
What does an attacker need to do to exploit it?
The attacker only needs to cause the affected parser to process an empty string. The documented impact is a process crash.
Are normal non-empty requests affected?
The out-of-bounds read occurs specifically when the parser checks the last byte of an empty input. The provided information does not identify an impact for non-empty inputs.
What should be done if upgrading is not immediately possible?
Avoid passing empty query strings or request bodies to parse_urlencoded and parse_urlencoded_arrayref, such as by checking input length before invoking those functions. Upgrade to version 0.27 when possible.