← Security advisories

Claude MCP skill CORS misconfiguration — skill dependency and compatibility check endpoints — SA-SKL-CORS40

SA-SKL-CORS40 documents four CORS misconfiguration patterns in MCP skill registry dependency and compatibility check endpoints. Dependency endpoints expose a skill's full technology graph — including private internal packages, vendor-pinned versions, and proprietary toolchain dependencies — that organizations deliberately keep off their public skill page. Credential-bearing CORS on these endpoints leaks that graph to any origin. Wildcard ACAO on compatibility check endpoints lets attackers exhaust per-org scan quotas silently. A timing oracle on the conflicts endpoint reveals which skills have dependency conflicts system-wide. And credential-bearing CORS on dependency deletion lets any origin break a skill's dependency graph via a single admin-session request.

SA-SKL-CORS40 findings at a glance
CRITICALCORS40-001 — cors({origin:true,credentials:true}) on GET /api/skills/:id/dependencies; any origin reads full dependency tree including private internal packages and pinned vendor versions using victim session
HIGHCORS40-002 — ACAO: * on POST /api/skills/:id/compatibility-check; any page initiates compatibility scans consuming victim org scan quota; no CSRF or rate-limit protection
MEDIUMCORS40-003 — ACAO origin reflection on GET /api/skills/:id/dependencies/conflicts emitted before ownership check; timing oracle reveals conflict existence system-wide across all orgs
CRITICALCORS40-004 — cors({origin:true,credentials:true}) on DELETE /api/skills/:id/dependencies/:depId; any origin removes any dependency from any skill using victim admin session; breaks skill resolution for all consumers

CORS40-001 — Credential-bearing CORS on dependency tree exposes private packages

The dependency tree endpoint at GET /api/skills/:id/dependencies returns the full recursive dependency graph for a skill, including both public registry dependencies and privately-registered internal packages. When configured with cors({origin:true,credentials:true}), this endpoint leaks the entire dependency graph — including internal package names, version pins, and dependency metadata that organizations keep private — to any origin that can present a victim's session cookie.

Organizations that build internal MCP skill toolchains often register private dependencies under namespaces like @corp/auth-helper or @internal/secret-manager. The existence of these packages in a skill's dependency tree reveals the organization's internal toolchain, which packages they have built in-house versus sourced from vendors, and which versions they are running. This information is frequently useful for supply-chain targeting: an attacker who knows an organization is pinned to @internal/auth-helper@2.3.1 knows exactly which version to look for vulnerabilities in.

CORS40-001 fix: Replace cors({origin:true,credentials:true}) with an explicit allowlist. Add requireSession before CORS middleware. For public callers (non-owners), return only the names of public registry dependencies, not private packages, internal versions, or dependency metadata.

// WRONG — full dependency tree including private packages to any origin
router.get('/skills/:id/dependencies',
  cors({origin: true, credentials: true}),
  async (req, res) => {
    const deps = await db.getFullDependencyTree(req.params.id);
    res.json(deps);
  }
);

// RIGHT — allowlist + session + visibility filter
router.get('/skills/:id/dependencies',
  requireSession,
  strictCors,
  async (req, res) => {
    const isOwner = await db.isSkillOwner(req.params.id, req.session.userId);
    const deps = isOwner
      ? await db.getFullDependencyTree(req.params.id)
      : await db.getPublicDependencies(req.params.id); // public registry deps only
    res.json(deps);
  }
);

CORS40-002 — Wildcard ACAO on compatibility check exhausts scan quota

The compatibility check endpoint POST /api/skills/:id/compatibility-check initiates a scan that verifies the skill's dependencies are compatible with target MCP client versions. Each check consumes quota against the requesting organization's monthly scan budget. With ACAO: *, any page can initiate compatibility checks on behalf of any user whose Bearer token is accessible via XSS — exhausting their quota silently.

Compatibility scans are computationally expensive: they typically spin up isolated environments for each target client version, resolve the full dependency tree, and run a subset of integration tests. Rate limits exist precisely to prevent abuse. The wildcard ACAO bypasses this protection for any organization whose frontend is exposed to XSS — a common situation for registries that host user-generated markdown documentation or embed third-party analytics scripts.

CORS40-002 fix: Remove the wildcard. Add requireSession, a CSRF token check, and a per-org rate limit enforced server-side. Compatibility checks requested via CI/CD pipelines should use scoped API keys, not session credentials.

CORS40-003 — Timing oracle on conflicts endpoint reveals system-wide conflict state

The conflicts endpoint GET /api/skills/:id/dependencies/conflicts reflects the Origin header before the ownership check executes. When a skill ID exists and has conflicts, the server queries the conflicts table (a relatively expensive join), discovers ownership mismatch, and returns 403. When no conflicts exist or the skill ID is unknown, it returns 404 faster. The latency difference is measurable cross-origin because the browser's performance.now() API measures time to first response header, which includes the CORS header emitted before the auth check.

An attacker uses this oracle to enumerate which skills across the entire registry have dependency conflicts — a signal that those skills may be in an inconsistent or partially-updated state, making them more susceptible to dependency confusion attacks or version pinning exploits.

CORS40-003 fix: Move CORS middleware after auth and ownership checks. Unify the WHERE clause to include both skillId and orgId. Normalize 403/404 response latency with a minimum-delay padding strategy.

CORS40-004 — Credential-bearing CORS on dependency delete breaks skill resolution

The dependency deletion endpoint DELETE /api/skills/:id/dependencies/:depId uses cors({origin:true,credentials:true}). An attacker who tricks an admin into visiting a malicious page can remove any dependency from any skill in the organization. Removing a required dependency causes skill resolution failures: when any consumer tries to install or update the skill, the resolver cannot find the now-missing dependency and fails. If the removed dependency is a transitive dependency shared across many skills, the blast radius encompasses the entire skill set that depends on it.

CORS40-004 fix: Replace credential-bearing CORS with an allowlist. Add requireRole('admin') and ownership verification. Use soft-delete (mark as status='removed') rather than hard-delete. Emit an audit log entry. Notify affected downstream consumers via webhook before the deletion takes effect.

// WRONG — hard dependency delete with credential-bearing CORS
router.delete('/skills/:id/dependencies/:depId',
  cors({origin: true, credentials: true}),
  async (req, res) => {
    await db.query('DELETE FROM skill_dependencies WHERE id = ?', [req.params.depId]);
    res.json({ ok: true });
  }
);

// RIGHT — allowlist, role check, soft-delete, audit log, notification
router.delete('/skills/:id/dependencies/:depId',
  requireSession,
  requireRole('admin'),
  strictCors,
  async (req, res) => {
    const dep = await db.getDependency(req.params.depId);
    if (!dep || dep.skillId !== req.params.id) return res.status(404).json({ error: 'not found' });
    const skill = await db.getSkill(req.params.id);
    if (skill.orgId !== req.session.orgId) return res.status(403).json({ error: 'forbidden' });

    await db.query(
      'UPDATE skill_dependencies SET status=\'removed\', removedBy=?, removedAt=NOW() WHERE id=?',
      [req.session.userId, req.params.depId]
    );
    await audit.log('dependency_removed', { depId: req.params.depId, skillId: req.params.id, adminId: req.session.userId });
    res.json({ ok: true });
  }
);
Detect SA-SKL-CORS40 in your registry

SkillAudit scans for credential-bearing CORS reflection, wildcard ACAO on mutation endpoints, and middleware-ordering timing oracles across all sub-routers in your MCP skill registry codebase.

Scan your registry
FindingSeverityEndpointImpact
CORS40-001CRITICALGET /api/skills/:id/dependenciesPrivate internal dependency tree exfiltration
CORS40-002HIGHPOST /api/skills/:id/compatibility-checkScan quota exhaustion; no CSRF or rate-limit protection
CORS40-003MEDIUMGET /api/skills/:id/dependencies/conflictsTiming oracle reveals conflict existence system-wide
CORS40-004CRITICALDELETE /api/skills/:id/dependencies/:depIdDependency deletion breaks skill resolution for all consumers

See also: SA-SKL-CORS39 (version and changelog endpoint CORS patterns) and SA-SKL-CORS39 deep dive blog post for the compound pre-disclosure attack chain that credential-bearing CORS on version and dependency endpoints enables when chained together.