HerokuRichard SchneemanIncident / postmortem
Rails Asset Pipeline Directory Traversal Vulnerability (CVE-2018-3760)
Summary
All previously released versions of Sprockets, which powers the Rails asset pipeline, contained a directory traversal vulnerability, CVE-2018-3760. Rails applications were vulnerable when production runtime asset compilation was enabled with config.assets.compile = true; the default production setting was false, so apps using the default were not vulnerable. Sprockets handled requests by searching for rendered assets and compiling matches dynamically, and an attacker could exploit that process with a crafted URL based on a known absolute source-asset path to make it appear inside a permitted path. Patches were prepared for Sprockets versions 2, 3, and 4, with remediation via disabling runtime compilation or upgrading to versions 2.12.5, 3.7.2, or 4.0.0.beta8. Heroku also updated its Ruby Buildpack to fail affected builds, notified customers, and warned that compromised applications may require credential rotation.
Context
Sprockets contained a directory traversal vulnerability affecting Rails applications that enabled runtime asset compilation in production. If an application was targeted, secrets in its repository or environment variables may have been compromised.
Approach / What changed
The remediation was to disable config.assets.compile or upgrade Sprockets to a patched release. Patches covered Sprockets versions 2, 3, and 4; Heroku also updated the Ruby Buildpack to fail builds using runtime asset compilation with affected Sprockets versions and contacted potentially affected customers.
Takeaways
Applications with config.assets.compile = true in production were vulnerable; Rails production environments defaulted this setting to false.
Sprockets versions 2.12.5, 3.7.2, and 4.0.0.beta8 were identified as patched release targets.
A targeted application may have exposed repository secrets or environment variables, prompting precautionary rotation of database and other credentials.
Source and freshness
- Source
- heroku.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.