Memory Allocation with Excessive Size Value Affecting net-imap package, versions <0.2.5>=0.3.0, <0.3.9>=0.4.0, <0.4.20>=0.5.0, <0.5.7


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.08% (26th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUBY-NETIMAP-10006666
  • published4 May 2025
  • disclosed28 Apr 2025
  • creditMasamune

Introduced: 28 Apr 2025

NewCVE-2025-43857  (opens in a new tab)
CWE-789  (opens in a new tab)

How to fix?

Upgrade net-imap to version 0.2.5, 0.3.9, 0.4.20, 0.5.7 or higher.

Overview

Affected versions of this package are vulnerable to Memory Allocation with Excessive Size Value in the ResponseReader class. An attacker can cause the application to allocate excessive memory and trigger denial of service by sending requests containing "literal" strings.

After implementing the fix, the default max_response_size is still high (512MiB), to accommodate backward compatibility. It is recommended to set a lower max_response_size if connecting to untrusted servers or using insecure connections.

CVSS Base Scores

version 4.0
version 3.1