CVE-2012-4522 Path traversal in n/a
Attackers can create files in unexpected locations or with unexpected names by injecting NUL bytes into file paths in Ruby.
- 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-4522?
CVE-2012-4522 is a medium-severity path traversal vulnerability in Ruby-Lang Ruby, published on 24 Nov 2012. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
The rb_get_path_check function in file.c in Ruby 1.9.3 before patchlevel 286 and Ruby 2.0.0 before r37163 allows context-dependent attackers to create files in unexpected locations or with unexpected names via a NUL byte in a file path.
Weakness: CWE-264
Which versions are affected by CVE-2012-4522?
It affects 1 product.
Products include Ruby-Lang Ruby.
How do I fix CVE-2012-4522?
Upgrade to a fixed version.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2012-4522 being exploited?
There is no known exploitation of CVE-2012-4522 in the wild and no public exploit code.
Other vulnerabilities in Ruby-Lang Ruby
Sources
Also known as GHSA-6mch-f8jc-rpmr.