GHSA-75xq-5h9v-w6px

Suggest an improvement
Source
https://github.com/advisories/GHSA-75xq-5h9v-w6px
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-75xq-5h9v-w6px/GHSA-75xq-5h9v-w6px.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-75xq-5h9v-w6px
Aliases
  • CVE-2026-42258
Downstream
Related
Published
2026-05-04T22:04:08Z
Modified
2026-05-05T20:14:25.847815380Z
Severity
  • 5.8 (Medium) CVSS_V4 - 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 CVSS Calculator
Summary
net-imap vulnerable to command Injection via unvalidated Symbol inputs
Details

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.
Database specific
{
    "cwe_ids": [
        "CWE-77",
        "CWE-93"
    ],
    "github_reviewed_at": "2026-05-04T22:04:08Z",
    "github_reviewed": true,
    "severity": "MODERATE",
    "nvd_published_at": null
}
References

Affected packages

RubyGems / net-imap

Package

Name
net-imap
Purl
pkg:gem/net-imap

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0.6.0
Fixed
0.6.4

Affected versions

0.*
0.6.0
0.6.1
0.6.2
0.6.3

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-75xq-5h9v-w6px/GHSA-75xq-5h9v-w6px.json"
last_known_affected_version_range
"<= 0.6.3"

RubyGems / net-imap

Package

Name
net-imap
Purl
pkg:gem/net-imap

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0.5.0
Fixed
0.5.14

Affected versions

0.*
0.5.0
0.5.1
0.5.2
0.5.3
0.5.4
0.5.5
0.5.6
0.5.7
0.5.8
0.5.9
0.5.10
0.5.11
0.5.12
0.5.13

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-75xq-5h9v-w6px/GHSA-75xq-5h9v-w6px.json"
last_known_affected_version_range
"<= 0.5.13"

RubyGems / net-imap

Package

Name
net-imap
Purl
pkg:gem/net-imap

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.4.24

Affected versions

0.*
0.1.0
0.1.1
0.2.0
0.2.1
0.2.2
0.2.3
0.2.4
0.2.5
0.3.0
0.3.1
0.3.2
0.3.3
0.3.4
0.3.4.1
0.3.5
0.3.6
0.3.7
0.3.8
0.3.9
0.3.10
0.4.0
0.4.1
0.4.2
0.4.3
0.4.4
0.4.5
0.4.6
0.4.7
0.4.8
0.4.9
0.4.9.1
0.4.10
0.4.11
0.4.12
0.4.13
0.4.14
0.4.15
0.4.16
0.4.17
0.4.18
0.4.19
0.4.20
0.4.21
0.4.22
0.4.23

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-75xq-5h9v-w6px/GHSA-75xq-5h9v-w6px.json"
last_known_affected_version_range
"<= 0.4.23"