Skip to content

Exposure of environment variables from .env in published Storybook

High
vanessayuenn published GHSA-8452-54wp-rmv6 Dec 17, 2025

Package

npm storybook (npm)

Affected versions

>7.0.0

Patched versions

7.6.21, 8.6.15, 9.1.17, 10.1.10

Description

On December 11th, the Storybook team received a responsible disclosure alerting us to a potential vulnerability in certain built and published Storybooks.

The vulnerability is a bug in how Storybook handles environment variables defined in a .env file, which could, in specific circumstances, lead to those variables being unexpectedly bundled into the artifacts created by the storybook build command. When a built Storybook is published to the web, the bundle’s source is viewable, thus potentially exposing those variables to anyone with access. If those variables contained secrets, they should be considered compromised.

No one has reported an exploited project to us. Once we learned of the vulnerability, we worked diligently to release patched versions and distribute a GitHub security advisory.

Who is impacted?

For a project to be vulnerable to this issue, it must:

  • Build the Storybook (i.e. run storybook build directly or indirectly) in a directory that contains a .env file (including variants like .env.local)
  • The .env file contains sensitive secrets
  • Use Storybook version 7.0.0 or above
  • Publish the built Storybook to the web

Storybooks built without a .env file at build time are not affected, including common CI-based builds where secrets are provided via platform environment variables rather than .env files.

Your Storybook runtime environments (i.e. storybook dev) are not affected. Your deployed applications that share a repo with your Storybook are not affected.

Storybook 6 and below is not affected.

Recommended actions

First, we are recommending that everyone audit for any sensitive secrets provided via .env files and rotate those keys.

Second, we have released patched versions of all affected major Storybook versions that no longer have this vulnerability. You should upgrade your Storybook—on both your local machines and CI environments—to one of these versions before publishing again.

  • 10.1.10+
  • 9.1.17+
  • 8.6.15+
  • 7.6.21+

Finally, some projects may have been relying on the undocumented behavior at the heart of this issue and will need to change how they reference environment variables after this update. If your project can no longer read necessary environmental variable values, you can either prefix the variables with STORYBOOK_ or use the env property in Storybook’s configuration to manually specify values. In either case, do not include sensitive secrets as they will be included in the built bundle.

Further information

Details of the vulnerability can be found on the Storybook announcement.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L

CVE ID

CVE-2025-68429

Weaknesses

Exposure of Sensitive Information to an Unauthorized Actor

The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. Learn more on MITRE.

Insertion of Sensitive Information into Externally-Accessible File or Directory

The product places sensitive information into files or directories that are accessible to actors who are allowed to have access to the files, but not to the sensitive information. Learn more on MITRE.

Inclusion of Sensitive Information in an Include File

If an include file source is accessible, the file can contain usernames and passwords, as well as sensitive information pertaining to the application and system. Learn more on MITRE.

Credits