CVE-2025-48985

3.7 LOW

📋 TL;DR

This vulnerability in Vercel's AI SDK allows users to bypass filetype whitelists when uploading files, potentially enabling malicious file uploads. It affects all users of vulnerable versions of the AI SDK. The issue has been fixed in patched versions.

💻 Affected Systems

Products:
  • Vercel AI SDK
Versions: Versions before 5.0.52, 5.1.0-beta.9, and 6.0.0-beta
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects applications using the AI SDK's file upload functionality with whitelist restrictions.

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could upload malicious files (e.g., scripts, malware) that bypass security controls, potentially leading to remote code execution or data compromise.

🟠

Likely Case

Unauthorized file uploads that bypass intended restrictions, potentially enabling file-based attacks or data exfiltration.

🟢

If Mitigated

With proper input validation and file handling controls, impact is limited to potential file storage issues.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires user interaction to upload files, but bypass technique is straightforward once discovered.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 5.0.52, 5.1.0-beta.9, or 6.0.0-beta

Vendor Advisory: https://vercel.com/changelog/cve-2025-48985-input-validation-bypass-on-ai-sdk

Restart Required: No

Instructions:

1. Update package.json to use patched version. 2. Run npm update @ai-sdk/react or equivalent for your framework. 3. Test file upload functionality.

🔧 Temporary Workarounds

Implement server-side file validation

all

Add additional file validation on the server side before processing uploaded files

Restrict file upload endpoints

all

Limit access to file upload endpoints through authentication and authorization controls

🧯 If You Can't Patch

  • Implement strict server-side file type validation independent of SDK
  • Monitor file upload endpoints for suspicious activity and implement rate limiting

🔍 How to Verify

Check if Vulnerable:

Check package.json for @ai-sdk/react version. If version is below 5.0.52, 5.1.0-beta.9, or 6.0.0-beta, you are vulnerable.

Check Version:

npm list @ai-sdk/react

Verify Fix Applied:

Verify the installed version is 5.0.52 or higher, or the beta versions specified. Test file upload with various file types to ensure whitelist enforcement works.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected file types being uploaded
  • File upload attempts with unusual extensions or MIME types
  • Failed file validation events

Network Indicators:

  • HTTP POST requests to file upload endpoints with unusual content-types
  • Large number of file upload attempts

SIEM Query:

source="web_server" AND (url_path="*/upload*" OR url_path="*/file*") AND (http_method="POST" OR http_method="PUT") AND NOT content_type IN ["image/jpeg", "image/png", "application/pdf"]

🔗 References

📤 Share & Export