Miggo Logo

CVE-2018-3760: Sprockets path traversal leads to information leak

7.5

CVSS Score
3.0

Basic Information

EPSS Score
0.99789%
Published
6/20/2018
Updated
9/5/2023
KEV Status
No
Technology
TechnologyRuby

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
sprocketsrubygems< 2.12.52.12.5
sprocketsrubygems>= 3.0.0, < 3.7.23.7.2
sprocketsrubygems>= 4.0.0.beta1, <= 4.0.0.beta74.0.0.beta8

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from insufficient path validation in the Sprockets server. The commit 18b8a7f explicitly modifies the forbidden_request? method in lib/sprockets/server.rb to add a check for URI schemes (path.include?('://')). Prior to this fix, the function allowed requests with URI schemes like file://, enabling path traversal attacks. The added test case in test/test_server.rb demonstrates this by attempting to access a file:// URL, which would have been permitted without the patch. This function's flawed validation logic directly enabled the CVE-2018-3760 path traversal vulnerability.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

Sp**i*lly *r**t** r*qu*sts **n ** us** to ****ss *il*s t**t *xist on t** *il*syst*m t**t is outsi** *n *ppli**tion's root *ir**tory, w**n t** Spro*k*ts s*rv*r is us** in pro*u*tion. *ll us*rs runnin* *n *****t** r*l**s* s*oul* *it**r up*r*** or us

Reasoning

T** vuln*r**ility st*ms *rom insu**i*i*nt p*t* v*li**tion in t** Spro*k*ts s*rv*r. T** *ommit ******* *xpli*itly mo*i*i*s t** `*or*i***n_r*qu*st?` m*t*o* in `li*/spro*k*ts/s*rv*r.r*` to *** * ****k *or URI s***m*s (`p*t*.in*lu**?('://')`). Prior to t