Am I affected?

type your cowlib version to check

Description

Improper Handling of Highly Compressed Data (Data Amplification) vulnerability in ninenines cowlib allows unauthenticated remote denial of service via memory exhaustion.

cow_spdy:inflate/2 in cowlib passes peer-supplied compressed bytes directly to zlib:inflate/2 with no output size bound. The SPDY header compression dictionary (?ZDICT) is public, and zlib compresses long runs of repeated bytes at roughly 1024:1, so a few kilobytes of SPDY frame payload can decompress to gigabytes on the BEAM heap, OOM-killing the node. A single unauthenticated SPDY frame is sufficient to trigger the condition. The parsers for syn_stream, syn_reply, and headers frame types are all affected via cow_spdy:parse_headers/2.

This issue affects cowlib from 0.1.0 before 2.16.1.

Weaknesses & attack patterns

Weakness

CWE-409 · Improper Handling of Highly Compressed Data (Data Amplification) in catalog → MITRE ↗

Attack patterns

CAPEC-130 · Excessive Allocation MITRE ↗

Affected — Hex / cowlib Hex.pm ↗ Repository ↗

0.1.0 < 2.16.1 affected
every other version: unaffected
default status unaffected
cpe cpe:2.3:a:ninenines:cowlib:*:*:*:*:*:*:*:*
modules · source files · routines
modules cow_spdy
source files src/cow_spdy.erl
routines cow_spdy:parse/2 · cow_spdy:inflate/2 · cow_spdy:parse_headers/2 · cow_spdy:parse_headers/4

Affected — GitHub / ninenines/cowlib Repository ↗

fad5c00 < 16aad3f affected
every other version: unaffected
default status unaffected
cpe cpe:2.3:a:ninenines:cowlib:*:*:*:*:*:*:*:*
modules · source files · routines
modules cow_spdy
source files src/cow_spdy.erl
routines cow_spdy:parse/2 · cow_spdy:inflate/2 · cow_spdy:parse_headers/2 · cow_spdy:parse_headers/4

Configurations

The application must use cow_spdy:parse/2 to parse SPDY frames from an untrusted peer. cowboy itself does not use cow_spdy; only direct callers of the cow_spdy API are affected.

Solutions

Upgrade to cowlib 2.16.1 or later, in which the cow_spdy module has been removed entirely. No patched version of cow_spdy will be provided. Migrate away from SPDY, which has been deprecated since 2015 in favour of HTTP/2.

References

Credits

Peter Ullrich Finder
Loïc Hoguin Remediation developer

CVSS breakdown

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
« All CVEs