Critical Heap-Based Buffer Overflow in Perl Package
Summary
ALPINE-CVE-2018-6797: An issue was discovered in Perl 5.18 through 5.26. A crafted regular expression can cause a heap-based buffer overflow, with control over the bytes written. Affects perl versions < 5.26.2-r0. Fixed in 5.26.2-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 text processing capabilities and flexibility. It is widely used in web development, system administration, and network programming. However, versions of Perl from 5.18 to 5.26 are vulnerable to a severe security issue that can lead to a heap-based buffer overflow, potentially allowing attackers to execute arbitrary code.
Vulnerability Detail
An issue was discovered in Perl versions 5.18 through 5.26, where a crafted regular expression can cause a heap-based buffer overflow. This vulnerability allows attackers to control the bytes written, leading to potential arbitrary code execution, data corruption, or system crashes. The vulnerability is classified with a CVSS score of 9.8, indicating its critical nature and the high risk it poses to affected systems.
How To Fix
Minimum fixed version
5.26.2-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 may trigger this vulnerability until the package is updated. Regular expressions should be validated and sanitized to prevent exploitation.
Conclusion
The vulnerability in the Perl package poses a significant risk due to its potential for arbitrary code execution. Users are strongly advised to update to the patched version to mitigate this risk. Regular monitoring for vulnerabilities using tools like Vulert can help maintain the security of your applications.
See every vulnerability recorded for perl →
FAQ
The CVSS score of this vulnerability is 9.8, indicating a critical severity level.
Perl versions 5.18 through 5.26 are affected by this vulnerability.
Exploitation of this vulnerability can lead to arbitrary code execution, data corruption, or system crashes.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without requiring signup.
The recommended action is to update the Perl package to the fixed version 5.26.2-r0 as soon as possible.
References
Related vulnerabilities
Recent vulnerabilities recorded for perl.