Sprockets path traversal leads to information leak
High severity
GitHub Reviewed
Published
Jun 20, 2018
to the GitHub Advisory Database
•
Updated Sep 5, 2023
Package
Affected versions
< 2.12.5
>= 3.0.0, < 3.7.2
>= 4.0.0.beta1, <= 4.0.0.beta7
Patched versions
2.12.5
3.7.2
4.0.0.beta8
Description
Published to the GitHub Advisory Database
Jun 20, 2018
Reviewed
Jun 16, 2020
Last updated
Sep 5, 2023
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
andconfig.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.
References