Am I affected?

This record states its affected versions in a form that can't be compared automatically.

≥ deeb843 and up affected
every other version: unaffected

Description

Allocation of Resources Without Limits or Throttling vulnerability in esaml_binding in dropbox esaml allows an unauthenticated attacker to exhaust the Erlang VM atom table and crash the node via a crafted SAMLResponse.

esaml_binding:decode_response/2 parses the decoded SAMLResponse with xmerl_scan:string/2, which interns every element name, attribute name, and namespace prefix it reads as a permanent atom. The SAML consume (ACS) and single-logout endpoints call it on unauthenticated requests before any signature check, so one well-formed document with thousands of distinct names mints thousands of atoms while staying inside the 128 KB request body limit. Atoms are never reclaimed and the VM caps the atom table at about one million entries, so a few dozen requests abort the node.

This issue affects esaml: from 0.1.0 onward.

Technical analysis

1. Input. The SAML consume (ACS) and single-logout endpoints in esaml_cowboy read the request body, capped at 128 KB, and pass the SAMLResponse form field to esaml_binding:decode_response/2. Both the DEFLATE clause and the default clause end in xmerl_scan:string/2 with namespace_conformant set.

2. Interning. xmerl_scan converts every element name, attribute name, and namespace prefix it tokenizes into an atom with list_to_atom/1, and the same happens for each namespace local name in expanded_name/4. A well-formed document with many distinct names therefore mints one permanent atom per name. Repetitive names deflate well, so a document with ten thousand distinct names fits in a few tens of kilobytes on the wire.

3. Exhaustion before any check. Signature verification and assertion validation run on the parsed document afterward, so the atoms are minted whether or not the document is a valid or signed SAML message. Atoms are never garbage collected and the VM aborts when the atom table reaches its limit of about one million entries, so a few dozen requests take the node down.

Proof of concept

  1. Build a well-formed XML document whose root contains several thousand empty elements with distinct names, each carrying a distinctly named attribute, for example <p0 a0="x"/> through <p4999 a4999="x"/>.
  2. Deflate and base64-encode it, and post it to the service provider's SAML consume (ACS) or single-logout endpoint as the SAMLResponse form field with SAMLEncoding set to the DEFLATE URI. A document with 5,000 elements and 5,000 attributes encodes to about 33 KB.
  3. esaml_binding:decode_response/2 parses it with xmerl_scan:string/2 before any signature check, and the atom table grows by 10,000 entries that are never reclaimed. Repeat with fresh names until the VM aborts.

Weaknesses & attack patterns

Weakness

CWE-770 · Allocation of Resources Without Limits or Throttling in catalog → MITRE ↗

Attack patterns

CAPEC-130 · Excessive Allocation MITRE ↗

An unauthenticated attacker posts a small SAML document with thousands of distinct element and attribute names to a service provider's consume or single-logout endpoint. Each request permanently consumes thousands of atom table entries, and a few dozen requests abort the Erlang VM, denying service to every user of the service provider.

Affected — GitHub / arekinath/esaml Repository ↗

≥ deeb843 and up affected
every other version: unaffected
cpe cpe:2.3:a:arekinath:esaml:*:*:*:*:*:*:*:*
version type git
modules · source files · routines
modules esaml_binding · esaml_cowboy
source files src/esaml_binding.erl · src/esaml_cowboy.erl
routines esaml_binding:decode_response/2 · esaml_cowboy:validate_assertion/2 · esaml_cowboy:validate_logout/2

Affected — GitHub / handnot2/esaml Repository ↗

≥ deeb843 and up affected
every other version: unaffected
cpe cpe:2.3:a:handnot2:esaml:*:*:*:*:*:*:*:*
version type git
modules · source files · routines
modules esaml_binding · esaml_cowboy
source files src/esaml_binding.erl · src/esaml_cowboy.erl
routines esaml_binding:decode_response/2 · esaml_cowboy:validate_assertion/2 · esaml_cowboy:validate_logout/2

Affected — Hex / esaml Hex.pm ↗ Repository ↗

≥ 0.1.0 and up affected
every other version: unaffected
cpe cpe:2.3:a:dropbox:esaml:*:*:*:*:*:*:*:*
version type semver
modules · source files · routines
modules esaml_binding · esaml_cowboy
source files src/esaml_binding.erl · src/esaml_cowboy.erl
routines esaml_binding:decode_response/2 · esaml_cowboy:validate_assertion/2 · esaml_cowboy:validate_logout/2

Affected — GitHub / dropbox/esaml Repository ↗

≥ deeb843 and up affected
every other version: unaffected
cpe cpe:2.3:a:dropbox:esaml:*:*:*:*:*:*:*:*
version type git
modules · source files · routines
modules esaml_binding · esaml_cowboy
source files src/esaml_binding.erl · src/esaml_cowboy.erl
routines esaml_binding:decode_response/2 · esaml_cowboy:validate_assertion/2 · esaml_cowboy:validate_logout/2

References

Credits

Quinn Wilton Finder Reporter
Jonatan Männchen / EEF Coordinator

CVSS breakdown

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