Skip to content

fix: only linkify digitalSourceType when it points to the IPTC registry - #49

Open
andyparsons wants to merge 1 commit into
mainfrom
fix/digital-source-type-link-validation
Open

fix: only linkify digitalSourceType when it points to the IPTC registry#49
andyparsons wants to merge 1 commit into
mainfrom
fix/digital-source-type-link-validation

Conversation

@andyparsons

Copy link
Copy Markdown
Collaborator

Summary

  • digitalSourceType is signer-controlled free text on the manifest, but the report rendered it as an unconditional clickable link, so any value (e.g. google.com, or a phishing URL) became a live, unlabeled hyperlink presented as if it were vetted data.
  • Only linkify the value now when it's an http(s)://cv.iptc.org/... URL — the registry C2PA actually references for this field. Everything else (other domains, non-URL text, dangerous schemes like javascript:) renders as plain text instead.

Closes #46

Test plan

  • npx vitest run src/lib/ReportViewer.test.ts — new isTrustedDigitalSourceTypeUrl cases cover trusted IPTC URLs, other domains (incl. lookalike hosts), dangerous schemes, and non-URL text
  • npm run check — no new type errors introduced

🤖 Generated with Claude Code

https://claude.ai/code/session_01R9UcEM7BT3vwtX63A1bBhG

digitalSourceType is signer-controlled free text, so rendering it as an
unconditional clickable link let a malicious manifest turn the report
into a phishing redirect. Only linkify http(s) values hosted on
cv.iptc.org (the registry C2PA actually references); everything else
renders as plain text.

Closes #46

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R9UcEM7BT3vwtX63A1bBhG
@netlify

netlify Bot commented Aug 24, 2026

Copy link
Copy Markdown

Deploy Preview for c2pa-conformulator ready!

Name Link
🔨 Latest commit adb198b
🔍 Latest deploy log https://app.netlify.com/projects/c2pa-conformulator/deploys/6a8b9c78acb7920008428cd5
😎 Deploy Preview https://deploy-preview-49--c2pa-conformulator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

Digital source type showed in report is clickable for any value

2 participants