CVE-2026-47241: Net Denial of Service Vulnerability

LOW
Advisory Identifier: GHSA-c4fp-cxrr-mj66
CWE-186 CWE-182 CWE-162
Published
Advisory Summary

CVE-2026-47241 is a LOW denial of service vulnerability (CWE-186: Overly Restrictive Regular Expression) affecting Net libraries in the RubyGems ecosystem. The issue involves :imap: denial of service via incomplete raw argument validation. Remediation is available by upgrading affected packages to version 0.6.4.1, 0.5.15.

CVE-2026-47241 at a Glance

CVE Identifier CVE-2026-47241
GHSA Identifier GHSA-c4fp-cxrr-mj66
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-186: Overly Restrictive Regular Expression
Affected Product Net
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2026-47241

To remediate this vulnerability, upgrade all affected Net dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

net-imap fixed: 0.6.4.1
Upgrade net-imap to 0.6.4.1
net-imap fixed: 0.5.15
Upgrade net-imap to 0.5.15
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for net-imap

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-47241, inspect your project dependencies for Net:

inspect dependencies for net-imap

Analyze the terminal output to locate any version of Net in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.4.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-186: Overly Restrictive Regular Expression, where a regular expression is overly restrictive, which prevents dangerous values from being detected. In Net, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Several Net::IMAP commands accept a raw string argument which is only validated to prevent CRLF injection and then sent verbatim. If this string is derived from user-controlled input, an attacker can force the next command to be absorbed as a continuation of the first command. This will cause the first command to eventually fail, but also prevents it from returning until another command is sent (from another thread). That other command will not return until the connection is closed. ### Details `Net::IMAP::RawData` was hardened in v0.6.4, v0.5.14, and v0.4.24 to reject string arguments that would smuggle an invalid literal-continuation marker onto the wire (CVE-2026-42257, GHSA-hm49-wcqc-g2xg). But the trailing-marker check uses an incorrect regex which does not match `{0}` or `{0+}`, so an attacker-controlled seach `criteria` or fetch `attr` string ending in `{0}` or `{0+}` passes validation and is sent verbatim. Since these arguments are sent as the last argument in the command, they will be followed by CRLF. Although the CRLF was intended to end the command, the server will interpret it as part of a literal prefix. This consumes the next command the client puts on the socket as additional arguments to the current command. This affects the following command's arguments: * `criteria` for `#search` and `#uid_search` * `search_keys` for `#sort`, `#thread`, `#uid_sort`, and `#uid_thread` * `attr` for `#fetch` and `#uid_fetch` The command which contained the attacker's raw data will not be able to complete until the _next_ command is issued. If commands are only sent from single thread, the first command will hang until the connection times out (most likely by the server closing the connection). If a second command is sent _(from another thread)_, this would allow the server to respond to the first command. This combined command _will_ be invalid: * The `{0}\r\n` literal prohibits other arguments (such as a quoted string) from spanning both commands * It will be sent without the space delimiter which is required between arguments. * The second command's tag will not be a valid argument to any of the vulnerable commands. So the server _should_ respond to the first command with a `BAD` response, which will raise a `BadResponseError`. But, since the server never saw a second command, the second command will never receive a tagged response and the thread that sent it will hang until the connection is closed. ### Impact This will result in unexpected crashes and timeouts, which could be used to create a simple denial of service attack. This attack will present very similarly to common network issues or server issues which also result in commands hanging or unexpectedly raising exceptions. By itself, this does not allow command injection. But the confusion caused by these errors could lead to other downstream issues, especially in a multi-threaded environment. ### Mitigation Update to a patched version of `net-imap` which validates that `RawData` arguments may not end with literal continuation markers. If `net-imap` cannot be upgraded: * Validate that user input to the affected command arguments does not end with `"}"`. * Use of `Timeout` or other standard strategies for slow connections and misbehaving servers will also mitigate the effects of this. _Extra caution is required when issuing commands from multiple threads._ While `net-imap` does have rudimentary support for issuing commands from multiple threads, the user is responsible for synchronizing that commands are issued in a logically coherent order, and for ensuring that commands are only pipelined when it is safe to do so. Practically, this means that many commands cannot be safely pipelined together, and user code will often need to wait for state changing commands to successfully complete before issuing commands that rely on that state change.

CVE-2026-47241 Affected Net Versions

2 component(s)
Fixed Versions:
0.6.4.10.5.15
Product / Package Ecosystem Affected Versions Fixed Version
net-imap
RubyGems
≥ 0.6.0
< 0.6.4.1
0.6.4.1
net-imap
RubyGems
< 0.5.15
0.5.15

References

Frequently Asked Questions

What is CVE-2026-47241?
CVE-2026-47241 is a security vulnerability in Net involving :IMAP: Denial of Service via incomplete raw argument validation under CWE-186: Overly Restrictive Regular Expression.
Which Net versions are affected?
Affected versions include releases prior to 0.6.4.1, 0.5.15 across affected packages: net-imap.
What version fixes CVE-2026-47241?
Upgrading to 0.6.4.1, 0.5.15 (or the latest patched release for your respective branch) resolves the vulnerability.
Is net-imap affected?
Yes, net-imap is affected in releases prior to 0.6.4.1, 0.5.15. Upgrade your dependency to 0.6.4.1, 0.5.15 or later.
What CWE is associated with CVE-2026-47241?
CVE-2026-47241 is classified under CWE-186: Overly Restrictive Regular Expression (A regular expression is overly restrictive, which prevents dangerous values from being detected.).
How can I check RubyGems dependencies for CVE-2026-47241?
Run the dependency tree command: 'inspect dependencies for net-imap'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c4fp-cxrr-mj66",
  "modified" : "2026-07-06T22:53:50Z",
  "published" : "2026-06-09T18:36:11Z",
  "aliases" : [ "CVE-2026-47241" ],
  "summary" : "Net::IMAP: Denial of Service via incomplete raw argument validation",
  "details" : "### Summary\n\nSeveral Net::IMAP commands accept a raw string argument which is only validated to prevent CRLF injection and then sent verbatim.  If this string is derived from user-controlled input, an attacker can force the next command to be absorbed as a continuation of the first command.  This will cause the first command to eventually fail, but also prevents it from returning until another command is sent (from another thread).  That other command will not return until the connection is closed.\n\n### Details\n\n`Net::IMAP::RawData` was hardened in v0.6.4, v0.5.14, and v0.4.24 to reject string arguments that would smuggle an invalid literal-continuation marker onto the wire (CVE-2026-42257, GHSA-hm49-wcqc-g2xg).  But the trailing-marker check uses an incorrect regex which does not match `{0}` or `{0+}`, so an attacker-controlled seach `criteria` or fetch `attr` string ending in `{0}` or `{0+}` passes validation and is sent verbatim.  Since these arguments are sent as the last argument in the command, they will be followed by CRLF.  Although the CRLF was intended to end the command, the server will interpret it as part of a literal prefix.  This consumes the next command the client puts on the socket as additional arguments to the current command.\n\nThis affects the following command's arguments:\n* `criteria` for `#search` and `#uid_search`\n* `search_keys` for `#sort`, `#thread`, `#uid_sort`, and `#uid_thread`\n* `attr` for `#fetch` and `#uid_fetch`\n\nThe command which contained the attacker's raw data will not be able to complete until the _next_ command is issued.  If commands are only sent from single thread, the first command will hang until the connection times out (most likely by the server closing the connection).\n\nIf a second command is sent _(from another thread)_, this would allow the server to respond to the first command.  This combined command _will_ be invalid:\n* The `{0}\\r\\n` literal prohibits other arguments (such as a quoted string) from spanning both commands\n* It will be sent without the space delimiter which is required between arguments.\n* The second command's tag will not be a valid argument to any of the vulnerable commands.\n\nSo the server _should_ respond to the first command with a `BAD` response, which will raise a `BadResponseError`. \n\nBut, since the server never saw a second command, the second command will never receive a tagged response and the thread that sent it will hang until the connection is closed.\n\n### Impact\n\nThis will result in unexpected crashes and timeouts, which could be used to create a simple denial of service attack.  This attack will present very similarly to common network issues or server issues which also result in commands hanging or unexpectedly raising exceptions.  By itself, this does not allow command injection.  But the confusion caused by these errors could lead to other downstream issues, especially in a multi-threaded environment.\n\n### Mitigation\n\nUpdate to a patched version of `net-imap` which validates that `RawData` arguments may not end with literal continuation markers.\nIf `net-imap` cannot be upgraded:\n* Validate that user input to the affected command arguments does not end with `\"}\"`.\n* Use of `Timeout` or other standard strategies for slow connections and misbehaving servers will also mitigate the effects of this.\n\n_Extra caution is required when issuing commands from multiple threads._  While `net-imap` does have rudimentary support for issuing commands from multiple threads, the user is responsible for synchronizing that commands are issued in a logically coherent order, and for ensuring that commands are only pipelined when it is safe to do so. Practically, this means that many commands cannot be safely pipelined together, and user code will often need to wait for state changing commands to successfully complete before issuing commands that rely on that state change.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "net-imap"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.6.0"
      }, {
        "fixed" : "0.6.4.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.6.4"
    }
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "net-imap"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.15"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.5.14"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ruby/net-imap/security/advisories/GHSA-c4fp-cxrr-mj66"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-47241"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ruby/net-imap"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/net-imap/releases/tag/v0.6.4.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/net-imap/CVE-2026-47241.yml"
  }, {
    "type" : "WEB",
    "url" : "https://www.cve.org/CVERecord?id=CVE-2026-47241"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-162", "CWE-182", "CWE-186" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-09T18:36:11Z",
    "nvd_published_at" : "2026-06-22T21:16:24Z"
  }
}