Directory Traversal Vulnerability in ruby-mail Package

ruby-mail Updated 02 Oct 2025

Summary

18/07/2012
N/A
Yes i
Unrated
Not published

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 ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for ruby-mail.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback