Skip to content

fix(deps): upgrade ai to 5.0.52 to patch CVE-2025-48985 (filetype whitelist bypass)#156

Merged
sanjaychelliah merged 2 commits intomainfrom
copilot/update-vercel-ai-sdk-to-5052
May 5, 2026
Merged

fix(deps): upgrade ai to 5.0.52 to patch CVE-2025-48985 (filetype whitelist bypass)#156
sanjaychelliah merged 2 commits intomainfrom
copilot/update-vercel-ai-sdk-to-5052

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

CVE-2025-48985 / GHSA-rwvc-j5jr-mgvh: Vercel AI SDK allowed users to bypass filetype whitelists when uploading files. Fixed in ai@5.0.52.

Changes

  • ai: ^4.3.16^5.0.52 — patched version
  • @ai-sdk/openai-compatible: ^0.2.14^1.0.39 — required companion bump; v0.x depends on @ai-sdk/provider@1.x, while ai@5.x requires @ai-sdk/provider@2.x. All existing APIs (generateText, streamText, tool, createOpenAICompatible) remain available unchanged.

Reachability

Not reachable (medium confidence). None of the example files use file upload APIs — only text-based generateText/streamText calls are made. This update is primarily to clear the vulnerability scanner rather than address an active risk.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.npmjs.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details the Dependabot vulnerability alert you should resolve

<alert_title>Vercel’s AI SDK's filetype whitelists can be bypassed when uploading files</alert_title>
<alert_description>A vulnerability in Vercel’s AI SDK has been fixed in versions 5.0.52, 5.1.0-beta.9, and 6.0.0-beta. This issue may have allowed users to bypass filetype whitelists when uploading files. All users are encouraged to upgrade.</alert_description>

low
GHSA-rwvc-j5jr-mgvh, CVE-2025-48985
ai
npm
<vulnerable_versions>^4.3.16</vulnerable_versions>
<patched_version>5.0.52</patched_version>
<manifest_path>nodejs/vercel-ai-sdk/package.json</manifest_path>

https://nvd.nist.gov/vuln/detail/CVE-2025-48985 https://github.com/vercel/ai/commit/930399bb9839a8baf3d349614106d78268775eed https://vercel.com/changelog/cve-2025-48985-input-validation-bypass-on-ai-sdk https://github.com/vercel/ai/issues/8881 https://github.com/advisories/GHSA-rwvc-j5jr-mgvh

<task_instructions>Resolve this alert by updating the affected package to a non-vulnerable version. Prefer the lowest non-vulnerable version (see the patched_version field above) over the latest to minimize breaking changes. Include a Reachability Assessment section in the PR description. Review the alert_description field to understand which APIs, features, or configurations are affected, then search the codebase for usage of those specific items. If the vulnerable code path is reachable, explain how (which files, APIs, or call sites use the affected functionality) and note that the codebase is actively exposed to this vulnerability. If the vulnerable code path is not reachable, explain why (e.g. the affected API is never called, the vulnerable configuration is not used) and note that the update is primarily to satisfy vulnerability scanners rather than to address an active risk. If the advisory is too vague to determine reachability (e.g. 'improper input validation' with no specific API named), state that reachability could not be determined and explain why. Include a confidence level in the reachability assessment (e.g. high confidence if the advisory names a specific API and you confirmed it is or is not called, low confidence if the usage is indirect and hard to trace). If no patched version is available, check the alert_description field for a Workarounds section — the advisory may describe configuration changes or usage patterns that mitigate the vulnerability without a version update. If a workaround is available, apply it and leave a code comment referencing the advisory identifier explaining it is a temporary mitigation. If neither a patch nor a workaround is available, explain in the PR description why the alert cannot be resolved automatically so a human reviewer can take over. Inspect the repository to determine which package manager is used (e.g. lock files, config files, build scripts) and use that tooling to perform the update — do not edit lock files directly. If the version constraint in the manifest (e.g. package.json, Gemfile, pyproject.toml) caps the version below the fix, update the constraint first. For transitive dependencies, determine whether it is simpler to update the direct dependency that pulls in the vulnerable package or to update the transitive dependency directly, and choose the least disruptive approach. If upgrading to fix the vulnerability forces a major version bump or known breaking changes, review the changelog or release notes, then audit the codebase for usage of affected APIs and fix any breaking changes that are found. If the package manager fails to resolve dependencies (e.g. peer dependency conflicts, incompatible engine constraints), document the error in the PR description rather than attempting increasingly complex workarounds. After updating, check the lock file to confirm the package no longer resolves to a version in the vulnerable range. Keep changes minimal and tightly scoped. Ensure tests, build, type checking, and linting all pass after your changes. If there are any test, lint, or typechecking failures, investigate whether they are caused by the update and fix them if so — do not leave broken tests in the PR. If they were already present before the update, note them in the PR description so a human reviewer can assess whether they are related.</task_instructions>

  • Resolves Clarifai/examples alert #171

Copilot AI self-assigned this May 5, 2026
Copilot AI review requested due to automatic review settings May 5, 2026 15:57
Copilot AI review requested due to automatic review settings May 5, 2026 15:57
Copilot AI requested review from Copilot and removed request for Copilot May 5, 2026 16:01
Copilot AI changed the title [WIP] Update Vercel's AI SDK to fix filetype whitelists bypass vulnerability fix(deps): upgrade ai to 5.0.52 to patch CVE-2025-48985 (filetype whitelist bypass) May 5, 2026
Copilot AI requested a review from sanjaychelliah May 5, 2026 16:03
@sanjaychelliah sanjaychelliah marked this pull request as ready for review May 5, 2026 16:07
Copilot AI review requested due to automatic review settings May 5, 2026 16:07
@sanjaychelliah sanjaychelliah merged commit 1a903f0 into main May 5, 2026
5 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the Node.js Vercel AI SDK example’s dependencies to patched versions to address CVE-2025-48985 / GHSA-rwvc-j5jr-mgvh in ai, which could allow bypassing filetype whitelists during file uploads.

Changes:

  • Bump ai from ^4.3.16 to ^5.0.52 (patched version).
  • Bump @ai-sdk/openai-compatible from ^0.2.14 to ^1.0.39 to align with the ai@5 provider dependency chain.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -11,8 +11,8 @@
"author": "",
"license": "ISC",
"dependencies": {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants