CVE-2006-5734: PHPMailer Local file inclusion

phpmailer/phpmailer Updated 02 Oct 2025

Summary

02/02/2024
Yes i
Moderate
Not published

CVE-2006-5734: PHPMailer Local file inclusion. Affects phpmailer/phpmailer versions < 5.2.0. Fixed in 5.2.0. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

PHPMailer is a popular open-source library used for sending emails from PHP applications. It provides a simple and convenient way to send emails using various protocols and features. However, a vulnerability was discovered in PHPMailer that allowed arbitrary local file inclusion. This vulnerability could be exploited if the host application passed unfiltered user data into the $lang property. Several applications that used PHPMailer were affected by this issue.

Vulnerability Detail

The vulnerability in PHPMailer allowed an attacker to perform arbitrary local file inclusion by manipulating the $lang property. This could be done remotely if the host application did not properly filter and validate user-supplied data before using it. The impact of this vulnerability could vary depending on the specific application, but it could potentially lead to unauthorized access to sensitive files or remote code execution. The vulnerability was assigned three CVEs: CVE-2006-5734, CVE-2007-3215, and CVE-2007-2021.

How To Fix

Minimum fixed version

5.2.0

This is the first release that contains the fix.

composer require phpmailer/phpmailer:5.2.0

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

Workaround

A workaround for this vulnerability is to filter and validate user-supplied data before using it in the $lang property. This can be done by implementing input validation and sanitization techniques, such as using whitelists or regular expressions to restrict the allowed input. Additionally, it is recommended to use a web application firewall (WAF) to provide an additional layer of protection against potential attacks.

Conclusion

The PHPMailer library was vulnerable to arbitrary local file inclusion via the $lang property. This issue was fixed in PHPMailer version 5.2.0. To protect your application, it is important to update PHPMailer to the latest version and ensure that user-supplied data is properly filtered and validated. If you have any further questions or need assistance with vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for phpmailer/phpmailer →

Share this vulnerability

FAQ

The vulnerability affects PHPMailer versions prior to 5.2.0.

The impact of this vulnerability can vary depending on the specific application, but it could potentially lead to unauthorized access to sensitive files or remote code execution.

To fix this vulnerability, you should update your PHPMailer dependency to at least version 5.2.0 and ensure that user-supplied data is properly filtered and validated before using it in the $lang property or any other potentially vulnerable areas.

Yes, a workaround for this vulnerability is to filter and validate user-supplied data before using it in the $lang property. Additionally, using a web application firewall (WAF) can provide an extra layer of protection.

You can find more information about this vulnerability in the National Vulnerability Database (NVD) under the CVE identifiers: CVE-2006-5734, CVE-2007-3215, and CVE-2007-2021.

Related vulnerabilities

Recent vulnerabilities recorded for phpmailer/phpmailer.

How To Fix

Minimum fixed version

5.2.0

This is the first release that contains the fix.

composer require phpmailer/phpmailer:5.2.0

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