CVE-2025-43857: net-imap rubygem vulnerable to possible DoS by memory exhaustion
Noroxi assessment
Priority: Monitor (action score 24/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 0.49% (FIRST EPSS).
- Anyone who can reach it over the internet can trigger it. No account or password is required. No special conditions are required; it is repeatable.
- Fixed version: ruby-net-imap (Alpine:v3.20) 0.4.22-r0; net-imap (RubyGems) 0.3.9, 0.4.20, 0.5.7.
Low priority for now. Upgrade to ruby-net-imap (Alpine:v3.20) 0.4.22-r0; net-imap (RubyGems) 0.3.9, 0.4.20, 0.5.7 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. Prior to versions 0.5.7, 0.4.20, 0.3.9, and 0.2.5, there is a possibility for denial of service by memory exhaustion when net-imap reads server responses. At any time while the client is connected, a malicious server can send can send a "literal" byte count, which is automatically read by the client's receiver thread. The response reader immediately allocates memory for the number of bytes indicated by the server response. This should not be an issue when securely connecting to trusted IMAP servers that are well-behaved. It can affect insecure connections and buggy, untrusted, or compromised servers (for example, connecting to a user supplied hostname). This issue has been patched in versions 0.5.7, 0.4.20, 0.3.9, and 0.2.5.
- Published
- Apr 28, 2025
- Updated
- Jun 17, 2026
- EPSS
- 0.4% · 42th percentile
- CWE
- CWE-400
Report tools
Action score
24
Monitor
Low priority for now.
- CVSS
- 24 / 40 · 6.0 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 0.4%
CISA SSVC decision
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- —
- CNA · GitHub_M
- 6.0
- NVD has not scored this yet; the score shown is the CNA’s.
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Running WordPress? Scan your site free with WP Lens
Noroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| ruby-lang | net\ | cpe:2.3:a:ruby-lang:net\ |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- ruby-lang net::imapbefore 0.2.5
- ruby-lang net::imap0.3.0 and later · before 0.3.9
- ruby-lang net::imap0.4.0 and later · before 0.4.20
- ruby-lang net::imap0.5.0 and later · before 0.5.7
Versions reported by the vendor
Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.
ruby net-imap
- >= 0.5.0, < 0.5.7, >= 0.4.0, < 0.4.20, >= 0.3.0, < 0.3.9, >= 0, < 0.2.5affected
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Alpine:v3.20 | ruby-net-imap | before 0.4.22-r0 | 0.4.22-r0 |
| Debian:12 | ruby3.1 | from 0 | — |
| Debian:13 | ruby3.3 | from 0 | — |
| RubyGems | net-imap | from 0.3.0 · before 0.3.9 | 0.3.9 |
| RubyGems | net-imap | from 0.4.0 · before 0.4.20 | 0.4.20 |
| RubyGems | net-imap | from 0.5.0 · before 0.5.7 | 0.5.7 |
| RubyGems | net-imap | before 0.2.5 | 0.2.5 |
Same product
ruby-lang: all recordsOther highest-scoring records for the same primary product.
- CVE-2026-42246net-imap vulnerable to STARTTLS stripping via invalid response timing30Monitor
- CVE-2026-42256net-imap: Denial of service via high iteration count for `SCRAM-*` authentication24Monitor
- CVE-2026-42258net-imap: Command Injection via unvalidated Symbol inputs23Monitor
Published before and after this one in the same product
- Later →CVE-2026-42245May 9, 2026 · net-imap: Quadratic complexity when reading response literals9Monitor
- Later →CVE-2026-42257May 9, 2026 · net-imap: Command Injection via "raw" arguments to multiple commands23Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| alpine:ruby-net-imap | 0.4.22-r0 · Alpine:v3.20 | Package registry (OSV) |
| RubyGems:net-imap | 0.2.5 | Package registry (OSV) |
| RubyGems:net-imap | 0.3.9 | Package registry (OSV) |
| RubyGems:net-imap | 0.4.20 | Package registry (OSV) |
| RubyGems:net-imap | 0.5.7 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
No history yet (it accumulates with the daily EPSS job).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
The product’s vendor appears in a public program. Matched by name; verify the scope text in the program.
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- Integrity
- Availability
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- P
- Scope
- X
Weakness class (CWE)
CWE-400 · Uncontrolled Resource ConsumptionCVSS vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:H/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
nvd-secondary
Root cause
Code that parses nested structures sets no depth or size limit. A small input can turn into a disproportionate processing load.
The bug in code
The whole CWE-400 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
function expand(node) {
return node.children.map(expand);
}Fixed
const MAX_DEPTH = 32;
function expand(node, depth = 0) {
if (depth > MAX_DEPTH) throw new Error("too deep");
return node.children.map((c) => expand(c, depth + 1));
}Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (5 more)Show less
- github.com/ruby/net-imap/pull/444/commits/0ae8576c1a90bcd9573f81bdad4b4b824642d105#diff-53721cb4d9c3fb86b95cc8476ca2df90968ad8c481645220c607034399151462
- github.com/ruby/net-imap/pull/445
- github.com/ruby/net-imap/pull/446
- github.com/ruby/net-imap/pull/447
- github.com/ruby/net-imap/security/advisories/GHSA-j3g3-5qv5-52mj
Vendor advisories and official records. Exploit/PoC links are deliberately left out.