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 package | Versions | Reported by |
|---|---|---|
| ruby net-imap | < 0.4.24, >= 0.5.0, < 0.5.14, >= 0.6.0, < 0.6.4 | CVE List |
| ruby4.0 | Not specified Not affected: from 0:4.0.3-35.el10_2 before * | CVE List |
| ruby | Not 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.5 | Not specified Not affected: from 8100020260615131019.489197e6 before *, from 8040020260630124058.522a0ee4 before *, from 8060020260630123825.ad008a3a before *, from 8080020260625114827.63b34585 before * | CVE List |
| ruby:3.3 | Not specified Not affected: from 8100020260615131010.489197e6 before *, from 9080020260615131001.9 before *, from 9040020260630065449.9 before *, from 9060020260630075016.9 before * | CVE List |
| ruby:4.0 | Not specified Not affected: from 9080020260619130154.9 before * | CVE List |
| ruby4-0-main | Not specified Not affected: from 4.0.5-35.hum1 before * | CVE List |
| ruby3-4-main | Not specified Not affected: from 3.4.10-31.hum1 before * | CVE List |
| ruby3-3-main | Not specified Not affected: from 3.3.10-23.4.hum1 before * | CVE List |
| 3scale-amp21/system | Not specified | CVE List |
| 3scale-amp21/zync | Not specified | CVE List |
| 3scale-amp22/system | Not specified | CVE List |
| 3scale-amp22/zync | Not specified | CVE List |
| 3scale-amp2/system-rhel7 | Not specified | CVE List |
| 3scale-amp2/system-rhel8 | Not specified | CVE List |
| 3scale-amp2/system-rhel9 | Not specified | CVE List |
| 3scale-amp2/zync-rhel8 | Not specified | CVE List |
| 3scale-amp2/zync-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-codeserver-datascience-cpu-py312-rhel9 | Not specified | CVE List |
| openshift/ose-rhel-coreos-9 | Not specified | CVE List |
| devspaces/code-rhel9 | Not specified | CVE List |
| net-imap (RubyGems) | from 0.6.0 before 0.6.4, from 0.5.0 before 0.5.14, before 0.4.24 | GitHub Advisory Database |
| ruby-lang net::imap | before 0.4.24, from 0.5.0 before 0.5.14, from 0.6.0 before 0.6.4 | NVD |
All scores
| GitHub_M | 5.8medium CVSS:4.0 | CVSS: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-SADP | 7.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N |
| GitHub | 5.3medium CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:L |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N |
| NVD | 5.3medium CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:L |
Classification
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_symon 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
flagarguments, 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
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-42258 changed 2026-09-01 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-75xq-5h9v-w6px changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-42258 changed 2026-08-24 | Public domain |