Miggo Logo

CVE-2018-20857: samlr XML nodes comment attack

7.5

CVSS Score
3.0

Basic Information

EPSS Score
0.46742%
Published
7/31/2019
Updated
8/17/2023
KEV Status
No
Technology
TechnologyRuby

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
samlrrubygems< 2.6.22.6.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper XML comment handling in SAML response parsing. The NameID value extraction in Samlr likely used XML parsing that concatenated text nodes without properly ignoring comment nodes. This allowed attackers to craft values like 'user@example.com<!---->.attacker.com' where the parser would incorrectly interpret the full string as the NameID. The fix in v2.6.2 would have modified this NameID extraction logic to strip comments or use XML parsing methods that respect node boundaries.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

Z*n**sk S*mlr ***or* *.*.* *llows *n XML no**s *omm*nt *tt**k su** *s * n*m*_i* no** wit* us*r@*x*mpl*.*om *ollow** *y `<!---->`. *n* t**n t** *tt**k*r's *om*in n*m*.

Reasoning

T** vuln*r**ility st*ms *rom improp*r XML *omm*nt **n*lin* in S*ML r*spons* p*rsin*. T** N*m*I* v*lu* *xtr**tion in S*mlr lik*ly us** XML p*rsin* t**t *on**t*n*t** t*xt no**s wit*out prop*rly i*norin* *omm*nt no**s. T*is *llow** *tt**k*rs to *r**t v*