# CVE-2022-39382: KeystoneJS @keystone-6/core incorrect NODE_ENV inlining via esbuild

Source: https://junglewise.ai/threats/cve-2022-39382-keystonejs-keystone-6-core-incorrect-node-env-inlining-via  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-11-03. Updated: 2026-05-13  
License: CC BY 4.0 with a link back

CVE-2022-39382 · Severity: low · CVSS 3.1 · Published 2022-11-03

KeystoneJS is a headless content management system (CMS) used to manage website data and APIs. A configuration issue in certain versions causes the system to incorrectly identify itself as being in a 'development' mode even when deployed in a 'production' environment. This could lead to the accidental exposure of sensitive debugging information or the bypass of security checks that are only active in production mode.

Technologies: [KeystoneJS](https://junglewise.ai/threats/technologies/keystone-5), [@keystone-6/core (npm)](https://junglewise.ai/threats/technologies/keystone-6-core). Vendors: [KeystoneJS](https://junglewise.ai/threats/vendors/keystonejs), [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2022-39382 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2022-39382 being exploited in the wild.

**How severe is CVE-2022-39382?** Low severity, with a CVSS score of 3.1, published 3 November 2022.

**Which products and versions are affected?** KeystoneJS 3.0.0, 3.0.1; @keystone-6/core (npm) SEMVER:introduced=3.0.0,fixed=3.0.2.

**Is there a fix for CVE-2022-39382?** Yes. @keystone-6/core (npm): upgrade to 3.0.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2022-39382 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2022-39382?** Check whether you run KeystoneJS or @keystone-6/core (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- @keystone-6/core (npm): upgrade to 3.0.2 or later

  ```sh
  npm install @keystone-6/core@3.0.2
  ```


## Technical details

A vulnerability exists in @keystone-6/core versions 3.0.0 and 3.0.1 where the build process, utilizing esbuild, defaults the NODE_ENV environment variable to 'development' because the platform configuration is undefined. This causes user-authored TypeScript code to have 'development' inlined as a constant, even in production builds. If developers use NODE_ENV checks to gate security-sensitive functionality (e.g., disabling authentication or enabling verbose error reporting in dev), those checks will fail to protect the production environment. This issue specifically affects user code rather than third-party dependencies in node_modules. The vulnerability is resolved in version 3.0.2 by correctly configuring the esbuild platform.

## Affected products

- KeystoneJS @keystone-6/core 3.0.0, 3.0.1

## Identifiers

- CVE-2022-39382
- GHSA-25mx-2mxm-6343

## Timeline

- 2022-10-23: patched: Fix merged in pull request 8031
- 2022-11-03: advisory: GitHub Advisory GHSA-25mx-2mxm-6343 published
- 2022-11-03: disclosed: CVE-2022-39382 published to NVD

## References

- [https://github.com/keystonejs/keystone/security/advisories/GHSA-25mx-2mxm-6343](https://github.com/keystonejs/keystone/security/advisories/GHSA-25mx-2mxm-6343)
- [https://github.com/keystonejs/keystone/pull/8031](https://github.com/keystonejs/keystone/pull/8031)
- [https://github.com/keystonejs/keystone/pull/8063](https://github.com/keystonejs/keystone/pull/8063)
- [https://github.com/keystonejs/keystone](https://github.com/keystonejs/keystone)

## Related threats

- [Keystone GraphQL maxTake bypass with negative values](https://junglewise.ai/threats/cve-2026-63421-keystone-graphql-maxtake-bypass-with-negative-values)
- [KeystoneJS Denial of Service via Unbounded GraphQL Query Depth](https://junglewise.ai/threats/cve-2026-10802-keystonejs-denial-of-service-via-unbounded-graphql-query-depth)
- [KeystoneJS @keystone-6/core authorization bypass in findMany cursor parameter](https://junglewise.ai/threats/cve-2026-33326-keystonejs-keystone-6-core-authorization-bypass-in-findmany)
- [Keystone isFilterable bypass in update and delete mutations](https://junglewise.ai/threats/cve-2025-46720-keystone-isfilterable-bypass-in-update-and-delete-mutations)
- [Keystone @keystone-6/core unauthorized adminMeta GraphQL access](https://junglewise.ai/threats/cve-2023-40027-keystone-keystone-6-core-unauthorized-adminmeta-graphql-access)
