You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not respond to http requests asking for a file://
Based on CVE-2018-3760 when the Sprockets server is accidentally being used in production, an attacker can pass in a specifically crafted url that will allow them access to view every file on the system. If the file hit contains a compilable extension such as `.erb` then the code in that file will be executed.
A Rails app will be using the Sprockets file server in production if they have accidentally configured their app to:
```ruby
config.assets.compile = true # Your app is vulnerable
```
It is highly recommended to not use the Sprockets server in production and to instead precompile assets to disk and serve them through a server such as Nginx or via the static file middleware that ships with rails `config.public_file_server.enabled = true`.
This patch mitigates the issue, but explicitly disallowing any requests to uri resources via the server.
0 commit comments