Loading...
Skip to main content

CVE-2026-42258 — Vulnerability in net-imap — CVE Details

MEDIUM

net-imap vulnerable to command Injection via unvalidated Symbol inputs

Published May 4, 2026Updated September 10, 2026Source: osv

Summary

### 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.

Advisory Timeline

  • First published May 4, 2026 (161 days ago).
  • Last revised September 10, 2026 — 128 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update net-imap to 0.5.14 or later
gem install net-imap -v 0.5.14
Bundler
Update net-imap to 0.6.4 or later
gem install net-imap -v 0.6.4
Bundler
Update net-imap to 0.4.24 or later
gem install net-imap -v 0.4.24

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (3)

Affects 1 ecosystem: rubygems (1).

PackageEcosystemAffectedFixed In
net-imap
rubygems
0.5.0, 0.5.1, 0.5.10, 0.5.11 (+10 more)0.5.14
net-imap
rubygems
0.6.0, 0.6.1, 0.6.2, 0.6.30.6.4
net-imap
rubygems
0.1.0, 0.1.1, 0.2.0, 0.2.1 (+41 more)0.4.24

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 5.3 score means for each attack dimension.

Attack Vector
Local
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
Low

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:L

References

Frequently Asked Questions

What is CVE-2026-42258?
net-imap vulnerable to command Injection via unvalidated Symbol inputs This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 5.3/10).
How do I check if my project is affected by CVE-2026-42258?
CVE-2026-42258 affects net-imap. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-42258 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
5.3

Exploitation requires specific conditions or has limited impact. Remediate within weeks.

Also Known As

GHSA-75xq-5h9v-w6px

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies