Improper Validation of Specified Quantity in Input Affecting cesanta/mongoose package, versions [,7.23)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.35% (27th 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 Learn

Learn about Improper Validation of Specified Quantity in Input vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-UNMANAGED-CESANTAMONGOOSE-20948700
  • published15 Oct 2026
  • disclosed14 Oct 2026
  • creditlihnucs

Introduced: 14 Oct 2026

NewCVE-2026-73261  (opens in a new tab)
CWE-125  (opens in a new tab)
CWE-1284  (opens in a new tab)

How to fix?

Upgrade cesanta/mongoose to version 7.23 or higher.

Overview

cesanta/mongoose is a networking library for C/C++. It implements event-driven non-blocking APIs for TCP, UDP, HTTP, WebSocket, MQTT.

Affected versions of this package are vulnerable to Improper Validation of Specified Quantity in Input in the handle_opt function in src/net_builtin.c, whose guard rejects len < 2 and opts[1] == 0 but never checks opts[1] > len, so an MSS option declaring length 4 with only three option bytes remaining reads opts[3] past the declared options area. An attacker can silently suppress or truncate all application data on a connection by sending a SYN with Data Offset 6 and the options [0x01, 0x02, 0x04, 0x00], which places the out of bounds byte into the low half of s->dmss, and tx_tcp then clamps every send to that value, so a zero byte there makes each mg_send deliver no payload while the connection continues to complete its handshake, acknowledgements, and teardown normally. This requires a build with MG_ENABLE_TCPIP=1 using the bundled TCP/IP stack, and it is reachable in both directions, since a client connecting to a server under the attacker's control processes the same options from the SYN-ACK.

CVSS Base Scores

version 4.0
version 3.1