Intel

AIKIDO-2026-11000

ai is vulnerable to Prompt Injection

Prompt Injection Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Yesterday

64

Medium Risk

This Affects:

JSai
0.0.1 - 6.0.169
Fixed in 6.0.170
Are you affected? Scan for Free

TL;DR

The standardizePrompt helper in the ai package previously accepted system-role entries inside the caller-supplied messages and prompt arrays used by generateText, streamText, generateObject, streamObject, and streamUI. Applications that forward end-user input directly into those arrays let an attacker inject a system message that overrides the developer's system instructions. The pre-fix behavior accepted system messages silently with no warning or rejection. The fix introduces an allowSystemInMessages option that warns by default when system messages appear in those fields and lets the application explicitly opt in to throw InvalidPromptError or preserve the legacy permissive behavior.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

ai is vulnerable to Prompt Injection in versions 0.0.1 - 6.0.169.

How to fix this

Upgrade the ai library to the patch version.