SMTP Injection via recipient email addresses in ruby-mail

ruby-mail Updated 02 Oct 2025

Summary

25/05/2016
N/A
Yes i
Unrated
Not published

DLA-489-1: ruby-mail - security update. Affects ruby-mail versions < 2.4.4-2+deb7u1. Fixed in 2.4.4-2+deb7u1. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

ruby-mail is a Ruby gem that provides a simple and efficient way to handle email messages. It is widely used in Ruby applications for sending and receiving emails. However, a security vulnerability has been discovered in the gem that allows for SMTP injection via recipient email addresses.

Vulnerability Detail

The vulnerability in ruby-mail arises from the lack of validation and sanitization of recipient email addresses. This allows an attacker to manipulate the recipient address and potentially inject malicious content into the email message. The vulnerability can be exploited by sending a long spam message via a recipient address, bypassing any length limits imposed by the application. It is important to note that this vulnerability only affects applications that lack proper input validation.

How To Fix

Minimum fixed version

2.4.4-2+deb7u1

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

There is no specific workaround mentioned for this vulnerability. However, as a general best practice, it is recommended to always validate and sanitize user input, including email addresses, to prevent potential security vulnerabilities.

Conclusion

The SMTP Injection vulnerability in ruby-mail can be mitigated by upgrading to version 2.4.4-2+deb7u1 or later. It is important to ensure that your application properly validates and sanitizes user input, including email addresses, to prevent potential security vulnerabilities. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for ruby-mail →

Share this vulnerability

FAQ

The vulnerability affects versions of ruby-mail prior to 2.4.4-2+deb7u1.

You can check the version of ruby-mail installed on your system by running the command 'gem list ruby-mail' in your terminal.

No, only applications that lack proper input validation are vulnerable to this issue. It is important to ensure that your application validates and sanitizes user input, including email addresses.

No, the ruby-mail gem itself does not impose a length limit on email addresses. Any length limits would need to be implemented on the application's side.

You can find more information about this vulnerability in the whitepaper entitled 'SMTP Injection via recipient email addresses' by Takeshi Terada. The whitepaper discusses the vulnerability in detail and provides examples of potential attacks.

Related vulnerabilities

Recent vulnerabilities recorded for ruby-mail.

How To Fix

Minimum fixed version

2.4.4-2+deb7u1

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