Skip to content

Backport: fix: allow inline data URLs in download validation#13624

Merged
vercel-ai-sdk[bot] merged 3 commits intorelease-v6.0from
backport-pr-13376-to-release-v6.0
Apr 2, 2026
Merged

Backport: fix: allow inline data URLs in download validation#13624
vercel-ai-sdk[bot] merged 3 commits intorelease-v6.0from
backport-pr-13376-to-release-v6.0

Conversation

@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

@vercel-ai-sdk vercel-ai-sdk bot commented Mar 19, 2026

This is an automated backport of #13376 to the release-v6.0 branch. FYI @fahe1em1

## Summary
- allow `data:` URLs through `validateDownloadUrl` because they are
inline content, not network fetches
- keep the existing SSRF protections for `http:` and `https:` URLs
unchanged
- add tests covering both validator acceptance and `download()` support
for inline data URLs

## Testing
- `pnpm exec prettier --check
packages/provider-utils/src/validate-download-url.ts
packages/provider-utils/src/validate-download-url.test.ts
packages/ai/src/util/download/download.test.ts`
- `pnpm install --frozen-lockfile`
- Attempted package-local `vitest` runs, but the local workspace
currently fails to resolve some internal package entries before reaching
these tests under Node `v24.14.0`

## Why This Is Small And Safe
This only changes protocol handling for `data:` URLs, which are already
inline payloads and do not make outbound network requests. All existing
hostname and private-address SSRF checks still apply to real network
URLs.

Closes #13354.

Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
@vercel-ai-sdk vercel-ai-sdk bot enabled auto-merge (squash) March 19, 2026 14:51
@tigent tigent bot added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label bug Something isn't working as documented maintenance CI, internal documentation, automations, etc labels Mar 19, 2026
@hazemadelkhalel
Copy link
Copy Markdown

Hey @gr2m
Any update on when this will be published?

@hazemadelkhalel
Copy link
Copy Markdown

Hi @lgrammel @gr2m

Just a heads up on this PR. We're depending on this fix downstream, and it's currently blocking our work. Would appreciate a review when you get a chance. Thanks!

@gr2m
Copy link
Copy Markdown
Collaborator

gr2m commented Apr 2, 2026

sorry I totally missed this one! On it now

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gr2m gr2m added the backport Admins only: add this label to a pull request in order to backport it to the prior version label Apr 2, 2026
@vercel-ai-sdk vercel-ai-sdk bot merged commit 0469aed into release-v6.0 Apr 2, 2026
19 checks passed
@vercel-ai-sdk vercel-ai-sdk bot deleted the backport-pr-13376-to-release-v6.0 branch April 2, 2026 20:41
vercel-ai-sdk bot added a commit that referenced this pull request Apr 2, 2026
This is an automated backport of #13376 to the release-v6.0 branch. FYI
@fahe1em1

---------

Co-authored-by: fahe1em1 <131003503+fahe1em1@users.noreply.github.com>
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel-ai-sdk vercel-ai-sdk bot removed the backport Admins only: add this label to a pull request in order to backport it to the prior version label Apr 2, 2026
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor Author

vercel-ai-sdk bot commented Apr 2, 2026

✅ Backport PR created: #14077

vercel-ai-sdk bot added a commit that referenced this pull request Apr 2, 2026
#14077)

This is an automated backport of #13624 to the release-v5.0 branch. FYI
@vercel-ai-sdk[bot]

Co-authored-by: vercel-ai-sdk[bot] <225926702+vercel-ai-sdk[bot]@users.noreply.github.com>
Co-authored-by: fahe1em1 <131003503+fahe1em1@users.noreply.github.com>
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor Author

vercel-ai-sdk bot commented Apr 2, 2026

🚀 Published in:

Package Version
ai 6.0.144
@ai-sdk/alibaba 1.0.14
@ai-sdk/amazon-bedrock 4.0.89
@ai-sdk/angular 2.0.145
@ai-sdk/anthropic 3.0.66
@ai-sdk/assemblyai 2.0.27
@ai-sdk/azure 3.0.51
@ai-sdk/baseten 1.0.41
@ai-sdk/black-forest-labs 1.0.27
@ai-sdk/bytedance 1.0.7
@ai-sdk/cerebras 2.0.42
@ai-sdk/cohere 3.0.28
@ai-sdk/deepgram 2.0.27
@ai-sdk/deepinfra 2.0.42
@ai-sdk/deepseek 2.0.27
@ai-sdk/elevenlabs 2.0.27
@ai-sdk/fal 2.0.28
@ai-sdk/fireworks 2.0.43
@ai-sdk/gateway 3.0.86
@ai-sdk/gladia 2.0.27
@ai-sdk/google 3.0.56
@ai-sdk/google-vertex 4.0.100
@ai-sdk/groq 3.0.33
@ai-sdk/huggingface 1.0.40
@ai-sdk/hume 2.0.27
@ai-sdk/klingai 3.0.11
@ai-sdk/langchain 2.0.150
@ai-sdk/llamaindex 2.0.144
@ai-sdk/lmnt 2.0.27
@ai-sdk/luma 2.0.27
@ai-sdk/mcp 1.0.31
@ai-sdk/mistral 3.0.28
@ai-sdk/moonshotai 2.0.13
@ai-sdk/open-responses 1.0.9
@ai-sdk/openai 3.0.50
@ai-sdk/openai-compatible 2.0.38
@ai-sdk/perplexity 3.0.27
@ai-sdk/prodia 1.0.25
@ai-sdk/provider-utils 4.0.22
@ai-sdk/react 3.0.146
@ai-sdk/replicate 2.0.27
@ai-sdk/revai 2.0.27
@ai-sdk/rsc 2.0.144
@ai-sdk/svelte 4.0.144
@ai-sdk/togetherai 2.0.42
@ai-sdk/valibot 2.0.23
@ai-sdk/vercel 2.0.40
@ai-sdk/vue 3.0.144
@ai-sdk/xai 3.0.76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label bug Something isn't working as documented maintenance CI, internal documentation, automations, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants