Critical Buffer Overflow Vulnerability in mcrypt Package

mcrypt Updated 02 Oct 2025

Summary

21/11/2012
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2012-4409: Stack-based buffer overflow in the check_file_head function in extra.c in mcrypt 2.6.8 and earlier allows user-assisted remote attackers to execute arbitrary code via an encrypted file with a crafted header containing lo... Affects mcrypt versions < 2.6.8-1.1. Fixed in 2.6.8-1.1. 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

mcrypt is a widely used encryption library that provides a simple interface for various encryption algorithms. It is commonly utilized in applications requiring secure data storage and transmission. However, versions 2.6.8 and earlier are vulnerable to a stack-based buffer overflow, which can be exploited by attackers to execute arbitrary code.

Vulnerability Detail

The vulnerability arises from a stack-based buffer overflow in the check_file_head function located in extra.c of mcrypt version 2.6.8 and earlier. This flaw allows user-assisted remote attackers to execute arbitrary code by providing an encrypted file with a specially crafted header containing excessively long salt data. If exploited, this could lead to unauthorized access, data corruption, or complete system compromise.

How To Fix

Minimum fixed version

2.6.8-1.1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade mcrypt

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users are advised to avoid using mcrypt for handling untrusted encrypted files until the package is updated to a secure version. Additionally, validating the integrity of encrypted files before processing can help mitigate the risk.

Conclusion

The mcrypt package has a critical vulnerability that can lead to severe security risks if not addressed. Users are strongly encouraged to update to the latest patched version to protect their systems from potential exploitation. Utilizing tools like Vulert can further enhance security by providing real-time alerts for open-source vulnerabilities.

See every vulnerability recorded for mcrypt →

Share this vulnerability

FAQ

The vulnerability is a stack-based buffer overflow that can be exploited through specially crafted encrypted files.

Versions 2.6.8 and earlier of mcrypt are affected by this vulnerability.

Exploitation could lead to arbitrary code execution, allowing attackers to gain unauthorized access or control over the system.

You can use Vulert, which monitors open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without any signup.

Yes, avoid processing untrusted encrypted files and validate the integrity of files before handling them.

Related vulnerabilities

Recent vulnerabilities recorded for mcrypt.

How To Fix

Minimum fixed version

2.6.8-1.1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade mcrypt

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