Vercel AI SDK, OpenAI SDK, and Anthropic SDK Security Issues in JavaScript and TypeScript


Introduction
SDKs from Vercel, OpenAI, and Anthropic are widely used to embed AI functionality into JavaScript and TypeScript applications. They simplify model calls, but they also expand the attack surface. Application security issues range from credential exposure to unvalidated model outputs influencing downstream execution.
API Key Exposure
All three SDKs require API keys. Developers often hardcode them in client-side code for rapid prototyping. In production, this results in exposed credentials visible in browser developer tools. Attackers can use these stolen keys to run model queries on behalf of the victim, leading to resource abuse or data leakage. In 2023, multiple GitHub repositories were found leaking OpenAI API keys embedded directly in Next.js applications.
Unvalidated Model Output
SDKs often connect LLM responses directly into application logic. For example, a Vercel AI SDK application allowed users to query a model and receive executable SQL queries as output. An attacker injected a crafted prompt to generate a destructive SQL DROP TABLE
command, which was then executed because the developer failed to validate the model output.
Insecure Token Scopes
The Anthropic SDK, like its peers, relies on scoped tokens for enterprise deployments. Misconfigured tokens that grant excessive rights can be abused if leaked. A token intended for testing can end up with production-level privileges.
MITRE ATT&CK Mapping
Conclusion
AI SDKs are not secure by default. Hardcoded credentials, over-scoped tokens, and unvalidated model outputs introduce direct application-layer risks. Security teams must enforce secret management, validate model outputs before execution, and apply least-privilege principles to API tokens.
References
- GitGuardian. (2023). API key leaks in GitHub repositories. GitGuardian Blog. https://blog.gitguardian.com/api-key-leaks/
- MITRE ATT&CK®. (2024). ATT&CK Techniques. MITRE. https://attack.mitre.org/
More blogs

Malicious Packages Alert: The Qix npm Supply-Chain Attack: Lessons for the Ecosystem
The npm ecosystem is in the middle of a major supply-chain compromise. The maintainer known as Qix is currently targeted in a phishing campaign that allows attackers to bypass two-factor authentication and take over their npm account. This is happening right now, and malicious versions of widely used libraries are being published and distributed.

Security Issues in popular AI Runtimes - Node.js, Deno, and Bun
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.

Application Security Issues in AI Edge and Serverless Runtimes: AWS Lambda, Vercel Edge Functions, and Cloudflare Workers
AI workloads are increasingly deployed on serverless runtimes like AWS Lambda, Vercel Edge Functions, and Cloudflare Workers. These platforms reduce operational overhead but introduce new application-layer risks. Product security teams must recognize that serverless runtimes are not inherently safer—they simply shift the attack surface.
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.