CVE-2018-7212 is a medium-severity (CVSS 5.3) Path Traversal vulnerability in sinatra. A fix is available for sinatra — see the affected versions and patch details below.
Sinatra Path Traversal vulnerability
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
sinatraReal-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
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 💎RubyGems | sinatra | ≥ 2.0.0.beta1&&< 2.0.1 | 2.0.1bundle update sinatra --conservative |
Affected Products
sinatrasinatrarbDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for sinatra, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update sinatra to 2.0.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2018-7212 is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Frequently Asked Questions
Is CVE-2018-7212 in your dependencies?
Find it across RubyGems, including transitive dependencies.