CVE-2026-47242: CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') in ruby net-imap
A command injection vulnerability exists in Ruby's net-imap library prior to versions 0.6.5 and 0.5.15. The vulnerability arises because the Net::IMAP#id method does not validate CRLF sequences in hash argument values, and the Net::IMAP#enable method does not validate its arguments as valid atoms, allowing attacker-controlled input to be sent verbatim. This can enable injection of arbitrary IMAP commands. The issue is fixed in versions 0.6.5 and 0.5.15.
AI Analysis
Technical Summary
The net-imap Ruby library implements IMAP client functionality. Before versions 0.6.5 and 0.5.15, the Net::IMAP#id method, when called with a hash argument, properly quoted ID field strings but did not prohibit CRLF sequences, allowing injection vectors. Similarly, Net::IMAP#enable processes arguments for aliases but does not validate them as valid atoms, sending the #to_s value verbatim. These flaws allow an attacker to inject arbitrary IMAP commands via crafted arguments. The vulnerability is addressed by fixes in versions 0.6.5 and 0.5.15.
Potential Impact
An attacker able to supply crafted arguments to Net::IMAP#id or Net::IMAP#enable could inject arbitrary IMAP commands, potentially leading to unauthorized actions or manipulation of the IMAP session. The CVSS 5.8 (medium) reflects local attack vector with low complexity and partial user interaction required. No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade to net-imap version 0.6.5 or 0.5.15 or later, where the vulnerability is fixed. No other mitigation or temporary workaround is indicated. Patch status is not explicitly confirmed in the advisory, but the description states the issue is fixed in these versions.
CVE-2026-47242: CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') in ruby net-imap
Description
A command injection vulnerability exists in Ruby's net-imap library prior to versions 0.6.5 and 0.5.15. The vulnerability arises because the Net::IMAP#id method does not validate CRLF sequences in hash argument values, and the Net::IMAP#enable method does not validate its arguments as valid atoms, allowing attacker-controlled input to be sent verbatim. This can enable injection of arbitrary IMAP commands. The issue is fixed in versions 0.6.5 and 0.5.15.
CVSS v4.0
Score 5.8medium
Affected software
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The net-imap Ruby library implements IMAP client functionality. Before versions 0.6.5 and 0.5.15, the Net::IMAP#id method, when called with a hash argument, properly quoted ID field strings but did not prohibit CRLF sequences, allowing injection vectors. Similarly, Net::IMAP#enable processes arguments for aliases but does not validate them as valid atoms, sending the #to_s value verbatim. These flaws allow an attacker to inject arbitrary IMAP commands via crafted arguments. The vulnerability is addressed by fixes in versions 0.6.5 and 0.5.15.
Potential Impact
An attacker able to supply crafted arguments to Net::IMAP#id or Net::IMAP#enable could inject arbitrary IMAP commands, potentially leading to unauthorized actions or manipulation of the IMAP session. The CVSS 5.8 (medium) reflects local attack vector with low complexity and partial user interaction required. No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade to net-imap version 0.6.5 or 0.5.15 or later, where the vulnerability is fixed. No other mitigation or temporary workaround is indicated. Patch status is not explicitly confirmed in the advisory, but the description states the issue is fixed in these versions.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-18T22:54:18.272Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a39a0f5eed863c81e6b01e4
Added to database: 06/22/2026, 20:54:13 UTC
Last enriched: 06/22/2026, 21:09:55 UTC
Last updated: 06/23/2026, 03:57:28 UTC
Views: 7
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.