PHP - Bypassing safe_mode, CRLF injection

php3 Updated 02 Oct 2025

Summary

18/09/2002
N/A
Yes i
Unrated
Not published

DSA-168: php - bypassing safe_mode, CRLF injection. Affects php3 versions < 3.0.18-23.1woody1. Fixed in 3.0.18-23.1woody1. 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 open-source scripting language commonly used for web development. It allows developers to create dynamic web pages and applications. The mail() function in PHP is used to send emails, while the fopen() function is used to open files or URLs. However, these functions have been found to have vulnerabilities that can be exploited to bypass safe_mode and inject arbitrary text into email headers or HTTP requests.

Vulnerability Detail

The first vulnerability allows scripts to pass arbitrary text to sendmail as a command-line extension when sending an email through PHP, even when safe_mode is turned on. This can lead to the execution of arbitrary commands and potential unauthorized access. The second vulnerability allows the injection of arbitrary ASCII control characters into string arguments of the mail() function. If the arguments are taken from user input, this can enable an attacker to alter message content, including mail headers. The third vulnerability affects the file() and fopen() functions, allowing CRLF injection. An attacker can use this to escape restrictions and add arbitrary text to alleged HTTP requests.

How To Fix

Minimum fixed version

3.0.18-23.1woody1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade php3

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

Workaround

There is no specific workaround mentioned in the vulnerability details. The recommended solution is to upgrade to the patched versions of PHP.

Conclusion

The vulnerabilities in PHP that allow bypassing safe_mode and CRLF injection have been identified and fixed in the recommended versions. It is crucial to upgrade to these patched versions to ensure the security of your PHP installation. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for php3 →

Share this vulnerability

FAQ

safe_mode is a security feature in PHP that restricts the execution of certain potentially dangerous functions and operations. It aims to prevent unauthorized access and protect the server environment.

Yes, these vulnerabilities can be exploited remotely if the affected PHP functions are accessible through a web application. An attacker can send crafted requests to exploit the vulnerabilities.

No, PHP3 and older versions of PHP4 are not affected by these vulnerabilities. However, it is still recommended to upgrade to the patched versions to ensure the security of your PHP installation.

Specific exploits for these vulnerabilities have not been mentioned in the vulnerability details. However, it is always important to stay updated with security patches and best practices to prevent potential exploits.

You can find more information about the patched versions of PHP on the official PHP website or the Debian OSV database.

Related vulnerabilities

Recent vulnerabilities recorded for php3.

How To Fix

Minimum fixed version

3.0.18-23.1woody1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade php3

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