Command InjectionWeakness · CWE-77

CVE-2026-47240

MEDIUM · 5.8 CVSS v4.0 Published 2026-06-22
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
61/100
Remediation priority · Elevated
No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. Prior to 0.6.5 and 0.5.15, several Net::IMAP commands accept a "raw data" argument that is sent verbatim after validation to prevent command injection. However, if a server does not support non-synchronizing literals, it may still be possible to inject arbitrary IMAP commands inside non-synchronizing literals. A server without support for non-synchronizing literals may interpret the "+}\r\n" as the end of a malformed command line and respond with a tagged BAD. In that case, the contents of the literal will be interpreted as one or more new pipelined commands, allowing a CRLF command injection attack to succeed. This affects criteria for #search and #uid_search; search_keys for #sort, #thread, #uid_sort, and #uid_thread; and attr for #fetch and #uid_fetch. This vulnerability is fixed in 0.6.5 and 0.5.15.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · moderate confidence

Net::IMAP Ruby library before 0.6.5 and 0.5.15 contains a CRLF command injection vulnerability when servers do not support non-synchronizing literals. Attackers can inject arbitrary IMAP commands by crafting search_keys or fetch attributes that, when the server rejects a malformed command, cause the literal contents to be interpreted as pipelined commands. Affected methods include search, uid_search, sort, thread, uid_sort, uid_thread, fetch, and uid_fetch.

MitigationUpgrade Net::IMAP to version 0.6.5 or 0.5.15. Additionally, sanitize all user-supplied input passed to these IMAP methods to prevent malicious payload injection regardless of server configuration.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Local
Complexity
Low
Privileges
None
Authentication
X
User interaction
P
Scope
X

CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify Net::IMAP library version
    Run `gem list net-imap` or inspect the Gemfile.lock to find the installed version of the net-imap gem
    Affected if The installed version is lower than 0.5.15 or is between 0.5.15 and 0.6.5 (exclusive)
  2. Locate Net::IMAP usage in codebase
    Search source code for require 'net/imap' or require 'net-imap' statements to identify files using the library
    Affected if The application uses Net::IMAP for IMAP operations
  3. Identify affected method calls
    Search for invocations of search, uid_search, sort, thread, uid_sort, uid_thread, fetch, or uid_fetch methods on Net::IMAP objects
    Affected if Any of these methods are called with data that could contain user-controlled input
  4. Verify input sanitization on vulnerable methods
    Review the code handling search_keys and fetch attributes passed to the affected methods to determine if user input is validated or sanitized before use
    Affected if User-supplied input is passed directly to these methods without sanitization of CRLF sequences

A system is affected if it uses a Net::IMAP version below 0.5.15 or between 0.5.15 and 0.6.5, and passes unsanitized user input to search, uid_search, sort, thread, uid_sort, uid_thread, fetch, or uid_fetch methods.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade Net::IMAP to version 0.6.5 or 0.5.15. Additionally, sanitize all user-supplied input passed to these IMAP methods to prevent malicious payload injection regardless of server configuration.

Recommended fix High confidence

net-imap version 0.6.5 (or 0.5.15 for older Ruby support)

  1. Check current Net::IMAP version in use by running `gem list net-imap` or checking your Gemfile
  2. Update to the fixed version by running `gem install net-imap -v 0.6.5` or adding `gem 'net-imap', '~> 0.6.5'` to your Gemfile
  3. If using Bundler, run `bundle update net-imap` to apply the update
  4. Verify the update was successful by running `gem list net-imap` and confirming version 0.6.5 or 0.5.15 is installed
  5. Test that IMAP functionality (search, uid_search, sort, thread, fetch, uid_fetch operations) continues to work correctly

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation4.0 h
  • Implementation4.0 h
  • Testing4.0 h
  • Review / QA2.0 h
14.0 hours of engineering $2,480
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,968.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-47240 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-47240 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data