fix: remove local filesystem reads from flaunch and zora providers - #1432
Open
CarsonRoscoe wants to merge 3 commits into
Open
fix: remove local filesystem reads from flaunch and zora providers#1432CarsonRoscoe wants to merge 3 commits into
CarsonRoscoe wants to merge 3 commits into
Conversation
Both providers treated any non-URL `image` string as a local filesystem
path, read it with `fs.readFile`, and uploaded the bytes to a third-party
IPFS pinning service (web2-api.flaunch.gg and Pinata respectively), which
pins them publicly. Because `image` is an LLM-supplied tool argument whose
description explicitly advertised "Local image file path", an agent could
be induced to read an arbitrary file off the host and publish it.
The local-file affordance is not useful to an agent, which has no
knowledge of the host filesystem. It only ever served direct programmatic
SDK callers, who can perform the read themselves.
- flaunch: `image` accepts `http(s)://` URLs or `data:` URIs
- zora: `image` accepts `https://`/`ipfs://` URIs or `data:` URIs
- Anything else is rejected before any file or network access
- Zod schemas reject non-URL values, so the constraint is also visible
to the model rather than surfacing only as a runtime error
- Tool/schema descriptions and READMEs no longer advertise local paths
Callers publishing a local file now pass a data URI:
image: `data:image/png;base64,${fs.readFileSync(p, "base64")}`
Co-Authored-By: Claude <noreply@anthropic.com>
🟡 Heimdall Review Status
|
Per CONTRIBUTING-TYPESCRIPT.md, breaking changes take a minor bump. Restricting `image` to remote URLs and data URIs breaks callers that currently pass a local file path, so this is not a patch. Also added the data URI migration snippet to the changeset so it lands in the published changelog rather than only in the PR description. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Description
Both providers treated any non-URL
imagestring as a local filesystem path, read it withfs.readFile, and uploaded the bytes to a third-party IPFS pinning service (web2-api.flaunch.gg and Pinata respectively), which pins them publicly. Becauseimageis an LLM-supplied tool argument whose description explicitly advertised "Local image file path", an agent could be induced to read an arbitrary file off the host and publish it.The local-file affordance is not useful to an agent, which has no knowledge of the host filesystem. It only ever served direct programmatic SDK callers, who can perform the read themselves.
imageacceptshttp(s)://URLs ordata:URIsimageacceptshttps:///ipfs://URIs ordata:URIsCallers publishing a local file now pass a data URI:
Tests
Manually tested and verified
Checklist
A couple of things to include in your PR for completeness: