← Blog

CORS Misconfigurations in MCP Skill Registry Version Pinning and Dependency Lock Endpoints

Version pinning and dependency lock endpoints sit at the boundary between operational convenience and security-critical infrastructure in any MCP skill registry. The pin configuration these routes manage controls exactly which version of every skill resolves when a dependent tool, agent, or automated pipeline requests it — including whether a skill is locked to a specific commit hash, frozen at a known-safe semver range, or flagged as security-patch-only to prevent automatic upgrades that the team considers too risky to deploy automatically. When CORS is misconfigured on these endpoints, an attacker reading the pin list gains a complete map of the registry's vulnerability management priorities: which skills the team has deemed too sensitive to auto-update, and which commit hashes they trust. When CORS is misconfigured on the pin creation endpoint, an attacker can inject override pins under victim admin identity that freeze skills at known-CVE versions indefinitely, with no vulnerability scanner alert firing because the pin prevents the upgrade that would have been flagged. When CORS is misconfigured on the pin deletion endpoint, any origin can silently undo security-conscious dependency decisions made during past security incidents, reverting carefully maintained locks to whatever the registry's latest version resolves to. Advisory SA-SKL-CORS59 documents four distinct vulnerabilities across these endpoints that compose naturally into a compound four-stage version pin compromise and supply chain exposure chain, executable from a single malicious web page visited by any registry admin.

By SkillAudit  |  20 Nov 2026  |  25 min read

In this post

  1. Why version pinning and dependency lock endpoints are high-value CORS targets
  2. CORS59-001 — Credential-bearing CORS on version pin list exposes dependency management strategy
  3. CORS59-002 — Wildcard ACAO on pin creation enables lock override injection under victim admin identity
  4. CORS59-003 — Timing oracle on pin audit endpoint identifies active pin management sessions
  5. CORS59-004 — Credential-bearing CORS on pin deletion forces skills to vulnerable latest versions
  6. Compound version pin compromise and supply chain exposure chain
  7. Detection with SkillAudit AST queries
  8. Summary and remediation checklist
Advisory SA-SKL-CORS59 — Findings at a glance
Critical CORS59-001 — GET /api/skills/:id/version-pins allows any origin with credentials to read the full version pin list including pinned commit hashes, branch locks, and security-patch-only pin flags — with security-patch-only flags particularly revealing internal vulnerability management priorities and identifying which dependencies the team considers too risky to auto-update
Critical CORS59-002 — POST /api/skills/:id/version-pins returns Access-Control-Allow-Origin: *, letting any page create attacker-controlled pin overrides under victim admin identity — locking skills to known-vulnerable versions or unpinning security-critical locks, with no vulnerability scanner alert firing because the pin prevents the upgrade that would have been flagged
Medium CORS59-003 — GET /api/skills/:id/version-pins/audit reflects Origin before ownership check, creating a timing oracle that reveals pin modification velocity tiers — identifying skills with active version management as the highest-value CORS59-001 targets during live admin sessions
Critical CORS59-004 — DELETE /api/skills/:id/version-pins/:pinId allows any origin with credentials to remove any version pin using a victim admin session — forcing skills to resolve to latest (potentially vulnerable) versions without notifying the pin owner, silently undoing past security-incident-driven dependency decisions

Why version pinning and dependency lock endpoints are high-value CORS targets

Version pinning endpoints differ from most other endpoint classes in a skill registry because their state directly governs what code runs when downstream systems resolve a skill dependency. A skill's audit log records history. A skill's review aggregate influences trust scores. But a skill's version pin document is the operational control plane for which artifact is fetched every time an agent, pipeline, or tool integration resolves that skill by name. Misconfiguring CORS on these endpoints does not just leak information — it allows an attacker to manipulate the actual version resolution behavior of every downstream consumer of that skill, without those consumers having any visibility into the change.

The security-patch-only flag documented in CORS59-001 is particularly revealing because it encodes a risk assessment that engineering and security teams typically do not publish externally. When a team marks a skill's pin as security-patch-only, they are recording that automatic version upgrades for that skill are disabled because the upgrade path carries unacceptable risk — an incompatibility, a known unstable migration, or a dependency on a version that the team has not yet validated against their production environment. Reading this flag cross-origin tells an attacker which skills the team is most cautious about upgrading, which is equivalent to a partial map of the registry's vulnerability management backlog.

The pin creation endpoint (CORS59-002) introduces a supply chain manipulation surface that is distinct from the trust-signal attacks documented in earlier advisories. When an attacker injects a fraudulent review (documented in SA-SKL-CORS57), the impact is to metadata that influences human decisions. When an attacker injects a version pin override under victim admin identity, the impact is to the resolution state of the skill registry itself — every system that resolves the skill by name will now fetch the pinned version the attacker specified, potentially a version with a known CVE, without any alert or indicator of change visible to the skill's downstream consumers.

The timing oracle in CORS59-003 targets a specific operational pattern: version pin changes tend to cluster around security incident responses, CVE patch cycles, and during active dependency audits. These are exactly the moments when an admin is working in the pin management UI with an authenticated session in their browser — making them available for CORS-based exfiltration or injection without requiring any additional attacker action to establish a live session window. The oracle identifies which skills are in an active pin management cycle before the credential-read and injection phases begin.

CORS59-004 provides a disruption capability with a supply chain consequence that extends beyond the attacker's access window. When a version pin is deleted, the skill's resolution reverts to the registry's latest-version logic. If the team had pinned the skill specifically to avoid a vulnerability in the latest published version, deleting the pin re-exposes every downstream consumer to that vulnerability — with no notification sent to the pin owner and no indicator visible to consumers that their dependency has changed behavior.

Pin deletion silently re-exposes downstream consumers to known vulnerabilities. Unlike session tokens or permission grants, version pins encode security decisions made during past incidents. Deleting a pin via CORS59-004 undoes that security decision for all downstream systems simultaneously — the skill resolves to a newer (potentially vulnerable) version on the next install or resolution without any user-visible change, permission alert, or audit notification reaching the pin owner.

CORS59-001 — Credential-bearing CORS on version pin list exposes dependency management strategy

Severity: CRITICAL  |  Endpoint: GET /api/skills/:id/version-pins

The version pin list endpoint is configured with cors({origin:true,credentials:true}) applied at the router level. This policy reflects any Origin header as an allowed origin while simultaneously setting Access-Control-Allow-Credentials: true. Any web page can therefore issue a credentialed cross-origin request to this endpoint and receive the complete version pin document in the response.

The version pin document contains three tiers of sensitive data. The first tier is pinned commit hashes. These are exact Git SHA references that the registry's dependency resolver is instructed to fetch when a consumer installs or updates the skill. Exposing raw commit hashes cross-origin is specifically dangerous because a commit hash is unambiguous — an attacker who knows the exact commit a team trusts can search the repository's vulnerability history for CVEs affecting that exact SHA, identify whether the pinned commit predates a security patch, and use that information to construct targeted exploitation payloads for downstream systems that have installed the pinned version.

The second tier is branch locks. A branch lock records that the registry should track the HEAD of a specific branch rather than a fixed version — typically used for staging or pre-release environments. Knowing which skills have branch locks and which branches they target reveals integration testing branch names, pre-release feature flags, and staging environment topology that can be used to target attacks against the development pipeline rather than production.

The third tier is security-patch-only flags. A security-patch-only flag on a pin record means that the team has explicitly disabled automatic upgrades for this skill, allowing only security patches to advance the installed version. This flag is particularly revealing: its presence encodes a risk assessment that the team has deemed the upgrade path for this skill too risky to automate. Reading these flags cross-origin provides an attacker with the registry's internal vulnerability management priority list — the skills the team is most cautious about, which are frequently also the skills with the longest lag between CVE publication and deployment of the patched version.

Vulnerable
// GET /api/skills/:id/version-pins — cors({origin:true,credentials:true}) at router level
const router = express.Router();
router.use(cors({ origin: true, credentials: true }));  // reflects any origin with credentials

router.get('/:id/version-pins', requireSession, async (req, res) => {
  const pins = await VersionPin.find({ skillId: req.params.id })
    .select('+commitHash +branchLock +securityPatchOnly +pinOwner');  // exposes all sensitive fields
  return res.json(pins);
});
Fixed
// GET /api/skills/:id/version-pins — per-route allowlist cors + role-scoped fields
const ALLOWED = process.env.ALLOWED_ORIGINS.split(',');
const pinCors = cors({ origin: ALLOWED, credentials: true });

router.get('/:id/version-pins', pinCors, requireSession, requireRole('admin'), async (req, res) => {
  const pins = await VersionPin.find({ skillId: req.params.id })
    .select('+pinId +name +versionRange +pinType +securityPatchOnly -commitHash -branchLock');

  // never return raw commit hashes in list responses — return only pin IDs, names, version ranges
  const safeResponse = pins.map(p => ({
    id:               p.pinId,
    name:             p.name,
    versionRange:     p.versionRange,
    pinType:          p.pinType,            // enum: commit | semver | branch | tag
    securityPatchOnly: p.securityPatchOnly,
    createdAt:        p.createdAt,
    // commitHash and branchLock intentionally omitted
  }));

  return res.json(safeResponse);
});

The fix applies CORS on a per-route basis using an explicit allowlist rather than the router-level reflect-all policy. Raw commit hashes are never returned in list responses — they are available only via a separate single-pin detail endpoint protected by admin-only access. Branch lock targets are omitted from list serialization entirely. Security-patch-only flags remain visible to admin callers because they are needed for pin management UIs, but the response shape is narrowed to pin IDs, names, and version ranges that do not expose the internal risk assessment context. The requireRole('admin') middleware ensures that non-admin callers cannot enumerate the registry's dependency management strategy even if they obtain a valid session.

CORS59-002 — Wildcard ACAO on pin creation enables lock override injection under victim admin identity

Severity: CRITICAL  |  Endpoint: POST /api/skills/:id/version-pins

The pin creation endpoint returns Access-Control-Allow-Origin: * regardless of the requesting origin. The endpoint requires a valid session via requireSession middleware. The wildcard ACAO means that any web page can submit a pin creation request using the victim's browser session, with the attacker controlling the full pin payload: the target version, the pin type, the commit hash to lock to, and whether to set the security-patch-only flag.

The practical consequence of a wildcard ACAO on pin creation is a supply chain manipulation capability that operates silently and persistently. Consider a skill that has a known CVE in version 1.2.3 (CVE-2026-XXXX) and the registry's auto-updater would normally have upgraded it to 1.2.4 when that patch was published. An attacker who injects a commit pin to the 1.2.3 commit hash under victim admin identity prevents that upgrade from occurring. The vulnerability scanner that would have flagged an upgrade from 1.2.3 to 1.2.4 as a recommended security update now sees a pinned commit and silently skips the check — the pin tells the scanner that the installed version is intentional. Every downstream consumer of the skill continues to receive the vulnerable version on every install, with no alert and no indication that anything has changed.

The audit log attribution problem is specifically damaging in this context. When a security engineer investigates why a skill has not been upgraded past a known CVE, the first query they run is against the pin log filtered by creation time. The pin creation event is attributed to the legitimate admin's user ID, so the investigation concludes that the pin was an authorized operational decision — the legitimate admin's account shows the creation event at a time when that admin had an active session, which is consistent with normal pin management behavior. This delays detection of the injected pin by weeks or months, during which every downstream consumer remains exposed to the CVE.

Injected pins prevent vulnerability scanner alerts. Version pins tell the registry's auto-updater and scanner that the installed version is an explicit, trusted choice. An attacker who pins a skill to a known-CVE version under victim admin identity causes the scanner to skip the upgrade check — the pin is semantically equivalent to "do not upgrade this," which is exactly the signal the scanner uses to suppress alerts. The CVE remains undetected until the pin is manually reviewed.

Vulnerable
// POST /api/skills/:id/version-pins — ACAO:* set by upstream cors() middleware
// No CSRF check, no role boundary, no Zod schema validation
router.post('/:id/version-pins', requireSession, async (req, res) => {
  const { pinType, version, commitHash, branchRef, securityPatchOnly } = req.body;
  const pin = await VersionPin.create({
    skillId:          req.params.id,
    createdBy:        req.session.userId,  // attributed to victim admin
    pinType,                               // attacker-controlled
    version,                               // attacker-controlled — can be known-CVE version
    commitHash,                            // attacker-controlled raw SHA
    branchRef,                             // attacker-controlled
    securityPatchOnly,                     // attacker can set false to suppress protection
  });
  return res.status(201).json(pin);
});
Fixed
// POST /api/skills/:id/version-pins — allowlist cors + requireRole + CSRF + Zod + rate limit
import { z } from 'zod';

const VersionPinSchema = z.object({
  name:             z.string().min(1).max(128),
  pinType:          z.enum(['commit', 'semver', 'branch', 'tag']),
  version:          z.string().max(256).optional(),
  commitHash:       z.string().regex(/^[0-9a-f]{40}$/).optional(),
  branchRef:        z.string().max(256).optional(),
  securityPatchOnly: z.boolean().optional().default(false),
}).refine(
  d => !(d.pinType === 'commit') || !!d.commitHash,
  { message: 'commitHash required for pinType=commit' }
);

router.post(
  '/:id/version-pins',
  pinCors,            // per-route allowlist (from CORS59-001 fix)
  requireSession,
  requireRole('admin'),
  verifyCsrf,
  rateLimit({
    windowMs: 60_000,
    max: 20,
    keyGenerator: r => `versionpin:${r.session.userId}:${r.params.id}`,
    message: { error: 'Version pin rate limit exceeded' },
  }),
  async (req, res) => {
    const parsed = VersionPinSchema.safeParse(req.body);
    if (!parsed.success) return res.status(400).json({ error: 'Invalid pin payload', issues: parsed.error.issues });

    const pin = await VersionPin.create({
      skillId:          req.params.id,
      createdBy:        req.session.userId,
      pinType:          parsed.data.pinType,
      version:          parsed.data.version ?? null,
      commitHash:       parsed.data.commitHash ?? null,
      branchRef:        parsed.data.branchRef ?? null,
      securityPatchOnly: parsed.data.securityPatchOnly,
    });

    await AuditLog.create({
      action:    'versionpin.created',
      actorId:   req.session.userId,
      skillId:   req.params.id,
      pinId:     pin.id,
      pinType:   parsed.data.pinType,
      origin:    req.headers.origin,
      at:        new Date(),
    });

    return res.status(201).json({ id: pin.id });
  }
);

The fix applies five controls. Per-route allowlist CORS removes the wildcard ACAO. requireRole('admin') ensures only admins can create version pins. CSRF token verification prevents cross-site form injection. Zod VersionPinSchema validates the pin payload against an enum of allowed pin types — commit, semver, branch, tag — and enforces cross-field consistency (commit pins must include a 40-character hex SHA). The audit log records the origin header alongside the acting user ID, enabling detection of pins created from unexpected origins even when they carry a valid session. The rate limiter per userId+skillId prevents bulk pin injection during a single compromised session window.

CORS59-003 — Timing oracle on pin audit endpoint identifies active pin management sessions

Severity: MEDIUM  |  Endpoint: GET /api/skills/:id/version-pins/audit

The pin audit endpoint reflects the Origin header as the value of Access-Control-Allow-Origin before the ownership check executes. This creates a timing oracle: the endpoint serves cached results for skills with high pin modification activity in under 5 ms (from an in-memory LRU cache maintained by the audit aggregation pipeline), while skills with low modification activity require a full database query that takes 20–50 ms. The latency difference is cross-origin-detectable even without reading the response body — the browser measures the round-trip time of the OPTIONS preflight followed by the GET and derives whether the skill has recent pin activity from the response time alone.

The timing oracle serves a specific role in the compound attack chain: it identifies which skills are currently in an active pin management window before the CORS59-001 credential-read phase begins. Skills that show high pin modification velocity in the audit cache are those whose administrators are actively working in the version pin UI — their session is live, their browser is open to the registry domain, and they will visit attacker-controlled pages during the same browsing session that holds the authenticated session. These are the highest-value CORS59-001 targets. The oracle is a prerequisite step in the compound chain: an attacker probing 100 skills in parallel with cross-origin timing requests can identify in a single round-trip which skills have active pin management sessions before issuing any credential-bearing requests.

The timing oracle is not exploitable without the CORS misconfiguration. Without origin reflection, the browser will not deliver cross-origin response metadata including RTT to the requesting page. The remediation performs ownership verification before emitting any CORS header, enforces a 60 ms constant-time response floor to eliminate the cache-hit versus database-query timing differential, and unifies the ownership-check WHERE clause to prevent 403-versus-404 status timing as a secondary oracle channel.

Vulnerable
// GET /api/skills/:id/version-pins/audit — Origin reflected before auth
router.get('/:id/version-pins/audit', async (req, res) => {
  // CORS header emitted before ANY ownership check
  res.setHeader('Access-Control-Allow-Origin', req.headers.origin || '*');
  res.setHeader('Access-Control-Allow-Credentials', 'true');

  // ownership check runs AFTER CORS header emission
  const skill = await Skill.findById(req.params.id);
  if (!skill || skill.ownerId !== req.session?.userId) {
    return res.status(403).json({ error: 'Forbidden' });
  }

  // cache hit: <5ms (high pin activity); cache miss: 20-50ms — detectable via RTT
  const audit = pinAuditCache.get(req.params.id)
    || await computePinAudit(req.params.id);
  return res.json(audit);
});
Fixed
// GET /api/skills/:id/version-pins/audit — auth before CORS + constant-time floor
router.get('/:id/version-pins/audit', requireSession, async (req, res) => {
  const start = Date.now();

  // ownership check BEFORE any CORS header is emitted
  const skill = await Skill.findOne({
    _id:     req.params.id,
    ownerId: req.session.userId,  // unified WHERE — eliminates 403 vs 404 timing channel
  });
  if (!skill) {
    await sleep(Math.max(0, 60 - (Date.now() - start)));
    return res.status(404).json({ error: 'Not found' });
  }

  // apply allowlist CORS only after auth succeeds
  pinCors(req, res, async () => {
    const audit = pinAuditCache.get(req.params.id)
      || await computePinAudit(req.params.id);
    // 60ms constant-time floor eliminates cache-hit vs DB-query differential
    await sleep(Math.max(0, 60 - (Date.now() - start)));
    return res.json(audit);
  });
});

The 60 ms floor is calibrated to exceed the worst-case database query latency (20–50 ms) while remaining fast enough that legitimate admin UIs are unaffected. The unified WHERE clause that checks both _id and ownerId in a single query eliminates the secondary oracle where a 403 (skill exists, wrong owner) has a different latency than a 404 (skill does not exist) due to query plan differences. Both negative cases now follow the same code path and sleep to the same response floor before returning.

CORS59-004 — Credential-bearing CORS on pin deletion forces skills to vulnerable latest versions

Severity: CRITICAL  |  Endpoint: DELETE /api/skills/:id/version-pins/:pinId

The pin deletion endpoint shares the same router-level cors({origin:true,credentials:true}) policy as CORS59-001. Any web page can issue a credentialed DELETE request to this endpoint using the victim admin's browser session. The endpoint performs no ownership check — it deletes any pin by ID without verifying that the caller administered the pin or that they have authority over the skill in question.

Pin deletion is particularly disruptive because it undoes security-conscious dependency management decisions made during past security incidents without leaving any user-visible indication that the pin was removed. When a team responds to a CVE disclosure by pinning all affected skills to a known-safe version, those pins represent the security boundary between the production environment and the vulnerability. Deleting a pin after the fact does not revert the production environment to the vulnerable version immediately — it causes the skill to resolve to the registry's latest published version on the next install, upgrade cycle, or agent restart. The transition is silent: no alert fires, no dashboard changes, and the pin owner receives no notification.

The absence of a notification mechanism on the deletion endpoint extends the attacker's access window substantially. The legitimate pin owner has no automated signal that their version locks have been removed. They discover the deletion only when downstream systems begin failing with version-related errors, a vulnerability scanner eventually re-identifies the now-unblocked upgrade path, or a manual audit of the pin table reveals the gap — a process that can take days or weeks depending on how frequently the team audits pin state. During this window, every consumer of every affected skill is resolving to whatever the latest published version is, which may include versions with CVEs the original pins were specifically placed to block.

No notification on pin deletion means no detection window. The registry's vulnerability scanner only alerts on the upgrade event — if a pin is deleted and the skill is not immediately re-installed or upgraded by any consumer, the scanner may not run against the new latest version for days. Organisations that treat version pins as their primary defense against known-CVE skill versions are silently left exposed with no alert until the next scheduled scan or the next consumer install cycle.

Vulnerable
// DELETE /api/skills/:id/version-pins/:pinId
// cors({origin:true,credentials:true}) from router.use()
// No ownership check, no audit log, no notification to pin owner
router.delete('/:id/version-pins/:pinId', requireSession, async (req, res) => {
  await VersionPin.deleteOne({ _id: req.params.pinId });
  return res.status(204).end();
});
Fixed
// DELETE /api/skills/:id/version-pins/:pinId
// Per-route allowlist CORS + ownership check + audit log + notification to pin owner
router.delete('/:id/version-pins/:pinId', pinCors, requireSession, async (req, res) => {
  const pin = await VersionPin.findOne({
    _id:     req.params.pinId,
    skillId: req.params.id,
  });
  if (!pin) return res.status(404).json({ error: 'Pin not found' });

  const isAdmin   = req.session.role === 'admin' || req.session.role === 'registry_admin';
  const isPinOwner = String(pin.createdBy) === req.session.userId;
  if (!isAdmin && !isPinOwner) {
    return res.status(403).json({ error: 'Forbidden' });
  }

  await pin.deleteOne();

  await AuditLog.create({
    action:   'versionpin.deleted',
    actorId:  req.session.userId,
    pinId:    req.params.pinId,
    skillId:  req.params.id,
    pinType:  pin.pinType,
    origin:   req.headers.origin,
    at:       new Date(),
  });

  // notify the pin owner when deletion is performed by a third party
  if (!isPinOwner) {
    await notify(pin.createdBy, {
      type:    'versionpin.deleted',
      pinId:   req.params.pinId,
      skillId: req.params.id,
      by:      req.session.userId,
      pinType: pin.pinType,
    });
  }

  return res.status(204).end();
});

The fix applies per-route allowlist CORS, verifies that the caller is either the original pin owner or an admin before proceeding, writes an audit log record capturing the origin and acting user ID, and sends a notification to the original pin creator when deletion is performed by a third party. This notification is the mechanism that surfaces CORS-based pin deletion to the legitimate pin owner: even if the attacker uses a valid admin session to perform the deletion, the pin owner receives a signal that their version lock was removed from an unexpected origin, enabling detection during or immediately after the attack rather than days later when downstream consumers begin resolving to unintended versions.

Compound version pin compromise and supply chain exposure chain

The four vulnerabilities in SA-SKL-CORS59 compose naturally into a four-stage attack chain executed entirely from a single malicious web page visited by any registry admin:

StageFindingActionOutput used by
1 — Target identification CORS59-003 Probe 100 skill IDs in parallel, measure pin audit response latency, identify skills with high pin modification velocity — indicating live admin sessions in the pin management UI Target list of skills with active pin management sessions for Stage 2
2 — Intelligence exfiltration CORS59-001 Read full version pin list for high-velocity skills; extract pinned version ranges, security-patch-only flags (dependency management risk map), and pin type distribution (which skills use commit vs semver pins) Risk map of which skills are most carefully managed (highest-value injection targets); pin IDs for Stage 4
3 — Lock override injection CORS59-002 Create commit-type pin overrides for skills with known CVEs in their current pinned version range; set securityPatchOnly=false to suppress scanner alerts; audit log attributes to victim admin identity Skills locked to known-vulnerable versions indefinitely; audit trail framing victim as pin author
4 — Pin removal for coverage CORS59-004 Delete existing security-patch-only pins for high-value skills identified in Stage 2; skills revert to latest version resolution — if latest is also vulnerable, consumers are now exposed to a different CVE vector Elimination of previous security controls; forces registry consumers into uncontrolled version resolution without notifying pin owners

The chain is self-reinforcing. Stage 1 identifies which admins are active in the pin management UI, maximizing the probability that the victim's session is live when Stages 2 through 4 execute. Stage 2 provides the intelligence needed for Stage 3 to inject the highest-impact pins — specifically those targeting skills the team has identified as requiring careful version management, which are the skills most likely to have known CVEs in their version history. Stage 3 creates injected pins that suppress scanner alerts before Stage 4 removes the existing protective pins that might have otherwise triggered an alert on the new resolution target. An attacker who gains a victim admin's browser for the duration of a single page visit can complete all four stages in one pass.

The audit log is not a sufficient defense without origin-field alerting. CORS59-002 and CORS59-004 both create audit log entries, but those entries attribute actions to the legitimate admin's user ID. An audit log review will show the admin creating pins and removing security-patch-only locks — which appears consistent with normal dependency management behavior. Only the origin field in the audit record reveals that the action originated from an unexpected page. Organizations that do not alert on origin anomalies in pin mutation events will not detect this attack from their audit logs alone.

Detection with SkillAudit AST queries

SkillAudit's static analysis engine detects the three CORS patterns that compose this advisory using AST-level queries against your skill registry source code. The queries identify vulnerable code at the declaration site — where cors() is configured and where CORS headers are emitted relative to auth middleware — rather than at the call site, which is where runtime security scanners typically look. This matters because the vulnerability is in the CORS configuration, not in the downstream handler logic.

Three query classes cover SA-SKL-CORS59:

Query class 1 — cors_credentials_true_on_version_pin_read. Detects cors({origin:true,credentials:true}) applied to GET routes whose path segments match /version-pins or /pins patterns. The query walks the Express middleware chain for each matching route and flags both router-level application (which propagates to all child routes including pin list, pin detail, and pin audit) and per-route application on sensitive read endpoints. It also detects cors({origin:true}) without explicit credentials, which still enables origin reflection in environments where the downstream proxy forwards credential headers regardless of the CORS response.

Query class 2 — wildcard_acao_on_pin_write. Detects Access-Control-Allow-Origin: * set via res.setHeader, res.set, or applied via a cors() call on POST routes for pin creation endpoints. The query matches route handler declarations with path patterns containing version-pins or pins and POST HTTP method bindings, and flags any CORS configuration that emits a wildcard or reflect-all origin on those routes. This covers both explicit ACAO: * headers and cors({origin:'*'}) equivalents that libraries may normalize to wildcard responses.

Query class 3 — origin_reflection_before_auth_pin_audit. Detects res.set('Access-Control-Allow-Origin', req.headers.origin), res.setHeader('Access-Control-Allow-Origin', ...), or any CORS middleware invocation that precedes a requireSession, verifyToken, or equivalent auth middleware call in the same route's handler chain for paths matching /version-pins/audit or /pins/audit. The query models the Express middleware chain as an ordered list and checks the relative position of CORS-emitting statements against session-verification statements — the vulnerability exists when CORS emission precedes auth in that order, regardless of the specific CORS or auth library used.

These queries are available in SkillAudit's CORS rule pack alongside the full SA-SKL-CORS59 advisory. For teams scanning the broader CORS surface of their MCP skill registries, the same pack includes rules for permission and access control management endpoints (SA-SKL-CORS57) and the full endpoint surface documented in earlier advisories, covering the complete content and version management attack surface with consistent query semantics. Join the waitlist to run these queries against your registry codebase.

Summary and remediation checklist

SA-SKL-CORS59 documents four CORS misconfigurations in MCP skill registry version pinning and dependency lock endpoints that together enable a compound version pin compromise and supply chain exposure attack chain. All four vulnerabilities stem from the same root cause: CORS policy is applied at the router level using a reflect-all configuration rather than on individual routes using an explicit origin allowlist, with no ownership verification, no audit log on destructive operations, and no notification to pin owners when their locks are removed.

FindingSeverityRoot causeFix summary
CORS59-001 Critical cors({origin:true,credentials:true}) at router level on version pin list; raw commit hashes and security-patch-only flags exposed Per-route allowlist CORS; requireRole('admin'); never return raw commit hashes in list responses — return only pin IDs, names, version ranges
CORS59-002 Critical ACAO: * on pin creation endpoint; no CSRF check; no schema boundary; no audit log origin field Allowlist CORS; requireRole('admin'); verifyCsrf; Zod VersionPinSchema (enum of commit/semver/branch/tag); audit log with origin; rate limit per userId+skillId
CORS59-003 Medium Origin reflected before ownership check on pin audit endpoint; cache-hit timing differential detectable cross-origin Auth before CORS emission; unified WHERE clause; 60 ms constant-time response floor
CORS59-004 Critical cors({origin:true,credentials:true}) on pin deletion; no ownership check; no audit log; no notification to pin owner Per-route allowlist CORS; pin owner or admin check; audit log with origin on all pin deletion events; notify pinOwner on third-party deletion

Remediation checklist.

☐ Replace router-level cors({origin:true,credentials:true}) with per-route allowlist cors on all version pin endpoints
☐ Remove ACAO: * from pin creation endpoint; add requireRole('admin') + verifyCsrf + Zod VersionPinSchema + rate limit
☐ Move auth execution before CORS header emission on pin audit endpoint
☐ Enforce 60 ms constant-time response floor on pin audit endpoint
☐ Add ownership check and pin owner notification to DELETE /version-pins/:pinId
☐ Never return raw commit hashes in list responses — return only pin IDs, names, version ranges
☐ Add audit log with origin header to all pin mutation events
☐ Run SkillAudit scanner to detect all three AST query class violations