Heap-use-after-free vulnerability in zend_gc_delref in php

php Updated 02 Oct 2025

Summary

12/09/2020
HIGH
Yes i
High
Not published

OSV-2020-1735: Heap-use-after-free in zend_gc_delref. Affects php versions >= 927771333ba28570d1a5dc4bdc5b1a2a13ff3774, < 3c53732332c4b9d3904eec0d1c42f0d4d4bf65c6. Fixed in 3c53732332c4b9d3904eec0d1c42f0d4d4bf65c6. 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 Penetration testing for web, API and mobile 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 general-purpose scripting language that is widely used for web development. It is known for its simplicity, flexibility, and extensive support for various databases. The zend_gc_delref function in PHP is responsible for garbage collection and reference counting of zval structures. This vulnerability in zend_gc_delref can lead to a heap-use-after-free condition, where a reference to a freed memory location is still being accessed. This can result in a crash or potentially allow an attacker to execute arbitrary code.

Vulnerability Detail

The vulnerability occurs due to a heap-use-after-free condition in the zend_gc_delref function. This can be triggered when the function is called to decrement the reference count of a zval structure that has already been freed. As a result, the function may attempt to access memory that has been freed, leading to undefined behavior. An attacker may be able to exploit this vulnerability to execute arbitrary code or cause a denial-of-service condition.

How To Fix

Minimum fixed version

3c53732332c4b9d3904eec0d1c42f0d4d4bf65c6

This is the first release that contains the fix.

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

Workaround

There is no known workaround for this vulnerability. It is recommended to update to a fixed version of PHP as soon as possible.

Conclusion

The heap-use-after-free vulnerability in zend_gc_delref in PHP can lead to crashes or potential code execution. It is crucial to update to a fixed version of PHP to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for php →

Share this vulnerability

FAQ

This vulnerability can lead to a crash or potentially allow an attacker to execute arbitrary code.

You can use the Vulert Playground at Vulert Scanner to check if your PHP installation is affected by this vulnerability. Simply upload your package-lock.json file and Vulert will analyze it for vulnerabilities in real-time.

There is no known exploit for this vulnerability at the time of writing. However, it is important to update to a fixed version of PHP to mitigate the risk.

No, only versions of PHP prior to the fix implemented in commit 3c53732332c4b9d3904eec0d1c42f0d4d4bf65c6 are affected. Users should update to a version that includes this commit or a later version.

Yes, a patch for this vulnerability is available in the PHP source code repository. Users should update their PHP installation to a version that includes this patch.

Related vulnerabilities

Recent vulnerabilities recorded for php.

How To Fix

Minimum fixed version

3c53732332c4b9d3904eec0d1c42f0d4d4bf65c6

This is the first release that contains the fix.

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