Skip to content

Conversation

@georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Dec 20, 2025

Description

This PR upgrades Storybook from version 9.0.17 to 9.1.17 to address a critical security vulnerability (CVE) in Storybook's environment variable handling. The vulnerability could lead to .env file contents being unexpectedly bundled into publicly accessible build artifacts. This security patch is recommended for all Storybook 7+ users.

Additionally, this PR adds @storybook/* and storybook packages to the npmPreapprovedPackages list in .yarnrc.yml to bypass the 3-day minimum age gate for critical security patches, allowing the project to quickly adopt security fixes.

Key changes:

  • Upgraded all Storybook packages from 9.0.17 → 9.1.17
  • Added Storybook packages to npm preapproved list for faster security patch adoption
  • Verified build process works correctly with the new version

Reference: https://storybook.js.org/blog/security-advisory/

Related issues

Fixes: N/A (Security patch - proactive upgrade)

Manual testing steps

  1. Pull the branch and run yarn install
  2. Start the Storybook development server:
    yarn storybook
  3. Verify Storybook loads correctly on http://localhost:6006
  4. Navigate through various component stories to ensure functionality
  5. Build Storybook for production:
    yarn workspace @metamask/storybook-react build-storybook
  6. Verify the build completes successfully without errors
  7. Check that all components render correctly in the built version

Screenshots/Recordings

N/A - Infrastructure/security update with no visual changes

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs
  • I've completed the PR template to the best of my ability
  • I've included tests if applicable (build test performed)
  • I've documented my code using JSDoc format if applicable (not applicable - configuration change)
  • I've applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Upgrades all Storybook packages to 9.1.17 and adds Storybook to Yarn's npmPreapprovedPackages age-gate bypass.

  • Dependencies:
    • Bump Storybook packages from 9.0.179.1.17 in apps/storybook-react and packages/{design-system-react,design-tokens} (@storybook/react, @storybook/react-vite, @storybook/addon-*, and storybook).
  • Tooling/Config:
    • Add @storybook/* and storybook to .yarnrc.yml npmPreapprovedPackages to bypass the minimal age gate.

Written by Cursor Bugbot for commit 07232ba. This will update automatically on new commits. Configure here.

Upgrades Storybook from 9.0.17 to 9.1.17 to address CVE regarding
environment variable leakage in build artifacts. Also adds @storybook/*
packages to npmPreapprovedPackages to bypass the 3-day age gate for
critical security patches.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@socket-security
Copy link

socket-security bot commented Dec 20, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​storybook/​react-vite@​9.0.17 ⏵ 9.1.179910072 +2100 +1100
Updated@​storybook/​react@​9.0.17 ⏵ 9.1.179810073 +1100 +1100
Updated@​storybook/​addon-vitest@​9.0.17 ⏵ 9.1.179910074 +1100 +1100
Updated@​storybook/​addon-a11y@​9.0.17 ⏵ 9.1.1710010076 +1100 +1100
Updatedstorybook@​9.0.17 ⏵ 9.1.1799100 +1689 -2100 +1100
Updated@​storybook/​addon-docs@​9.0.17 ⏵ 9.1.1799 +110099 +1100 +1100

View full report

@socket-security
Copy link

socket-security bot commented Dec 20, 2025

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Action Severity Alert  (click "▶" to expand/collapse)
Warn Low
Potential code anomaly (AI signal): npm @storybook/react is 100.0% likely to have a medium risk anomaly

Notes: Overall, the fragment does not display active malware or exfiltration, but its nature as a bundled parser/Storybook tooling suite with dynamic imports presents medium supply-chain risk. Recommend rigorous dependency integrity checks, restrict/monitor dynamic imports in production, and audit the full dependency tree for tampered or compromised versions.

Confidence: 1.00

Severity: 0.60

From: apps/storybook-react/package.jsonnpm/@storybook/react@9.1.17

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@storybook/react@9.1.17. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@georgewrmarshall georgewrmarshall self-assigned this Dec 20, 2025
@github-actions
Copy link
Contributor

📖 Storybook Preview

Updates @storybook/react from 9.0.17 to 9.1.17 in design-system-react
and design-tokens packages to maintain version consistency across the
monorepo and satisfy yarn constraints.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Contributor

📖 Storybook Preview

@georgewrmarshall georgewrmarshall marked this pull request as ready for review December 20, 2025 00:25
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner December 20, 2025 00:25
@brianacnguyen brianacnguyen merged commit ddc4796 into main Dec 22, 2025
42 checks passed
@brianacnguyen brianacnguyen deleted the fix-storybook-cve branch December 22, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants