cve.bz

CVE-2026-47240 ruby net-imap: CRLF Injection

5.8 mediumEPSS 0.5%Fix available

Medium (5.8) in ruby net-imap. EPSS 0.5% estimated probability of exploitation activity in the next 30 days. Fixed in net-imap 0.5.15, 0.6.4.1.

On this page
Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. Prior to 0.6.5 and 0.5.15, several Net::IMAP commands accept a "raw data" argument that is sent verbatim after validation to prevent command injection. However, if a server does not support non-synchronizing literals, it may still be possible to inject arbitrary IMAP commands inside non-synchronizing literals. A server without support for non-synchronizing literals may interpret the "+}\r\n" as the end of a malformed command line and respond with a tagged BAD. In that case, the contents of the literal will be interpreted as one or more new pipelined commands, allowing a CRLF command injection attack to succeed. This affects criteria for #search and #uid_search; search_keys for #sort, #thread, #uid_sort, and #uid_thread; and attr for #fetch and #uid_fetch. This vulnerability is fixed in 0.6.5 and 0.5.15.

Severity

CVSS 4.0

5.8 medium
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N
EPSS
0.5% (down from 0.8% a week ago; 0.8% 30 days ago) estimated probability of exploitation activity in the next 30 days; 43rd percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2026-06-23. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-77 Improper Neutralization of Special Elements used in a Command
CWE-93 Improper Neutralization of CRLF Sequences (CRLF Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-47240 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-47240?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-47240?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-47240 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
ruby net-imap>= 0.6.0, < 0.6.4.1
ruby net-imap< 0.5.15

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-8p34-64r3-mwg8RubyGemsnet-imap>=0.6.0 <0.6.4.10.6.4.1
GHSA-8p34-64r3-mwg8RubyGemsnet-imap<0.5.150.5.15

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12ruby3.1no fix listedDEBIAN-CVE-2026-47240
Debian13ruby3.33.3.13-0+deb13u1DEBIAN-CVE-2026-47240 DSA-6614-1
Debian14ruby3.3no fix listedDEBIAN-CVE-2026-47240
Ubuntu16.04:LTS, 18.04:LTS, 20.04:LTS and 1 morejrubyno fix listedUBUNTU-CVE-2026-47240
Ubuntu22.04:LTSruby3.0no fix listedUBUNTU-CVE-2026-47240
Ubuntu24.04:LTSjruby, ruby3.2no fix listedUBUNTU-CVE-2026-47240
Ubuntu25.10, 26.04:LTS, 26.10jruby, ruby3.3no fix listedUBUNTU-CVE-2026-47240
UbuntuPro:16.04:LTSruby2.3no fix listedUBUNTU-CVE-2026-47240
UbuntuPro:18.04:LTSruby2.5no fix listedUBUNTU-CVE-2026-47240
UbuntuPro:20.04:LTSruby2.7no fix listedUBUNTU-CVE-2026-47240
Red Hatenterprise_linux:8::appstreamruby, ruby-doc, ruby-libs and 7 more0:3.3.12-8.module+el8.10.0+24567+c4e5368eRHSA-2026:50728
Red Hatenterprise_linux:8::appstreamrubygem-abrt, rubygem-abrt-doc0:0.4.0-1.module+el8.10.0+21226+b78a28c4RHSA-2026:50728
Red Hatenterprise_linux:8::appstreamrubygem-bigdecimal, rubygem-bigdecimal-debuginfo0:3.1.5-8.module+el8.10.0+24567+c4e5368eRHSA-2026:50728
Red Hatenterprise_linux:8::appstreamrubygem-bundler0:2.5.22-8.module+el8.10.0+24567+c4e5368eRHSA-2026:50728
Red Hatenterprise_linux:8::appstreamrubygem-io-console, rubygem-io-console-debuginfo0:0.7.1-8.module+el8.10.0+24567+c4e5368eRHSA-2026:50728
Red Hatenterprise_linux:8::appstreamrubygem-irb0:1.13.1-8.module+el8.10.0+24567+c4e5368eRHSA-2026:50728
Red Hatenterprise_linux:8::appstreamrubygem-json, rubygem-json-debuginfo0:2.7.2-8.module+el8.10.0+24567+c4e5368eRHSA-2026:50728
Red Hatenterprise_linux:8::appstreamrubygem-minitest0:5.20.0-8.module+el8.10.0+24567+c4e5368eRHSA-2026:50728
Red Hatenterprise_linux:8::appstreamrubygem-mysql2, rubygem-mysql2-doc, rubygem-mysql2-debuginfo and 1 more0:0.5.5-1.module+el8.10.0+21226+b78a28c4RHSA-2026:50728
Red Hatenterprise_linux:8::appstreamrubygem-pg, rubygem-pg-doc, rubygem-pg-debuginfo and 1 more0:1.5.4-1.module+el8.10.0+21226+b78a28c4RHSA-2026:50728
Red Hatenterprise_linux:8::appstreamrubygem-power_assert0:2.0.3-8.module+el8.10.0+24567+c4e5368eRHSA-2026:50728
Red Hatenterprise_linux:8::appstreamrubygem-psych, rubygem-psych-debuginfo0:5.1.2-8.module+el8.10.0+24567+c4e5368eRHSA-2026:50728
104 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Module for Basesystem 15 SP7, Linux Enterprise Module for Development Tools 15 SP7ruby3.43.4.10-150700.3.4.1SUSE-SU-2026:3090-1
openSUSELeap 16.0ruby3.43.4.10-160000.1.1openSUSE-SU-2026:21878-1
AlmaLinux8ruby, ruby-doc, ruby-libs and 3 more3.3.12-8.module_el8.10.0+4241+4264e34bALSA-2026:50728
AlmaLinux8rubygem-abrt, rubygem-abrt-doc0.4.0-1.module_el8.10.0+3799+191214ccALSA-2026:50728
AlmaLinux8rubygem-bigdecimal3.1.5-8.module_el8.10.0+4241+4264e34bALSA-2026:50728
AlmaLinux8rubygem-bundler2.5.22-8.module_el8.10.0+4241+4264e34bALSA-2026:50728
AlmaLinux8rubygem-io-console0.7.1-8.module_el8.10.0+4241+4264e34bALSA-2026:50728
AlmaLinux8rubygem-irb1.13.1-8.module_el8.10.0+4241+4264e34bALSA-2026:50728
AlmaLinux8rubygem-json2.7.2-8.module_el8.10.0+4241+4264e34bALSA-2026:50728
AlmaLinux8rubygem-minitest5.20.0-8.module_el8.10.0+4241+4264e34bALSA-2026:50728
AlmaLinux8rubygem-mysql2, rubygem-mysql2-doc0.5.5-1.module_el8.10.0+3799+191214ccALSA-2026:50728
AlmaLinux8rubygem-pg, rubygem-pg-doc1.5.4-1.module_el8.10.0+3799+191214ccALSA-2026:50728
AlmaLinux8rubygem-power_assert2.0.3-8.module_el8.10.0+4241+4264e34bALSA-2026:50728
AlmaLinux8rubygem-psych5.1.2-8.module_el8.10.0+4241+4264e34bALSA-2026:50728
61 more for AlmaLinux in the JSON.
Rocky Linux8ruby0:3.3.12-8.module+el8.10.0+40269+dc93e2d1RLSA-2026:50728
Rocky Linux8rubygem-abrt0:0.4.0-1.module+el8.10.0+1679+61871737RLSA-2026:50728
Rocky Linux8rubygem-abrt0:0.4.0-1.module+el8.10.0+1741+bdb5b6caRLSA-2026:50728
Rocky Linux8rubygem-abrt0:0.4.0-1.module+el8.10.0+1820+f3fffb92RLSA-2026:50728
Rocky Linux8rubygem-abrt0:0.4.0-1.module+el8.10.0+1826+b62220b4RLSA-2026:50728
Rocky Linux8rubygem-abrt0:0.4.0-1.module+el8.10.0+1827+16ecb9d2RLSA-2026:50728
Rocky Linux8rubygem-abrt0:0.4.0-1.module+el8.5.0+668+665814faRLSA-2026:50728
Rocky Linux8rubygem-abrt0:0.4.0-1.module+el8.9.0+1537+0b2034bdRLSA-2026:50728
Rocky Linux8rubygem-mysql20:0.5.5-1.module+el8.10.0+1679+61871737RLSA-2026:50728
Rocky Linux8rubygem-mysql20:0.5.5-1.module+el8.10.0+1827+16ecb9d2RLSA-2026:50728
Rocky Linux8rubygem-pg0:1.5.4-1.module+el8.10.0+1679+61871737RLSA-2026:50728
Rocky Linux8rubygem-pg0:1.5.4-1.module+el8.10.0+1827+16ecb9d2RLSA-2026:50728
8 more for Rocky Linux in the JSON.
Alpinev3.21ruby-net-imap0.4.25-r0ALPINE-CVE-2026-47240
Alpinev3.22, v3.23, v3.24ruby-net-imap0.5.15-r0ALPINE-CVE-2026-47240
Azure Linux3ruby3.3.13-11AZL-91281
Alpaquita23ruby-net-imap0.4.25-r0BELL-CVE-2026-47240
Alpaquita25, streamruby-net-imap0.5.15-r0BELL-CVE-2026-47240

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine · Alpaquita.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

This Moderate flaw in the Net::IMAP Ruby library allows for command injection against IMAP servers that lack support for non-synchronizing literals. An attacker could exploit this by providing specially crafted input, leading to the execution of arbitrary IMAP commands and potential unauthorized actions. This risk is primarily present in deployments interacting with older or non-standard IMAP server configurations.

Red Hat's mitigation

Explicitly validate user-controlled inputs to prevent embedded non-synchronizing literals unless the server supports them. For a simpler, more cautious approach: all embedded literals can be unconditionally prohibited, by checking that string inputs do not contain any CR or LF bytes.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10ruby4.0-0:4.0.6-36.el10_2Fixed 2026-08-05RHSA-2026:50773
Red Hat Enterprise Linux 10ruby-0:3.3.12-14.el10_2Fixed 2026-08-05RHSA-2026:50778
Red Hat Enterprise Linux 8ruby:3.3-8100020260727154509.489197e6Fixed 2026-08-05RHSA-2026:50728
Red Hat Enterprise Linux 9ruby:4.0-9080020260727092509.9Fixed 2026-08-05RHSA-2026:50827
Red Hat Enterprise Linux 9ruby:3.3-9080020260728061751.9Fixed 2026-08-05RHSA-2026:50828
Red Hat Hardened Imagesruby4-0-main-0.3.2-33.4.hum1Fixed 2026-06-30RHSA-2026:33551
Red Hat Hardened Imagesruby4-0-main-4.0.0-33.4.hum1Fixed 2026-06-30RHSA-2026:33551
Red Hat Hardened Imagesruby3-3-main-0.21.9-23.4.hum1Fixed 2026-07-15RHSA-2026:40380
Red Hat Hardened Imagesruby3-3-main-3.3.10-23.4.hum1Fixed 2026-07-15RHSA-2026:40380
Red Hat 3scale API Management Platform 23scale-amp21/systemNot affected
Red Hat 3scale API Management Platform 23scale-amp21/zyncNot affected
Red Hat 3scale API Management Platform 23scale-amp22/systemNot affected
Red Hat 3scale API Management Platform 23scale-amp22/zyncNot affected
Red Hat 3scale API Management Platform 23scale-amp2/system-rhel7Not affected
Red Hat 3scale API Management Platform 23scale-amp2/system-rhel8Not affected
Red Hat 3scale API Management Platform 23scale-amp2/system-rhel9Not affected
Red Hat 3scale API Management Platform 23scale-amp2/zync-rhel8Not affected
Red Hat 3scale API Management Platform 23scale-amp2/zync-rhel9Not affected
Red Hat Hardened Imagesruby3.4Not affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-47240.

Attack patterns (CAPEC)

  • CAPEC-15 Command Delimiters Likelihood: High · Severity: High
  • CAPEC-81 Web Server Logs Tampering Likelihood: Medium · Severity: High
  • CAPEC-40 Manipulating Writeable Terminal Devices Likelihood: High · Severity: Very High
  • CAPEC-43 Exploiting Multiple Input Interpretation Layers Likelihood: Medium · Severity: High
  • CAPEC-75 Manipulating Writeable Configuration Files Likelihood: High · Severity: Very High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-136 LDAP Injection Likelihood: High · Severity: High
  • CAPEC-183 IMAP/SMTP Command Injection Severity: Medium
  • CAPEC-248 Command Injection Likelihood: Medium · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON