CVE-2018-7212 Sinatra Path Traversal vulnerability

Medium 5.3 Published Updated

Attackers can bypass path traversal protections on Windows using backslashes to access unauthorized files in Sinatra applications.

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

What is CVE-2018-7212?

CVE-2018-7212 is a medium-severity path traversal vulnerability in n/a, published on 18 Feb 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

An issue was discovered in rack-protection/lib/rack/protection/path_traversal.rb in Sinatra 2.x before 2.0.1 on Windows. Path traversal is possible via backslash characters.

Weakness: CWE-22

Which versions are affected by CVE-2018-7212?

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

PackageAffectedFixed in
sinatra RubyGemsFrom 2.0.0.beta12.0.1
sinatra RubyGemsFrom 2.0.0.beta12.0.1

Products include Sinatrarb Sinatra.

How do I fix CVE-2018-7212?

Upgrade sinatra to 2.0.1 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2018-7212 being exploited?

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

Sources

Also known as GHSA-h29f-7f56-j8wh.

Is CVE-2018-7212 in your software?

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

Check your SBOMs for free