CVE-2012-2140 Mail Gem Improper Input Validation vulnerability

High 7.5 Published Updated

Remote attackers can execute arbitrary commands via shell metacharacters in sendmail or exim delivery methods within the Ruby Mail gem.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2012-2140?

CVE-2012-2140 is a high-severity command injection vulnerability in n/a, published on 18 Jul 2012. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-20

Which versions are affected by CVE-2012-2140?

2 open source packages ship an affected version, including mail. It affects 1 product.

PackageAffectedFixed in
mail RubyGemsAll versions2.4.3
mail RubyGemsAll versions2.4.3

Products include Rubygems Mail Gem.

How do I fix CVE-2012-2140?

Upgrade mail to 2.4.3 or later.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2012-2140 being exploited?

There is no known exploitation of CVE-2012-2140 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2012-2140, GHSA-rp63-jfmw-532w.

Is CVE-2012-2140 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free