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
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
More blogs

CVE-2025-55182: Remote Code Execution in React Server Components
On December 3, 2025, the React and Vercel teams disclosed CVE-2025-55182, a critical remote-code-execution (RCE) vulnerability (CVSS 10) affecting React Server Components (RSC) as used in the Flight protocol implementation.
Shai Hulud 2.0: What We Know About the Ongoing NPM Supply Chain Attack
A new wave of supply chain compromise is unfolding across the open-source ecosystem. Multiple security vendors, including Aikido Security and Wiz have confirmed that the threat actor behind the earlier Shai Hulud malware campaign has resurfaced. This time, compromising NPM accounts, GitHub repositories and widely-used packages associated with Zapier and the ENS (Ethereum Name Service).
Remediation That Meets Developers in Context
Identifying issues isn’t the challenge. The challenge is effective remediation that fits your codebase, your environment and your team’s development velocity. Developers need to understand where issues originated, which packages to upgrade, what code to change and how disruptive fixes will be. Meanwhile, AppSec needs visibility into what's immediately actionable and which issues require cross-team coordination.
A Primer on Runtime Intelligence
See how Kodem's cutting-edge sensor technology revolutionizes application monitoring at the kernel level.
Platform Overview Video
Watch our short platform overview video to see how Kodem discovers real security risks in your code at runtime.
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.
.png)
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.

Stay up-to-date on Audit Nexus
A curated resource for the many updates to cybersecurity and AI risk regulations, frameworks, and standards.
