Description
The mail gem before 2.5.5 for Ruby (aka A Really Ruby Mail Library) is vulnerable to SMTP command injection via CRLF sequences in a RCPT TO or MAIL FROM command, as demonstrated by CRLF sequences immediately before and after a DATA substring.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | ruby-mail | 2.6.1+dfsg1-1 | — |
| Debian 13 | ruby-mail | 2.6.1+dfsg1-1 | — |
| Debian 12 | ruby-mail | 2.6.1+dfsg1-1 | — |
| Debian 7 | ruby-mail | 2.4.4-2+deb7u1 | DLA-489-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| RubyGems | < 2.5.5 | 2.5.5 | GHSA-q86f-fmqf-qrf6 |
Advisories 1
- DLA-489-1 ruby-mail - security update Debian Security (DSA / DLA) · Mar 9, 2026
References
- https://github.com/mikel/mail/pull/1097
- https://hackerone.com/reports/137631
- https://github.com/mikel/mail/commit/72befdc4dab3e6e288ce226a7da2aa474cf5be83
- http://openwall.com/lists/oss-security/2015/12/11/3
- https://rubysec.com/advisories/mail-OSVDB-131677
- https://github.com/rubysec/ruby-advisory-db/issues/215
- http://www.mbsd.jp/Whitepaper/smtpi.pdf