Perl Module WWW::Form::UrlEncoded::XS Patched for Buffer Under-Read Crash

A vulnerability in the Perl module WWW::Form::UrlEncoded::XS, identified as CVE-2022-50995, allowed remote attackers to crash applications by sending empty query strings. The flaw, a buffer under-read in versions prior to 0.27, was fixed in an update released in 2022. Users are advised to upgrade to version 0.27 or later to mitigate the risk of process termination.
Key points
- CVE-2022-50995 affects versions of WWW::Form::UrlEncoded::XS prior to 0.27, which are susceptible to a buffer under-read when parsing empty strings.
- The vulnerability occurs in the parse_urlencoded and parse_urlencoded_arrayref functions, which check for trailing characters without verifying if the input buffer contains any data.
- A remote client can exploit this flaw by sending an empty query string or request body, causing the application process to crash.
- The issue is classified as CWE-127, a buffer under-read weakness, and was resolved in version 0.27 of the module.
- The fix was implemented via a pull request on the module's GitHub repository and documented in the CPAN release notes for version 0.27.
Background
This vulnerability is part of a broader pattern of memory-safety issues in Perl XS modules, as seen in recent patches for Apache Perl and FFmpeg. The module WWW::Form::UrlEncoded::XS, maintained by Masahiro Nagano, has a history of memory-related fixes, including a segfault fix in 2018 and a memory reallocation bugfix in 2014. A related vulnerability, CVE-2022-50996, was also fixed in a subsequent version (0.28) in 2022, addressing a different memory corruption issue. The module is widely used for parsing form-encoded data in Perl applications.
Why it matters
Buffer under-read vulnerabilities in widely used parsing libraries can lead to denial-of-service attacks, disrupting services that rely on form data processing. Given that this module is implemented in C via XS, memory safety issues pose a significant risk to application stability. Ensuring timely updates to patched versions is critical for maintaining the integrity and availability of Perl-based web applications.
What to watch
Users of WWW::Form::UrlEncoded::XS should verify their installed version and upgrade to 0.27 or later if not already done. Security teams should monitor for any new advisories related to this module, given its history of memory-safety issues. The single maintainer status of the module may warrant additional scrutiny for future updates and security patches.
Want the full story? Read the original reporting
Read on CVEs | Zero Wire | Cloudflare Radar