Security Issues in popular AI Runtimes - Node.js, Deno, and Bun

This series shows how vulnerabilities propagate through the stack and provides a framework for defending AI applications in production.

September 8, 2025
September 8, 2025

0 min read

Application Security
Security Issues in popular AI Runtimes - Node.js, Deno, and Bun

Introduction

Node.js, Deno, and Bun are the primary runtimes for executing JavaScript and TypeScript in modern applications. They form the backbone of AI backends, serverless deployments, and orchestration layers. Each runtime introduces distinct application security issues. For product security teams, understanding these runtime weaknesses is essential because attacks often bypass framework-level defenses and exploit the runtime directly.

Node.js: Prototype Pollution and Module Injection

Node.js powers most enterprise AI backends. Prototype pollution remains one of the most common attack vectors. Vulnerable libraries such as Lodash (CVE-2019-10744) allow attackers to inject malicious properties into global objects. This leads to privilege escalation inside runtime processes.

Module injection is another major risk. Applications that use require() with unvalidated paths can be tricked into loading malicious modules. In one real incident, an attacker poisoned the npm registry with a typosquatted package (expres instead of express), leading Node.js applications to load a backdoored module that exfiltrated environment variables.

Deno: Permission Model Misuse

Deno was designed with a stricter permission model than Node.js. Developers must explicitly grant file, network, or environment variable access. In practice, many teams disable these controls with the --allow-all flag for convenience. This reintroduces Node.js–style risks and undermines Deno’s security design. In test deployments, attackers exploited over-permissive Deno configurations to access local files containing API keys.

Bun: Immature Ecosystem and WASM Risks

Bun is the newest runtime and aims to outperform Node.js and Deno. Its ecosystem is immature, which means fewer security audits and less hardened libraries. Bun also integrates deeply with WebAssembly (WASM). Exploits in WASM runtimes have demonstrated sandbox escapes, enabling arbitrary code execution. In one proof-of-concept, malformed WASM payloads in Bun caused memory corruption, highlighting the risks of relying on an immature runtime for production AI workloads.

MITRE ATT&CK Mapping

Runtime Threat Vector MITRE Technique(s) Example
Node.js Prototype pollution T1565 – Data Manipulation Lodash CVE-2019-10744 used to overwrite object properties
Node.js Module injection T1195 – Supply Chain Compromise expres typosquatting package stealing environment variables
Deno Over-permissive flags T1552 – Unsecured Credentials --allow-all enabled, exposing local API key files
Bun WASM sandbox escape T1203 – Exploitation for Client Execution Malformed WASM payload causing memory corruption

Conclusion

Node.js, Deno, and Bun are powerful but not secure by default. Node.js remains vulnerable to prototype pollution and module injection. Deno’s permission system is often bypassed through developer misconfiguration. Bun introduces WASM-specific risks and suffers from ecosystem immaturity. For product security teams, runtime-level defenses such as strict configuration policies, dependency validation, and runtime anomaly monitoring are critical to securing AI applications.

References

  • npm, Inc. (2018). event-stream incident report. npm Blog. https://blog.npmjs.org/post/180565383195/details-about-the-event-stream-incident
  • OWASP. (2021). JavaScript prototype pollution. OWASP Foundation. https://owasp.org/www-community/vulnerabilities/Prototype_Pollution
  • MITRE ATT&CK®. (2024). ATT&CK Techniques. MITRE. https://attack.mitre.org/
  • SecurityWeek. (2022, July 5). New vulnerabilities found in WebAssembly runtimes. SecurityWeek. https://www.securityweek.com
Table of contents

Related blogs

Top 5 Malicious Package Detection Tools in 2026

Top 5 Malicious Package Detection Tools in 2026

Malicious package detection is not CVE scanning. Five tools compared on detection latency, ecosystem tiering, and whether they block or only alert.

September 11, 2026

14

Top 5 AI SAST Tools in 2026

Top 5 AI SAST Tools in 2026

AI SAST tools promise less noise and automatic fixes. Five tools compared on the six criteria that matter, and what the independent research shows.

September 11, 2026

15

Reachability Predicts. Runtime Proves.

Reachability Predicts. Runtime Proves.

Reachability tells you code can execute. Runtime tells you it did.

July 20, 2026

7

Stop the waste.
Protect your environment with Kodem.

A Primer on Runtime Intelligence

See how Kodem reads what actually loads and executes in your running applications, and why that changes which findings matter.

See the Kodem platform

Kodem shows which vulnerabilities actually load and execute in your running applications, so your team works the risk that is real.

The State of the Application Security Workflow

This report aims to equip readers with actionable insights that can help future-proof their security programs. Kodem, the publisher of this report, purpose built a platform that bridges these gaps by unifying shift-left strategies with runtime monitoring and protection.

3D book mockup of Kodem's State of the Application Security Workflow 2025 report

Get real-time insights across the full stack…code, containers, OS, and memory

Watch how Kodem’s runtime security platform detects and blocks attacks before they cause damage. No guesswork. Just precise, automated protection.

Kodem issues list with a magnified view of insight icons: runtime, ingress, and exploitability
Combined author
Mahesh Babu
Publish date

0 min read

Application Security