CVE-2022-39382CWE-74

NODE_ENV in Keystone defaults to development with esbuild

Critical · published November 3, 2022

CVSS v3.1
9.8
EPSS
2%
Percentile
76.4
In the wild
Unconfirmed
What it is

🔥 If you’re using `@keystone-6/[email protected]` or `3.0.1`, you might want to check your security settings! This vulnerability lets developers unintentionally expose their applications to risk by mismanaging `NODE_ENV`. Think of it like a restaurant that uses a ‘busy night’ sign to switch to a more security-conscious menu. If that sign accidentally gets flipped to ‘quiet night’ during a rush, all sorts of unauthorized dishes could slip into the orders made by patrons! An attacker could exploit this oversight, triggering security-sensitive features in development mode instead of production. This could lead to insecure configurations, placing your user data at risk. In a worst-case scenario, it might allow attackers to manipulate application behavior, seriously jeopardizing your security posture!

Put simply

Think of it like a restaurant that uses a ‘busy night’ sign to switch to a more security-conscious menu. If that sign accidentally gets flipped to ‘quiet night’ during a rush, all sorts of unauthorized dishes could slip into the orders made by patrons! This vulnerability arises because `NODE_ENV` is inlined incorrectly to ‘development’ in certain environments, overriding intended security settings. Users relying on this variable to control security-sensitive functionality could thus face potential exposure in their applications.

What to do

An attacker could exploit this oversight, triggering security-sensitive features in development mode instead of production. This could lead to insecure configurations, placing your user data at risk. In a worst-case scenario, it might allow attackers to manipulate application behavior, seriously jeopardizing your security posture! To mitigate this vulnerability, immediately upgrade to `@keystone-6/[email protected]` or higher. Review your environment configurations to ensure that `NODE_ENV` is set correctly in your deployment environments, and consider implementing additional checks in your user code. You’ve got this! By taking these steps, you can restore your application's security and maintain your superhero status in the digital world! 🦸‍♂️

The record
Technical detail
CVSS v3.1
9.8 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.01653 · 76.4th percentile
Weakness
CWE-74 · Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Published
2022-11-03T00:00Z
EPSS history
Timeline
  • 03 NOV 00:00Z
    NODE_ENV in Keystone defaults to development with esbuild
    cvelistv5