Skip to content
Crypto Disclosed report Intermediate CVE-2025-10148

CVE-2025-10148: predictable WebSocket mask

The curl WebSocket client generates a single masking key at connection start and reuses it for every frame, violating RFC 6455's requirement for a fresh, unpredictable key per frame. An attacker who can observe one frame could predict the mask for all subsequent frames, potentially enabling cache poisoning attacks on intermediaries as described in the RFC.

cruocco Follow

Originally disclosed on HackerOne

  • Triaged in 7 hours
  • Fixed in 44 hours
  • Disclosed after 44 hours

No AI was involved.

Summary:

The curl WebSocket implementation generates a fixed masking key at the beginning of a connection an re-uses it for every frame:

RFC-6455 §5.3 states:

[...] The masking key is a 32-bit value chosen at random by the client. When preparing a masked frame, the client MUST pick a fresh masking key from the set of allowed 32-bit values. The masking key needs to be unpredictable; thus, the masking key MUST be derived from a strong source of entropy, and the masking key for a given frame MUST NOT make it simple for a server/proxy to predict the masking key for a subsequent frame. The unpredictability of the masking key is essential to prevent authors of malicious applications from selecting the bytes that appear on the wire. [...]

Because the same masking key is repeatedly used for every frame, it is trivial for an attacker to "guess" the masking key of all subsequent frames.

Affected version

All versions since WebSocket support was added.

Steps To Reproduce:

None

Supporting Material/References:

None

Impact

See "Security Considerations > Attacks On Infrastructure (Masking)" in RFC-6455 §10.3. Here a short excerpt:

[...] As this protocol was being developed, an experiment was conducted to demonstrate a class of attacks on proxies that led to the poisoning of caching proxies deployed in the wild [TALKING]. The general form of the attack was to establish a connection to a server under the "attacker's" control, perform an UPGRADE on the HTTP connection similar to what the WebSocket Protocol does to establish a connection, and subsequently send data over that UPGRADEd connection that looked like a GET request for a specific known resource (which in an attack would likely be something like a widely deployed script for tracking hits or a resource on an ad-serving network). The remote server would respond with something that looked like a response to the fake GET request, and this response would be cached by a nonzero percentage of deployed intermediaries, thus poisoning the cache. The net effect of this attack would be that if a user could be convinced to visit a website the attacker controlled, the attacker could potentially poison the cache for that user and other users behind the same cache and run malicious script on other origins, compromising the web security model. [...]

The original report as published on HackerOne, by cruocco. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the masking key is generated once when the WebSocket connection is accepted and then reused for all outgoing frames instead of being regenerated per frame.

Impact

An attacker could potentially poison caching proxies and run malicious script on other origins, as described in the RFC, though the report does not demonstrate this in practice.

What the attacker needed

Attacker can observe one WebSocket frame; victim uses a caching proxy

The fix

The masking key should be freshly generated from a strong entropy source for each frame, as required by RFC 6455.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

WebSocket clients must scramble (mask) each message with a random number so that intermediaries like proxies cannot easily read or manipulate the traffic. curl used the same random number for every message in a connection, making it predictable. This could let an attacker poison web caches, as warned in the WebSocket standard.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.