Heap-based Buffer Overflow in Perl 5.18 through 5.26

perl Updated 02 Oct 2025

Summary

17/04/2018
N/A
Yes i
Critical
9.8

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 across 2 version ranges.

< 5.26.2-r0 >= a9acda3b5f74585852a57b51b724804ac586cb0b, <= 95388f2eb27e74cdbfb715c0097f16aeba4e6e4e

Fixed in 5.26.2-r0. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Perl is a high-level, general-purpose programming language known for its powerful text processing capabilities. It is widely used in various domains, including web development, system administration, and network programming. However, versions 5.18 through 5.26 of Perl are susceptible to a heap-based buffer overflow vulnerability.

Vulnerability Detail

The vulnerability, identified as CVE-2018-6797, arises from a flaw in the regular expression handling of Perl. An attacker can exploit this issue by crafting a malicious regular expression, leading to a heap-based buffer overflow. This allows the attacker to gain control over the bytes written, potentially leading to arbitrary code execution or a denial of service.

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

No known workarounds are available for this vulnerability.

Conclusion

The heap-based buffer overflow vulnerability in Perl 5.18 through 5.26 poses a significant risk to affected systems. It is crucial to update Perl to version 5.26.2-r0 or later to mitigate this vulnerability. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for perl →

Share this vulnerability

FAQ

Perl is a high-level programming language known for its text processing capabilities and versatility.

Versions 5.18 through 5.26 of Perl are vulnerable to the heap-based buffer overflow.

A heap-based buffer overflow occurs when a program writes more data to a buffer in the heap than it can hold, leading to memory corruption and potential code execution.

Exploiting this vulnerability can result in arbitrary code execution or a denial of service, depending on the attacker's intentions.

To update Perl, you can follow the official documentation or use package managers specific to your operating system.

Related vulnerabilities

Recent vulnerabilities recorded for perl.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback