CVE Vulnerabilities

CVE-2021-21708

Use After Free

Published: Feb 27, 2022 | Modified: Nov 21, 2024
CVSS 3.x
9.8
CRITICAL
Source:
NVD
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.x
6.8 MEDIUM
AV:N/AC:M/Au:N/C:P/I:P/A:P
RedHat/V2
RedHat/V3
9.8 IMPORTANT
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Ubuntu
MEDIUM
root.io logo minimus.io logo echo.ai logo

In PHP versions 7.4.x below 7.4.28, 8.0.x below 8.0.16, and 8.1.x below 8.1.3, when using filter functions with FILTER_VALIDATE_FLOAT filter and min/max limits, if the filter fails, there is a possibility to trigger use of allocated memory after free, which can result it crashes, and potentially in overwrite of other memory chunks and RCE. This issue affects: code that uses FILTER_VALIDATE_FLOAT with min/max limits.

Weakness

The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory “belongs” to the code that operates on the new pointer.

Affected Software

NameVendorStart VersionEnd Version
PhpPhp7.4.0 (including)7.4.28 (excluding)
PhpPhp8.0.0 (including)8.0.16 (excluding)
PhpPhp8.1.0 (including)8.1.3 (excluding)
Red Hat Enterprise Linux 8RedHatphp:8.0-8070020220801083134.afd00e68*
Red Hat Enterprise Linux 8RedHatphp:7.4-8070020220707122009.afd00e68*
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update SupportRedHatphp:7.4-8040020250311105031.d7c09045*
Red Hat Enterprise Linux 8.4 Telecommunications Update ServiceRedHatphp:7.4-8040020250311105031.d7c09045*
Red Hat Enterprise Linux 8.4 Update Services for SAP SolutionsRedHatphp:7.4-8040020250311105031.d7c09045*
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update SupportRedHatphp:7.4-8060020250311104929.5caa48ff*
Red Hat Enterprise Linux 8.6 Telecommunications Update ServiceRedHatphp:7.4-8060020250311104929.5caa48ff*
Red Hat Enterprise Linux 8.6 Update Services for SAP SolutionsRedHatphp:7.4-8060020250311104929.5caa48ff*
Red Hat Enterprise Linux 9RedHatphp-0:8.0.20-3.el9*
Php5Ubuntutrusty*
Php7.0Ubuntuxenial*
Php7.4Ubuntuesm-infra/focal*
Php7.4Ubuntufocal*
Php7.4Ubuntuupstream*
Php8.0Ubuntuimpish*
Php8.1Ubuntudevel*
Php8.1Ubuntujammy*
Php8.1Ubuntuupstream*

Potential Mitigations

References