Miggo Logo

CVE-2017-10784:
WEBrick RCE Vulnerability

8.8

CVSS Score
3.0

Basic Information

EPSS Score
0.82005%
Published
5/14/2022
Updated
7/31/2023
KEV Status
No
Technology
TechnologyRuby

Technical Details

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

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from WEBrick's failure to sanitize terminal escape sequences in Basic Authentication usernames before logging. The key functions are: 1) Log formatting in lib/webrick/log.rb which lacked escaping, and 2) Authentication handling in basicauth.rb that passed raw user input to the logger. The GitHub commit 6617c41292 shows escaping was added to Log#format and exception messages, confirming these were the vulnerable points. Red Hat's advisory explicitly mentions WEBrick log sanitization fixes.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

T** **si* *ut**nti**tion *o** in W**ri*k li*r*ry in Ru*y ***or* *.*.*, *.*.x ***or* *.*.*, *n* *.*.x t*rou** *.*.* *llows r*mot* *tt**k*rs to inj**t t*rmin*l *mul*tor *s**p* s*qu*n**s into its lo* *n* possi*ly *x**ut* *r*itr*ry *omm*n*s vi* * *r**t**

Reasoning

T** vuln*r**ility st*ms *rom W**ri*k's **ilur* to s*nitiz* t*rmin*l *s**p* s*qu*n**s in **si* *ut**nti**tion us*rn*m*s ***or* lo**in*. T** k*y *un*tions *r*: *) Lo* *orm*ttin* in `li*/w**ri*k/lo*.r*` w*i** l**k** *s**pin*, *n* *) *ut**nti**tion **n*l