Skip to content
OpenAdvisories
Medium · 5.9 CVE-2024-2408 EUVD-2024-27360

PHP is vulnerable to the Marvin Attack

Published Jun 9, 2024 · Updated Mar 21, 2025 · Assigned by php

Description

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 from this pull request: https://github.com/openssl/openssl/pull/13817 (rsa_pkcs1_implicit_rejection). These changes are part of OpenSSL 3.2 and have also been backported to stable versions of various Linux distributions, as well as to the PHP builds provided for Windows since the previous release. All distributors and builders should ensure that this version is used to prevent PHP from being vulnerable.

PHP Windows builds for the versions 8.1.29, 8.2.20 and 8.3.8 and above include OpenSSL patches that fix the vulnerability.

Affected products

VendorProductAffectedFixed
PHP Group PHP 8.1.* – < 8.1.29, 8.2.* – < 8.2.20, 8.3.* – < 8.3.8 8.1.29

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 12 php8.2 8.2.18-1 —
ReleasePackageFixed inAdvisory
Ubuntu Pro 14.04 LTS php5 No fix yet —
ReleasePackageFixed inAdvisory
RHEL 8 openssl +3 1:1.1.1k-12.el8_9 RHSA-2023:7877

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 8 openssl +3 1:1.1.1k-12.el8_9 ALSA-2023:7877

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 8 openssl 1:1.1.1k-12.el8_9 RLSA-2023:7877

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 php8.1 +26 8.1.29-1.amzn2023.0.1 ALAS2023-2024-654
Amazon Linux 2023 php8.2 +27 8.2.21-1.amzn2023.0.1 ALAS2023-2024-678

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 php 8.3.8-1 —
Azure Linux 2 (CBL-Mariner) php 8.1.29-1 —

Wolfi

ReleasePackageFixed inAdvisory
Wolfi rolling php-8.1 8.1.29-r0 —
Wolfi rolling php-8.2 8.2.20-r0 —

Advisories 7

References