Critical PHP Vulnerability in Multiple Versions: CVE-2025-1220

php5 Updated 03 Oct 2025

Summary

13/07/2025
N/A
No i
Low
3.7

UBUNTU-CVE-2025-1220: In PHP versions:8.1.* before 8.1.33, 8.2.* before 8.2.29, 8.3.* before 8.3.23, 8.4.* before 8.4.10 some functions like fsockopen() lack validation that the hostname supplied does not contain null characters. Affects php5 versions 5.5.3+dfsg-1ubuntu2 – 5.5.9+dfsg-1ubuntu4.9. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

PHP is a widely-used open-source scripting language designed for web development but also used as a general-purpose programming language. It is known for its ease of use and flexibility, allowing developers to create dynamic web pages and applications. The impacted versions of PHP include 5.5.9, 7.0.33, 7.2.24, 7.4.3, 8.1.2, 8.3.6, and 8.4.5. This vulnerability arises from insufficient validation of hostnames in certain functions, which can lead to security issues if not addressed.

Vulnerability Detail

In PHP versions 8.1.* before 8.1.33, 8.2.* before 8.2.29, 8.3.* before 8.3.23, and 8.4.* before 8.4.10, functions like fsockopen() do not properly validate that the hostname supplied does not contain null characters. This oversight can allow other functions, such as parse_url(), to treat the hostname differently, potentially leading to security vulnerabilities if user code implements access checks based on these functions. The CVSS score for this vulnerability is 3.7, indicating a low severity but still a significant risk.

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

As a temporary workaround, you can implement additional validation checks in your code to ensure that hostnames do not contain null characters before passing them to functions like fsockopen() or parse_url(). For example, you can use the following code snippet:

if (strpos($hostname, '\0') === false) {
    // Safe to use the hostname
} else {
    // Handle the error
}

Conclusion

The CVE-2025-1220 vulnerability in PHP highlights the importance of proper validation in programming. It is crucial for developers to update their PHP versions to the patched releases to mitigate potential security risks. Additionally, implementing validation checks can serve as a temporary measure until updates can be applied.

See every vulnerability recorded for php5 →

Share this vulnerability

FAQ

CVE-2025-1220 is a vulnerability in multiple versions of PHP that arises from insufficient validation of hostnames in certain functions, potentially leading to security issues.

The affected PHP versions include 5.5.9, 7.0.33, 7.2.24, 7.4.3, 8.1.2, 8.3.6, and 8.4.5.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If immediate updates are not possible, implement additional validation checks in your code to prevent null characters in hostnames.

The CVSS score for this vulnerability is 3.7, indicating a low severity but still a notable risk.

Related vulnerabilities

Recent vulnerabilities recorded for php5.

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