CVE-2012-2140 — mail
Fix: mikel/mail@39b590dCVE-2012-2140 is a Improper Input Validation vulnerability in mail. 2 public exploit or proof-of-concept references are indexed, so weaponization risk is real. A fix is available for mail — see the affected versions and patch details below.
Mail Gem Improper Input Validation vulnerability
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
mailReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects RubyGems packages — download data is not available via public APIs for these ecosystems.
Description
The Mail gem before 2.4.3 for Ruby allows remote attackers to execute arbitrary commands via shell metacharacters in a (1) sendmail or (2) exim delivery.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 💎RubyGems | mail | all versions | 2.4.3bundle update mail --conservative |
Affected Products
mail gemrubygemsResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mail, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update mail to 2.4.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2012-2140 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
| Product | Fixed in | Advisory |
|---|---|---|
| CloudForms for RHEL 6 | converge-ui-devel-0:1.0.4-1.el6cf | RHSA-2012:1542 |
Frequently Asked Questions
Is CVE-2012-2140 in your dependencies?
Find it across RubyGems, including transitive dependencies.