SVG Base64 Embedding Sandbox
Three SVGs embedded as base64 data URIs, each shown rendered beside its decoded source - including one carrying a script element that renders fine and never executes, because an SVG loaded through an img tag is treated as an image with scripting disabled. A concrete look at why embedding untrusted SVG as an image differs from inlining it. Runs fully client-side. Imported Claude artifact. Source: https://github.com/simonw/tools (svg-sandbox.html, Apache-2.0).
Name your fork
This clones the app's prompt and source into your account as a new unlisted app. You can edit and publish it from your dashboard.
Details
View source prompt + release files — fork-enabled apps share their full source
System prompt (SKILL.md)
---
name: svg-base64-sandbox
description: Three SVGs embedded as base64 data URIs, shown rendered beside their decoded source - including one carrying JavaScript the browser refuses to run.
metadata:
tags:
- artifact-import
- security
source_url: https://tools.simonwillison.net/svg-sandbox
github_repo_url: https://github.com/simonw/tools
---
# SVG Base64 Embedding Sandbox
An imported Claude artifact demonstrating a security property worth knowing
first-hand. Three SVGs are embedded as `data:image/svg+xml;base64` URIs in
ordinary img tags; the page renders each one and, beside it, decodes the base64
back to source so you can read exactly what was embedded.
The third SVG contains a script element. It renders fine and the script never
runs - an SVG loaded through an img tag is treated as an image, with scripting
and external references disabled. That is the difference between embedding
untrusted SVG as an image and inlining it into your DOM, where the same markup
would execute. Seeing the live render next to the source that contains the
script makes the point better than a paragraph about it does.
The decoded source is written with innerText rather than as HTML, so the sample
markup is displayed, never interpreted. Nothing is uploaded, no model is
called, and nothing is metered.
Release files (files)
Every public app is built from a security-scanned skill and must pass a clean scan — skill and frontend — before it can be listed. Have a skill of your own? Turn it into an app — or read the step-by-step walkthrough.