Skip to main content

Improper Control of Generation of Code ('Code Injection')

CVE-2024-21892

Severity High
Score 7.8/10

Summary

On Linux, Node.js ignores certain environment variables if they may have been set by an unprivileged user while the process is running with elevated privileges, with the exception of "CAP_NET_BIND_SERVICE". Due to a bug in the implementation of this exception, Node.js incorrectly applies it even when certain other capabilities are set. This allows unprivileged users to inject code that inherits the process's elevated privileges. The vulnerability affects NodeJS versions through v18.19.0, v19.0.0 through v20.11.0, v21.0.0 through v21.6.1.

  • LOW
  • LOCAL
  • HIGH
  • UNCHANGED
  • NONE
  • LOW
  • HIGH
  • HIGH

CWE-94 - Code Injection

Code injection is a type of vulnerability that allows an attacker to execute arbitrary code. This vulnerability fully compromises the machine and can cause a wide variety of security issues, such as unauthorized access to sensitive information, manipulation of data, denial of service attacks etc. Code injection is different from command injection in the fact that it is limited by the functionality of the injected language (e.g. PHP), as opposed to command injection, which leverages existing code to execute commands, usually within the context of a shell.

Advisory Timeline

  • Published