Sprockets path traversal leads to information leak
Published 20 Jun 2018 · Updated 16 Feb 2024
Is your project on an affected sprockets?
Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- >=3.0.0 <3.7.2
- Fixed in
- 3.7.2
bundle update --conservative sprockets # Gemfile: '>= 3.7.2'- Affected
- >=4.0.0.beta1 <4.0.0.beta8
- Fixed in
- 4.0.0.beta8
bundle update --conservative sprockets # Gemfile: '>= 4.0.0.beta8'- Affected
- <2.12.5
- Fixed in
- 2.12.5
bundle update --conservative sprockets # Gemfile: '>= 2.12.5'Details
Specially crafted requests can be used to access files that exist on the filesystem that is outside an application's root directory, when the Sprockets server is used in production.
All users running an affected release should either upgrade or use one of the work arounds immediately.
Workaround:
In Rails applications, work around this issue, set config.assets.compile = false and config.public_file_server.enabled = true in an initializer and precompile the assets.
This work around will not be possible in all hosting environments and upgrading is advised.
Is GHSA-pr3h-jjhj-573x in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected sprockets, and gives you the command that fixes it.
More advisories for sprockets
- MediumCVE-2014-7819sprockets vulnerable to Path Traversal · 24 Oct 2017
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2018-3760
- Linkgithub.com/rails/sprockets/commit/18b8a7f07a50c245e9aee7854ecdbe606bbd8bb5
- Linkgithub.com/rails/sprockets/commit/9c34fa05900b968d74f08ccf40917848a7be9441
- Linkgithub.com/rails/sprockets/commit/c09131cf5b2c479263939c8582e22b98ed616c5f
- Linkaccess.redhat.com/errata/RHSA-2018:2244
- Linkaccess.redhat.com/errata/RHSA-2018:2245
- Linkaccess.redhat.com/errata/RHSA-2018:2561
- Linkaccess.redhat.com/errata/RHSA-2018:2745
- Packagegithub.com/rails/sprockets
- Linkgroups.google.com/d/msg/rubyonrails-security/ft_J--l55fM/7roDfQ50BwAJ
- Linkwww.debian.org/security/2018/dsa-4242
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.