High, CVSS 7.5RubyGemsAmendedPublished
Shakapacker has environment variable leak via EnvironmentPlugin that exposes secrets to client-side bundles
GHSA-96qw-h329-v5rg
- Affected
- RubyGems shakapacker < 9.5.0
- Fixed in
- 9.5.0· Vendor fix available
- Issue
- Since 2017, the default webpack plugins have passed the entire process.env to EnvironmentPlugin. This pattern exposed ALL build environment variables to client-side JavaScript bundles whenever application code (or any dependency) referenced process.env.VARIABLENAME. This is not a regression - the vulnerable code has existed since the original Webpacker implementation. No recent code change in Shakapacker triggered this issue. Impact Any environment variable in the build environment that is referenced in client-side code (including third-party dependencies) is embedded directly into the JavaScript bundle. This includes: - DATABASEURL - Database credentials - AWSSECRETACCESSKEY - AWS credentials - RAILSMASTERKEY - Rails encrypted credentials key - STRIPESECRETKEY, TWILIOAUTHTOKEN - Third-party API keys - Any other secrets present in the build environment Severity: Critical - secrets are exposed in publicly accessible JavaScript files. Root Cause The original code used: This…
Recommended action: Upgrade to 9.5.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.