Critical Vulnerability in PHP 8.2: OpenSSL Private Decrypt Function Affected by Marvin Attack

php8.2 Updated 02 Oct 2025

Summary

09/06/2024
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2024-2408: The openssl_private_decrypt function in PHP, when using PKCS1 padding (OPENSSL_PKCS1_PADDING, which is the default), is vulnerable to the Marvin Attack unless it is used with an OpenSSL version that includes the changes... Affects php8.2 versions < 8.2.18-1. Fixed in 8.2.18-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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

PHP 8.2 is a widely used server-side scripting language designed for web development but also used as a general-purpose programming language. It is known for its ease of use, flexibility, and extensive community support. However, a critical vulnerability has been identified in the openssl_private_decrypt function when using PKCS1 padding, which could expose applications to security risks if not addressed promptly.

Vulnerability Detail

The openssl_private_decrypt function in PHP is vulnerable to the Marvin Attack when using the default PKCS1 padding (OPENSSL_PKCS1_PADDING). This vulnerability arises from the lack of proper rejection of certain RSA decryption failures, allowing attackers to exploit the function under specific conditions. If exploited, this could lead to unauthorized access to sensitive data, making it crucial for developers to address this issue immediately.

How To Fix

Minimum fixed version

8.2.18-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade php8.2

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

Workaround

As a temporary workaround, consider avoiding the use of the openssl_private_decrypt function with PKCS1 padding until the PHP version is updated. Alternatively, use a different padding scheme if feasible, or implement additional security measures to protect sensitive data.

Conclusion

The vulnerability in PHP 8.2's openssl_private_decrypt function poses significant risks due to the Marvin Attack. It is essential for developers to update to the patched version 8.2.18-1 or later to mitigate these risks and ensure the security of their applications.

See every vulnerability recorded for php8.2 →

Share this vulnerability

FAQ

The Marvin Attack exploits vulnerabilities in the RSA decryption process, particularly when using PKCS1 padding, allowing attackers to potentially recover plaintext data.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

PHP versions prior to 8.2.18-1 are affected by this vulnerability. Ensure you are using the latest patched version to avoid risks.

Yes, not updating could expose your application to potential data breaches and unauthorized access, as attackers may exploit this vulnerability.

If immediate updates are not possible, implement workarounds such as avoiding the use of the vulnerable function or using alternative padding schemes.

Related vulnerabilities

Recent vulnerabilities recorded for php8.2.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

8.2.18-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade php8.2

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