Skip to content

[attestations 3] Accept inline data:image/svg+xml in image_url - #246

Draft
mdgeorge4153 wants to merge 1 commit into
mdgeorge/attestation-grpcfrom
mdgeorge/source-verification-1-inline-svg
Draft

[attestations 3] Accept inline data:image/svg+xml in image_url#246
mdgeorge4153 wants to merge 1 commit into
mdgeorge/attestation-grpcfrom
mdgeorge/source-verification-1-inline-svg

Conversation

@mdgeorge4153

Copy link
Copy Markdown

Frontend counterpart to the attestations repo's inline-SVG CONVENTIONS.md change (MystenLabs/attestations#4). First PR in the source-verification stack; stacked on #245 (base mdgeorge/attestation-grpc).

Problem

The attestation badge fed image_url through httpsLink, which only accepts https://. So an inline data:image/svg+xml badge — the point of the convention change — was silently dropped and fell back to the attester avatar.

Change

  • New imageSource helper: accepts an https URL or a data:image/svg+xml URI (raw, ;base64,, and ;charset=…, forms). Used only for the badge.
  • The report link keeps httpsLink (https-only) — a data: link target isn't wanted.

Safety

The value goes only into an <img src>, where a <script> or onload inside the SVG does not execute — which is the rule the convention spells out (render in <img>, never inline into the DOM). Rejected: http, other data: types (data:text/html,…), prefix-spoofs (data:image/svg+xmlEVIL), javascript:.

Verification

TSC clean; the accept/reject logic is unit-checked against the cases above. Not yet visually confirmed against a real attestation — none of the testnet attesters set image_url yet (that's exactly the source-verification badge work coming next in the stack).

🤖 Generated with Claude Code

https://claude.ai/code/session_01GqiELJtBuhYBp2W35ExHCk

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mvr Ready Ready Preview Aug 20, 2026 11:07am

Request Review

@mdgeorge4153 mdgeorge4153 changed the title [source-verification 1] Accept inline data:image/svg+xml in image_url [attestations 3] Accept inline data:image/svg+xml in image_url Jul 23, 2026
@mdgeorge4153
mdgeorge4153 force-pushed the mdgeorge/source-verification-1-inline-svg branch from 43b34a8 to d27d01f Compare July 24, 2026 11:37
@mdgeorge4153
mdgeorge4153 force-pushed the mdgeorge/source-verification-1-inline-svg branch from d27d01f to 2a36b0b Compare July 24, 2026 18:22
@mdgeorge4153
mdgeorge4153 force-pushed the mdgeorge/source-verification-1-inline-svg branch from 2a36b0b to 0cae354 Compare July 30, 2026 18:24
@mdgeorge4153
mdgeorge4153 force-pushed the mdgeorge/source-verification-1-inline-svg branch 2 times, most recently from 6013f5d to b5ab106 Compare August 5, 2026 21:03
@mdgeorge4153
mdgeorge4153 force-pushed the mdgeorge/source-verification-1-inline-svg branch from b5ab106 to bf62cad Compare August 5, 2026 21:38
@mdgeorge4153
mdgeorge4153 force-pushed the mdgeorge/source-verification-1-inline-svg branch from bf62cad to 4aee203 Compare August 6, 2026 16:43
@mdgeorge4153
mdgeorge4153 force-pushed the mdgeorge/source-verification-1-inline-svg branch from 4aee203 to 7755c21 Compare August 7, 2026 13:42
@mdgeorge4153
mdgeorge4153 force-pushed the mdgeorge/source-verification-1-inline-svg branch from 7755c21 to 68026f4 Compare August 14, 2026 21:00
@mdgeorge4153
mdgeorge4153 force-pushed the mdgeorge/source-verification-1-inline-svg branch from 68026f4 to 2a81a85 Compare August 14, 2026 21:18
@mdgeorge4153
mdgeorge4153 force-pushed the mdgeorge/source-verification-1-inline-svg branch from 2a81a85 to 2dff757 Compare August 20, 2026 11:06
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.

1 participant