Critical Vulnerability in PHP 8.2: OpenSSL Private Decrypt Function Affected by Marvin Attack
Summary
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 ↓
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
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 →
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.
References
Related vulnerabilities
Recent vulnerabilities recorded for php8.2.