Incorrect Behavior Order Affecting ai package, versions <5.0.52>=5.1.0-beta.0 <5.1.0-beta.9


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.04% (13th percentile)

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 IDSNYK-JS-AI-13863465
  • published9 Nov 2025
  • disclosed7 Nov 2025
  • creditaphantom

Introduced: 7 Nov 2025

NewCVE-2025-48985  (opens in a new tab)
CWE-696  (opens in a new tab)

How to fix?

Upgrade ai to version 5.0.52, 5.1.0-beta.9 or higher.

Overview

ai is an AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript

Affected versions of this package are vulnerable to Incorrect Behavior Order via the downloadAssets function. An attacker can upload files with disallowed types by substituting arbitrary downloaded bytes for different supported URLs within the same prompt, thereby bypassing the URL and filetype whitelisting.

Workaround

Implementing custom file type validation logic outside of the SDK.

CVSS Base Scores

version 4.0
version 3.1