Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') Affecting envapi package, versions <0.2.3


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.05% (13th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-ENVAPI-8687915
  • published4 Feb 2025
  • disclosed3 Feb 2025
  • creditTakeshi Kaneko

Introduced: 3 Feb 2025

CVE-2025-24959  (opens in a new tab)
CWE-74  (opens in a new tab)

How to fix?

Upgrade envapi to version 0.2.3 or higher.

Overview

envapi is an An API to interact with environment files

Affected versions of this package are vulnerable to Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') through the dotenv.stringify process. An attacker can manipulate the execution of commands or alter application behavior by injecting malicious environment variables.

Note:

This is only exploitable if applications process untrusted input and pass it through dotenv.stringify.

Workaround

This vulnerability can be mitigated by sanitizing user-controlled environment variable values before passing them to dotenv.stringify. Specifically, avoid using ", ', and backticks in values, or enforce strict validation of environment variables before usage.

CVSS Base Scores

version 4.0
version 3.1