Buffer Overflow Vulnerability in Perl Package: CVE-2020-12723
Summary
ALPINE-CVE-2020-12723: regcomp.c in Perl before 5.30.3 allows a buffer overflow via a crafted regular expression because of recursive S_study_chunk calls. Affects perl versions < 5.28.3-r0. Fixed in 5.28.3-r0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Perl is a high-level, general-purpose programming language known for its flexibility and power in text processing, system administration, and web development. It is widely used in various applications due to its rich set of features and extensive library support. However, certain versions of Perl are vulnerable to a buffer overflow issue that can be exploited through crafted regular expressions, potentially leading to severe consequences.
Vulnerability Detail
The vulnerability, identified as CVE-2020-12723, originates from a flaw in the regcomp.c file within Perl versions prior to 5.30.3. This flaw allows a buffer overflow via recursive S_study_chunk calls when processing specially crafted regular expressions. The ramifications of this vulnerability can be severe, including application crashes or arbitrary code execution, which can compromise the integrity and security of the system running the affected Perl version.
How To Fix
Minimum fixed version
5.28.3-r0
This is the first release that contains the fix.
sudo apk add --upgrade perl
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, avoid using crafted regular expressions that could trigger this vulnerability until the package is updated. Additionally, consider implementing input validation to mitigate the risk of exploitation.
Conclusion
CVE-2020-12723 represents a significant security risk for applications using vulnerable versions of Perl. It is crucial for users to update their Perl installations to the latest patched versions to protect against potential exploitation. Utilizing tools like Vulert can help in monitoring and managing vulnerabilities effectively.
See every vulnerability recorded for perl →
FAQ
CVE-2020-12723 is a buffer overflow vulnerability in Perl that can be exploited through crafted regular expressions, leading to potential application crashes or arbitrary code execution.
Perl versions prior to 5.30.3 are affected by this vulnerability. Users should update to 5.30.3 or later to mitigate the risk.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By uploading your manifest file, you can check for vulnerabilities without needing to install any software.
The CVSS score for CVE-2020-12723 is 7.5, indicating a high severity level.
While the best solution is to update to the patched version, you can temporarily avoid using crafted regular expressions and implement input validation as a workaround.
References
Related vulnerabilities
Recent vulnerabilities recorded for perl.