← Security advisories

Claude MCP skill CORS misconfiguration — skill version and release management endpoints — SA-SKL-CORS46

SA-SKL-CORS46 documents four CORS misconfiguration patterns in MCP skill registry version and release management endpoints. These endpoints control the full lifecycle of published skill versions: reading version history with rollback tokens, creating new release artifacts, checking draft release status, and deleting releases. Credential-bearing CORS on the version history endpoint exposes unpublished drafts, pre-release changelogs, and rollback tokens. Wildcard ACAO on the release creation endpoint allows any page to create releases consuming CI quota and potentially triggering malicious publish pipelines. A timing oracle on the draft release endpoint reveals draft existence across organizational boundaries. And credential-bearing CORS on release deletion lets any origin delete any release, creating version gaps and breaking dependency pinning for all consumers of the affected skill version.

SA-SKL-CORS46 findings at a glance
CRITICALCORS46-001 — cors({origin:true,credentials:true}) on GET /api/skills/:id/versions; any origin reads full version history including unpublished drafts, pre-release changelogs, and rollback tokens using victim session
HIGHCORS46-002 — ACAO: * on POST /api/skills/:id/releases; any page creates releases consuming CI quota and potentially triggering malicious publish pipelines; fix: remove wildcard; require session; CSRF token; requireRole('admin'); per-org release rate limit
MEDIUMCORS46-003 — ACAO origin reflection on GET /api/skills/:id/releases/draft emitted before ownership check; timing oracle reveals draft release existence across all orgs
CRITICALCORS46-004 — cors({origin:true,credentials:true}) on DELETE /api/skills/:id/releases/:releaseId; any origin deletes any release using victim admin session, causing version gaps and broken dependency resolution for existing consumers

CORS46-001 — Credential-bearing CORS on version history exposes rollback tokens and pre-release changelogs

The version history endpoint at GET /api/skills/:id/versions returns the complete version record for a published skill, including: all published versions with their artifact hashes and signing keys, unpublished draft versions with their associated pre-release changelogs and planned publication dates, and rollback tokens — one-time-use credentials that allow reverting a skill to a previous version without going through the full publish pipeline. When configured with cors({origin:true,credentials:true}), any page can read all of this using the victim publisher's authenticated browser session.

Rollback tokens are the most immediately dangerous component. They are designed for incident response — a quick revert when a bad version is discovered — and are therefore intentionally bypassing normal publish pipeline controls. An attacker who exfiltrates a rollback token can revert a skill to any older version at any time, including older versions that contain known vulnerabilities the publisher has since patched. The rollback appears in the registry as a publisher-initiated action, and consumers of the skill who pin to latest silently begin using the vulnerable version. The attack is particularly insidious because it does not require compromising the publisher's account — it only requires reading the version history from a cross-origin page during one authenticated browser session.

Pre-release changelog leakage has significant competitive intelligence value. Organizations that coordinate security patch releases with their enterprise customers — providing advance notice of a vulnerability disclosure so customers can prepare — store the patch details in draft changelogs before the coordinated disclosure date. CORS46-001 delivers these pre-release changelogs to any attacker who can run a cross-origin page while a publisher staff member is authenticated. The attacker receives the full text of the upcoming security advisory, the patched vulnerability details, and the planned disclosure timeline — allowing them to exploit the vulnerability before the patch is widely deployed.

CORS46-001 fix: Replace cors({origin:true,credentials:true}) with an explicit allowlist. Add requireSession before CORS middleware. For public callers, return only the list of publicly published version numbers — never drafts, pre-release changelogs, signing keys, or rollback tokens. Treat rollback tokens as write-only: never return them in GET responses, only emit them at creation time to authenticated owners.

WRONG
router.get('/skills/:id/versions',
  cors({ origin: true, credentials: true }),
  async (req, res) => {
    const versions = await db.getAllVersions(req.params.id);
    // includes drafts, pre-release changelogs, rollback tokens
    res.json(versions);
  }
);
RIGHT
router.get('/skills/:id/versions',
  requireSession,
  strictCors,
  async (req, res) => {
    const isOwner = await db.isSkillOwner(req.params.id, req.session.orgId);
    if (!isOwner) {
      // public: published versions only — no drafts, changelogs, or tokens
      const published = await db.getPublishedVersions(req.params.id);
      return res.json(published);
    }
    const versions = await db.getAllVersions(req.params.id);
    // Strip rollback tokens from GET response — emit only at creation time
    return res.json(versions.map(v => ({ ...v, rollbackToken: undefined })));
  }
);

CORS46-002 — Wildcard ACAO on release creation enables CI quota exhaustion and malicious pipeline triggering

The release creation endpoint at POST /api/skills/:id/releases creates a new release entry and triggers the registry's publish pipeline — artifact upload, signing, CDN propagation, and marketplace listing update. With ACAO: *, any page holding the victim's Bearer token can submit release creation requests without restriction. The quota exhaustion attack floods the monthly CI and artifact storage quota by creating empty or minimal releases in a tight loop. The malicious pipeline triggering attack submits a release pointing to an attacker-controlled artifact URL, triggering the registry's post-publish pipeline — including security scanning and signing — against a tampered artifact.

The malicious artifact injection is the more severe vector. If the registry's release creation endpoint accepts an artifact URL as a parameter rather than requiring a pre-uploaded artifact hash, and if that URL is not validated against a list of approved artifact storage origins, an attacker can submit a release pointing to an attacker-hosted artifact. The registry's signing and CDN propagation pipeline processes this artifact as if it were a legitimate publisher release, potentially delivering it to consumers before the tampered content is detected.

CORS46-002 fix: Remove wildcard ACAO: *. Require session authentication. Add CSRF token. Require requireRole('admin'). Validate that any artifact reference in the release body points to an artifact previously uploaded to the registry's own storage, identified by a pre-computed hash. Per-org release rate limit. Audit log on every release creation.

CORS46-003 — Timing oracle on draft release endpoint enumerates pre-release targets

The draft release endpoint at GET /api/skills/:id/releases/draft emits the CORS origin reflection header before executing the ownership check that determines whether the requesting session may read draft release data. This creates a timing oracle: the response latency for skills that have an active draft but belong to a different org (ownership check fails after DB query — slower) is measurably different from skills that have no draft at all (early exit before ownership check — faster). An attacker who can observe these timing differences can enumerate which skills are preparing imminent releases, targeting those skills for CORS46-001 to exfiltrate the pre-release changelog before the coordinated disclosure date.

CORS46-003 fix: Move the ownership check before CORS header emission. Use a unified WHERE orgId = req.session.orgId AND skillId = req.params.id clause so the response shape is consistent regardless of ownership. Normalize 403/404 response latency by ensuring both paths complete a database round-trip before returning.

CORS46-004 — Credential-bearing CORS on release deletion creates version gaps and breaks dependency pinning

The release deletion endpoint at DELETE /api/skills/:id/releases/:releaseId configured with cors({origin:true,credentials:true}) allows any origin to delete any release using the victim admin's authenticated session. Release deletion in a skill registry has permanent downstream consequences. Any agent or application that pins a dependency on the deleted version — specifying an exact version string in a claude_skills.json or equivalent lockfile — immediately begins failing to resolve the dependency. CI pipelines that use a pinned version fail with a not-found error. Automated security scanners that compare skill versions against a known-good baseline lose the reference point. The deletion appears in the registry's version history as a publisher-initiated yank, with no immediate indication that it was not authorized by the legitimate publisher.

An attacker who targets the highest-installed-count versions of widely-used skills can maximize disruption. Deleting the pinned version that 80% of the ecosystem uses forces a simultaneous reinstall event across thousands of dependent agents, overloading the registry's artifact delivery infrastructure and creating an opportunity for cache-poisoning attacks against CDN nodes that are simultaneously invalidating and re-warming the deleted version's cache entries.

CORS46-004 fix: Replace cors({origin:true,credentials:true}) with an explicit allowlist. Add requireRole('admin'). Add an ownership check that validates the release belongs to the requesting session's org before executing the deletion. Enforce a cool-down period after deletion — releases that have more than N installs should require a secondary confirmation step. Write an audit log entry and emit a notification to downstream consumers when a pinned version is yanked.

WRONG
router.delete('/skills/:id/releases/:releaseId',
  cors({ origin: true, credentials: true }),
  async (req, res) => {
    await db.deleteRelease(req.params.releaseId);  // no ownership check
    res.json({ deleted: true });
  }
);
RIGHT
router.delete('/skills/:id/releases/:releaseId',
  requireSession,
  strictCors,
  requireRole('admin'),
  async (req, res) => {
    const release = await db.getRelease(req.params.releaseId);
    if (!release || release.orgId !== req.session.orgId) {
      return res.status(403).json({ error: 'forbidden' });
    }
    if (release.installCount > 1000) {
      // High-install yanks require secondary confirmation
      return res.status(409).json({ error: 'confirmation_required', installCount: release.installCount });
    }
    await db.deleteRelease(req.params.releaseId);
    await auditLog.write({ event: 'release_deleted', releaseId: req.params.releaseId, actor: req.session.userId });
    await notify.sendDownstreamYankAlert(req.params.releaseId);
    res.json({ deleted: true });
  }
);

SkillAudit scans your registry's version and release management router for all four CORS46 patterns, plus the eleven other CORS families documented in the SA-SKL-CORS series. Get started free — 3 audits/month on public repos, results in 60 seconds.