Directory Traversal Vulnerability in ruby-mail Package
Summary
DEBIAN-CVE-2012-2139: Directory traversal vulnerability in lib/mail/network/delivery_methods/file_delivery.rb in the Mail gem before 2.4.4 for Ruby allows remote attackers to read arbitrary files via a .. Affects ruby-mail versions < 2.4.4-1. Fixed in 2.4.4-1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The ruby-mail package is a popular library in Ruby used for handling email functionalities, including sending and receiving emails. It provides various delivery methods and is widely utilized in Ruby applications. However, prior to version 2.4.4, the package contained a directory traversal vulnerability that could allow attackers to access sensitive files on the server.
Vulnerability Detail
The vulnerability, identified as DEBIAN-CVE-2012-2139, originates from a flaw in the file_delivery.rb component of the Mail gem. This flaw allows remote attackers to exploit the '..' (dot dot) sequence in the 'to' parameter, potentially leading to unauthorized access to arbitrary files on the server. The implications of this vulnerability can be severe, as it may expose sensitive information stored on the server, leading to further attacks or data breaches.
How To Fix
Minimum fixed version
2.4.4-1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade ruby-mail
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, validate and sanitize the 'to' parameter in your application to prevent the use of '..' sequences. This can be done by implementing checks in your code to reject any input that includes these sequences.
Conclusion
The directory traversal vulnerability in the ruby-mail package poses a significant risk to applications using versions prior to 2.4.4. It is crucial to update to the patched version to mitigate this risk. Additionally, implementing input validation can serve as a temporary measure to protect against potential exploitation.
See every vulnerability recorded for ruby-mail →
FAQ
It is a directory traversal vulnerability that allows attackers to read arbitrary files on the server.
All versions prior to 2.4.4 are affected by this vulnerability.
You can use the Vulert playground at Vulert Scanner to check if your application is affected without any signup.
Attackers could gain unauthorized access to sensitive files, leading to data breaches or further exploitation of the system.
Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities using just a manifest file like package-lock.json.
References
Related vulnerabilities
Recent vulnerabilities recorded for ruby-mail.