Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') Affecting bun package, versions *


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept

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 Learn

Learn about Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-BUN-9510752
  • published22 Jul 2025
  • disclosed23 Mar 2025
  • creditLiran Tal

Introduced: 23 Mar 2025

CVE-2025-8022  (opens in a new tab)
CWE-78  (opens in a new tab)
First added by Snyk

How to fix?

There is no fixed version for bun.

Overview

Affected versions of this package are vulnerable to Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in the $ shell API due to improper neutralization of user input. An attacker can exploit this by providing specially crafted input that includes command-line arguments or shell metacharacters, leading to unintended command execution.

PoC

import { $ } from "bun";

const userRepository = `--upload-pack=env>hello;`;
const refs = await $`git ls-remote ${userRepository} main`.text();

References

CVSS Base Scores

version 4.0
version 3.1