Skip to content

fix(creator): validate metadata URIs returned by the pinning provider - #1128

Closed
devbigaiizen wants to merge 1 commit into
Heliobond:mainfrom
devbigaiizen:fix/issue-1000-validate-provider-metadata-uri
Closed

devbigaiizen wants to merge 1 commit into
Heliobond:mainfrom
devbigaiizen:fix/issue-1000-validate-provider-metadata-uri

Conversation

@devbigaiizen

Copy link
Copy Markdown
Contributor

Issue
#1000: HttpMetadataPinner only checked that the provider response had a non-empty uri string, and reviewApplication stored that string as approved metadata and later used it in create_project XDR. A bad provider URI could get approved and stored.

Changes

  • Factored the document URI checks into a shared validateSupportedUri (same scheme allowlist, same 2048 length cap, same https URL rules), kept validateDocumentUri behaviour unchanged.
  • Added exported validateMetadataUri for provider output.
  • HttpMetadataPinner now validates the returned URI before handing it back.
  • reviewApplication validates the pinned URI before committing, so a pluggable pinner returning a bad URI leaves the application in_review instead of storing it as approved.

Noticed

  • The deterministic stub pinner returns ipfs://, which passes the shared checks, so local dev and tests are unaffected.
  • buildCreateProjectTx was left as is. It only ever receives the URI from an approved application, which is now validated at approval time.
  • Bound and cancel creator metadata pinning requests #1001 touches the same pin method (deadline and cancellation). If that lands first this will need a rebase.

Tests

  • creator-onboarding suites: 59 passed, 0 failed (53 existing + 6 new). The new tests cover malformed, unsupported scheme, oversized, https with credentials and empty ipfs id provider URIs, each leaving the application in_review with hash and URI unset and audit untouched, plus a valid provider URI stored unchanged and building a compatible create_project tx.
  • tsc clean. ESLint clean apart from one pre-existing no-explicit-any warning at creatorOnboarding.ts:920, untouched code. Prettier clean.

@drips-wave

drips-wave Bot commented Nov 25, 2026

Copy link
Copy Markdown

Hey @devbigaiizen! 👋 It looks like this PR isn't linked to any issue.

If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g., Closes #123), or by clicking a button below:

Issue Title
#1001 Bound and cancel creator metadata pinning requests Link to this issue
#853 sanitizeInputs silently corrupts strings, overblocks legitimate input, and can pollute req.body's prototype Link to this issue
#1000 Validate metadata URIs returned by the pinning provider before approval Link to this issue
#865 cleanupStaleWebhooks never reaps webhooks that have never successfully delivered, allowing unbounded growth Link to this issue

ℹ️ Learn more about linking PRs to issues

@dadadave80 dadadave80 closed this Nov 25, 2026
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.

2 participants