GHSA-96qw-h329-v5rg — Vulnerability in shakapacker — Advisory Details
Shakapacker has environment variable leak via EnvironmentPlugin that exposes secrets to client-side bundles
Does your project use an affected shakapacker version?
Paste your package-lock.json to check it for GHSA-96qw-h329-v5rg and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
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.VARIABLE_NAME.
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:
DATABASE_URL- Database credentialsAWS_SECRET_ACCESS_KEY- AWS credentialsRAILS_MASTER_KEY- Rails encrypted credentials keySTRIPE_SECRET_KEY,TWILIO_AUTH_TOKEN- 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:
new webpack.EnvironmentPlugin(process.env)
This makes every environment variable available for substitution. If any code references process.env.SECRET_KEY, that value is embedded in the bundle.
Patches
Upgrade to version 9.5.0 or later, which uses an allowlist approach that only exposes NODE_ENV, RAILS_ENV, and WEBPACK_SERVE by default.
Workarounds
If developers cannot upgrade immediately:
- Audit client-side code and dependencies for any
process.env.Xreferences to sensitive variables - Remove sensitive variables from the build environment
- Override the default plugins with a custom webpack/rspack config using an explicit allowlist
Migration
After upgrading, if client-side code needs access to specific environment variables:
Option 1: Use the SHAKAPACKER_PUBLIC_ prefix (recommended)
# Variables with this prefix are automatically exposed
export SHAKAPACKER_PUBLIC_API_URL="https://api.example.com"
Option 2: Use SHAKAPACKER_ENV_VARS
SHAKAPACKER_ENV_VARS=API_URL,FEATURE_FLAG bundle exec rails assets:precompile
Action Required
After upgrading, rotate any secrets that may have been exposed in previously compiled JavaScript bundles.
Resources
Advisory Timeline
- First published January 8, 2026 (322 days ago).
- Last revised February 3, 2026 — 25 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
npm install shakapacker@9.5.0
gem install shakapacker -v 9.5.0
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 2 ecosystems: npm (1), RubyGems (1).
| Package | Fixed In |
|---|---|
| shakapacker npm · Affected: All versions | 9.5.0 |
| shakapacker RubyGems · Affected: 6.0.0, 6.0.0.rc.12, 6.0.0.rc.13, 6.0.0.rc.14 (+73 more) | 9.5.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-200Information ExposureMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
References
Frequently Asked Questions
- What is GHSA-96qw-h329-v5rg?
- Shakapacker has environment variable leak via EnvironmentPlugin that exposes secrets to client-side bundles. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by GHSA-96qw-h329-v5rg?
- GHSA-96qw-h329-v5rg affects shakapacker. Use GeekWala's free vulnerability scanner to check your dependencies against GHSA-96qw-h329-v5rg and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
Related CVEs
- CVE-2026-83816HIGH
CodeWhale: exec_shell parallel-readonly classifier auto-approves fd/rg/git grep exec flags enabling silent RCE
- CVE-2026-83817HIGH
CodeWhale: Automation auto_approve defaults to true, bypassing the task-path hardening fix for silent recurring agent execution