CVE-2026-42258
JSON

5.8medium

net-imap: Command Injection via unvalidated Symbol inputs

Severity
5.8medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.78% (higher than 57% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-75xq-5h9v-w6px

Description

Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. Prior to versions 0.4.24, 0.5.14, and 0.6.4, symbol arguments to commands are vulnerable to a CRLF Injection / IMAP Command injection via Symbol arguments passed to IMAP commands. This issue has been patched in versions 0.4.24, 0.5.14, and 0.6.4.

Affected

Product or packageVersionsReported by
ruby net-imap< 0.4.24, >= 0.5.0, < 0.5.14, >= 0.6.0, < 0.6.4CVE List
ruby4.0Not specified
Not affected: from 0:4.0.3-35.el10_2 before *
CVE List
rubyNot specified
Not affected: from 0:3.3.10-13.el10_2 before *, from 0:3.3.10-11.el10_0.2 before *, from 0:2.0.0.648-39.el7_9.1 before *, from 0:3.0.7-167.el9_8 before *, from 0:3.0.4-161.el9_2.3 before *, from 0:3.0.7-162.el9_4.3 before *
CVE List
ruby:2.5Not specified
Not affected: from 8100020260615131019.489197e6 before *, from 8040020260630124058.522a0ee4 before *, from 8060020260630123825.ad008a3a before *, from 8080020260625114827.63b34585 before *
CVE List
ruby:3.3Not specified
Not affected: from 8100020260615131010.489197e6 before *, from 9080020260615131001.9 before *, from 9040020260630065449.9 before *, from 9060020260630075016.9 before *
CVE List
ruby:4.0Not specified
Not affected: from 9080020260619130154.9 before *
CVE List
ruby4-0-mainNot specified
Not affected: from 4.0.5-35.hum1 before *
CVE List
ruby3-4-mainNot specified
Not affected: from 3.4.10-31.hum1 before *
CVE List
ruby3-3-mainNot specified
Not affected: from 3.3.10-23.4.hum1 before *
CVE List
3scale-amp21/systemNot specifiedCVE List
3scale-amp21/zyncNot specifiedCVE List
3scale-amp22/systemNot specifiedCVE List

All scores

GitHub_M5.8medium CVSS:4.0CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N
redhat-SADP7.1high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:L
GitHubmedium CVSS:4.0CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:L

Classification

CWE-77CWE-93

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. Prior to versions 0.4.24, 0.5.14, and 0.6.4, symbol arguments to commands are vulnerable to a CRLF Injection / IMAP Command injection via Symbol arguments passed to IMAP commands. This issue has been patched in versions 0.4.24, 0.5.14, and 0.6.4.

GitHub Advisory Database
Summary

Symbol arguments to commands are vulnerable to a CRLF Injection / IMAP Command injection via Symbol arguments passed to IMAP commands.

Details

Symbol arguments represent IMAP "system flags", which are formatted as "atoms" (with no quoting) with a "\" prefix. Vulnerable versions of Net::IMAP sends the symbol name directly to the socket, with no validation.

Because the Symbol input is unvalidated, it could contain invalid flag characters, including SP and CRLF, which could be used to finish the current command and inject new commands.

Although IMAP flag arguments are only valid input for a few IMAP commands, most Net::IMAP commands use generic argument handling, and will allow Symbol (flag) inputs.

Note also that the list of valid symbol inputs should be restricted to an enumerated set of standard RFC defined flag types, which have each been given specific defined semantics. Any user-provided values outside of that list of standard "system flags" needs to use the IMAP keyword syntax, which are sent as atoms, i.e: string inputs. Under no circumstances should #to_sym ever be called on unvetted user-provided input: that will always be a bug in the calling code for the simple reason that user_input_atom is as \user_input_atom.

For forward compatibility with future IMAP extentions, Net::IMAP, does not restrict flag inputs to an enumerated list. That is the responsibility of the calling application code, which knows which flag semantics are valid for its context.

Impact

If a developer passes user-controlled input as a Symbol to most Net::IMAP commands, an attacker can append CRLF sequence followed by a new IMAP command (like DELETE mailbox).

Mitigation
  • Upgrade to a version of Net::IMAP that validates Symbols are valid as an IMAP flag.

  • User-provided input should never be able to control calling #to_sym on string arguments.

    For example, do not unsafely serialize and deserialize command arguments (e.g. with YAML or Marshal) in a way that could create unvetted Symbol arguments.

  • For the few IMAP commands which do allow flag arguments, it may be appropriate to hard-code Symbol arguments or restrict them to an enumerated list which is valid for the calling application.

NVD (es)

Net::IMAP implementa la funcionalidad de cliente del Protocolo de Acceso a Mensajes de Internet (IMAP) en Ruby. Antes de las versiones 0.4.24, 0.5.14 y 0.6.4, los argumentos de tipo símbolo a los comandos son vulnerables a una inyección CRLF / inyección de comandos IMAP a través de argumentos de tipo símbolo pasados a comandos IMAP. Este problema ha sido parcheado en las versiones 0.4.24, 0.5.14 y 0.6.4.

References

https://github.com/ruby/net-imap/security/advisories/GHSA-75xq-5h9v-w6pxmitigation, vendor-advisory, web
https://github.com/ruby/net-imap/releases/tag/v0.4.24release-notes, web
https://github.com/ruby/net-imap/releases/tag/v0.5.14release-notes, web
https://github.com/ruby/net-imap/releases/tag/v0.6.4release-notes, web
https://access.redhat.com/security/cve/CVE-2026-42258vdb-entry, web
https://bugzilla.redhat.com/show_bug.cgi?id=2468498issue-tracking, web
https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42258.jsonweb
https://access.redhat.com/errata/RHSA-2026:37397vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:35895vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:33565vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:33540vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:33514vendor-advisory, web

Sources

SourceRecordLicence
CVE ListCVE-2026-42258 changed 2026-09-01CVE Terms of Use
GitHub Advisory DatabaseGHSA-75xq-5h9v-w6px changed 2026-09-10CC-BY-4.0
NVDCVE-2026-42258 changed 2026-08-24Public domain