Heap-use-after-free vulnerability in php

php Updated 02 Oct 2025

Summary

25/12/2021
HIGH
No i
High
Not published

OSV-2021-1759: Heap-use-after-free in zend_hash_reverse_apply. Affects php across 2 version ranges.

>= 97cdf62a6a1d8491f8d1ef1580f344400eb51f1d >= 713dcb28181895d241e6dbe63f63ee654ba757b4, < eee3b1d917591e5106aef9fd4fe93393e95fc13d

No fix is published. 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

PHP is a popular open-source scripting language widely used for web development. It provides a range of features and functionalities to build dynamic websites and applications. However, a vulnerability has been discovered in the PHP package that can lead to a heap-use-after-free issue.

Vulnerability Detail

The vulnerability, identified as OSV-2021-1759, is a heap-use-after-free vulnerability in the zend_hash_reverse_apply function of the PHP package. This vulnerability can be triggered by a specific sequence of operations, resulting in a read of 4 bytes from a freed heap memory block. An attacker could potentially exploit this vulnerability to execute arbitrary code or cause a denial-of-service condition.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

At the moment, there is no known workaround for this vulnerability. It is advised to apply the fix provided by updating the PHP package to a patched version.

Conclusion

The heap-use-after-free vulnerability in the PHP package can pose a significant risk to systems running the affected version. It is crucial to update the PHP package to a patched version that includes the fix to mitigate any potential exploitation. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for php →

Share this vulnerability

FAQ

This vulnerability can potentially allow an attacker to execute arbitrary code or cause a denial-of-service condition on systems running the affected PHP package.

You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert uses a manifest file like package-lock.json to monitor and alert in real-time for open-source vulnerabilities in the software.

At the time of this report, there is no known public exploit for this vulnerability. However, it is important to apply the recommended fix to mitigate any potential risks.

To exploit this vulnerability, an attacker would need to have the ability to execute arbitrary code on a system running the affected PHP package.

Yes, the vulnerability has been patched in the PHP package. It is recommended to update to a version that includes the fix to ensure the security of your system.

Related vulnerabilities

Recent vulnerabilities recorded for php.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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