fix: allow inline data URLs in download validation#13376
Merged
gr2m merged 2 commits intovercel:mainfrom Mar 19, 2026
Merged
Conversation
1 task
gr2m
approved these changes
Mar 19, 2026
Collaborator
gr2m
left a comment
There was a problem hiding this comment.
Apologies for introducing this regression. Changes look good, thanks for adding a test to prevent future regressions.
vercel-ai-sdk bot
pushed a commit
that referenced
this pull request
Mar 19, 2026
## 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>
Contributor
|
✅ Backport PR created: #13624 |
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 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>
6 tasks
hazemadelkhalel
added a commit
to activepieces/activepieces
that referenced
this pull request
Apr 7, 2026
Update @ai-sdk/provider-utils to 4.0.23 which includes the fix for inline data URL validation (vercel/ai#13376). Align generate-image.ts with extract-structured-data.ts by passing file.data (Buffer) directly instead of constructing data: URLs. Replace deprecated experimental_generateImage with stable generateImage export.
Merged
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
data:URLs throughvalidateDownloadUrlbecause they are inline content, not network fetcheshttp:andhttps:URLs unchangeddownload()support for inline data URLsTesting
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.tspnpm install --frozen-lockfilevitestruns, but the local workspace currently fails to resolve some internal package entries before reaching these tests under Nodev24.14.0Why 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.