CVE-2012-0796: Phpmailer/phpmailer PHPMailer Vulnerable To Email Header Vulnerability
HIGHCVE-2012-0796 is a HIGH phpmailer vulnerable to email header vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Phpmailer/phpmailer libraries in the Packagist ecosystem. The issue involves phpmailer vulnerable to email header injection. Remediation is available by upgrading affected packages to version 2.2.1.
CVE-2012-0796 at a Glance
How to Fix CVE-2012-0796
To remediate this vulnerability, upgrade all affected Phpmailer/phpmailer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade phpmailer/phpmailer to 2.2.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for phpmailer/phpmailer
How to Check if You Are Affected
To determine whether your application is affected by CVE-2012-0796, inspect your project dependencies for Phpmailer/phpmailer:
inspect dependencies for phpmailer/phpmailer
Analyze the terminal output to locate any version of Phpmailer/phpmailer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Phpmailer/phpmailer, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2012-0796 Affected Phpmailer/phpmailer Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
phpmailer/phpmailer
|
Packagist |
< 2.2.1
|
2.2.1
|
References
Frequently Asked Questions
What is CVE-2012-0796?
Which Phpmailer/phpmailer versions are affected?
What version fixes CVE-2012-0796?
Is phpmailer/phpmailer affected?
What CWE is associated with CVE-2012-0796?
How can I check Packagist dependencies for CVE-2012-0796?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-398j-f7m7-795j",
"modified" : "2023-02-15T19:34:00Z",
"published" : "2022-10-06T21:25:46Z",
"aliases" : [ "CVE-2012-0796" ],
"summary" : "PHPMailer vulnerable to email header injection",
"details" : "### Impact\nArbitrary additional email headers can be injected via crafted From or Sender headers.\n\n### Patches\nFixed in 2.2.1\n\n### Workarounds\nFilter user-supplied values prior to using them in From or Sender properties.\n\n### References\nhttps://nvd.nist.gov/vuln/detail/CVE-2012-0796\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open a private issue in [the PHPMailer project](https://github.com/PHPMailer/PHPMailer)",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "phpmailer/phpmailer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.2.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/PHPMailer/PHPMailer/security/advisories/GHSA-398j-f7m7-795j"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2012-0796"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=783532"
}, {
"type" : "WEB",
"url" : "https://git.moodle.org/gw?p=moodle.git&a=commit&h=62988bf0bbc73df655f51884aaf1f523928abff9"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/PHPMailer/PHPMailer"
}, {
"type" : "WEB",
"url" : "http://moodle.org/mod/forum/discuss.php?d=194015"
}, {
"type" : "WEB",
"url" : "http://www.debian.org/security/2012/dsa-2421"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-10-06T21:25:46Z",
"nvd_published_at" : "2012-07-17T10:20:00Z"
}
}