← Blog

Claude MCP skill CORS misconfiguration — skill dependency and package manifest endpoints (SA-SKL-CORS79)

SA-SKL-CORS79 identifies four CORS misconfiguration vulnerabilities in MCP skill registry skill dependency and package manifest endpoints. Credential-bearing CORS on the dependency manifest retrieval endpoint exposes the complete dependency document including internal fork identifiers that reveal which private repositories the skill depends on, private package registry URLs that expose the organization's internal npm or PyPI mirror configuration, and admin-only vulnerability cross-reference annotations that describe known advisories affecting each dependency before those advisories have been publicly disclosed; wildcard ACAO on the dependency update endpoint allows any page to trigger a dependency resolution run under the victim admin's identity, and flooding these update requests exhausts the package registry API rate limits shared across all skills, causing dependency resolution failures during installation for every user across the registry; a timing oracle on the dependency audit endpoint reveals which skills have active dependency vulnerability audit jobs in progress by exploiting the cache latency differential between audit-active entries (~6ms) and cold lookups (~185ms) without reading the response body; and credential-bearing CORS on the dependency deletion endpoint allows any page to permanently remove individual dependencies from a skill's manifest, breaking installation for every downstream user who attempts to install the skill.

SA-SKL-CORS79 findings at a glance
CRITICALCORS79-001 — GET /api/skills/:id/dependencies has cors({origin:true,credentials:true}) — any origin reads full dependency manifest including internal fork identifiers, private package registry URLs, and admin-only vulnerability cross-reference annotations using victim admin session
HIGHCORS79-002 — POST /api/skills/:id/dependencies/update has ACAO:* — any page triggers dependency update under victim admin identity; attacker floods update requests exhausting package registry API rate limits causing dependency resolution DoS for all skills
MEDIUMCORS79-003 — GET /api/skills/:id/dependencies/audit reflects Origin before auth check — timing oracle reveals skills with active dependency vulnerability audits in progress (audit-active warm cache ~6ms vs cold ~185ms)
CRITICALCORS79-004 — DELETE /api/skills/:id/dependencies/:packageName has cors({origin:true,credentials:true}) — any origin removes dependencies from skill manifest permanently breaking skill installation for all users

CORS79-001 — Credential-bearing CORS exposes private registry URLs and admin-only vulnerability annotations

The GET /api/skills/:id/dependencies endpoint returns the full dependency manifest for the authenticated admin session. This document includes internal fork identifiers pointing to private GitHub repositories or internal GitLab instances, private package registry URLs revealing the organization's npm or PyPI mirror configuration that should never be exposed externally, and admin-only vulnerability cross-reference annotations that map each dependency version to known CVEs whose public advisories are still inside the embargo window. With cors({origin:true,credentials:true}) applied before the authentication check, any cross-origin page visited by an authenticated admin user can retrieve this document in full, exposing supply-chain configuration details and pre-disclosure advisory information to any attacker who can lure the admin to visit their page.

Vulnerable
// CORS79-001 — VULNERABLE
router.get('/skills/:id/dependencies',
  cors({ origin: true, credentials: true }),  // reflects any Origin
  requireSession,
  async (req, res) => {
    const isAdmin = req.session.roles.includes('registry_admin');
    const manifest = await db.getDependencyManifest(req.params.id, { includeAdminAnnotations: isAdmin });
    res.json(manifest);
  }
);
Fixed
// CORS79-001 — FIXED: auth before CORS; strip private fields for non-admins
router.get('/skills/:id/dependencies',
  requireSession,
  applyCorsAllowlist,
  async (req, res) => {
    const isAdmin = req.session.roles.includes('registry_admin');
    const manifest = await db.getDependencyManifest(req.params.id, { includeAdminAnnotations: isAdmin });
    if (!isAdmin) {
      manifest.dependencies = manifest.dependencies.map(
        ({ internalForkRef, privateRegistryUrl, adminVulnAnnotations, ...pub }) => pub
      );
    }
    res.json(manifest);
  }
);

CORS79-002 — Wildcard ACAO on dependency update exhausts package registry rate limits

The POST /api/skills/:id/dependencies/update endpoint resolves and refreshes all dependency versions in the skill manifest, consuming package registry API quota for each request. With ACAO:*, any page can trigger this endpoint under the victim admin's session. An attacker floods update requests across multiple skills simultaneously, exhausting the shared package registry API rate-limit budget for the entire registry. When the rate limit is depleted, every user attempting to install any skill encounters dependency resolution failures, causing an effective installation DoS across the registry that persists until the rate-limit window resets.

Vulnerable
// CORS79-002 — VULNERABLE: wildcard ACAO on dependency update endpoint
router.post('/skills/:id/dependencies/update',
  cors({ origin: '*' }),
  requireSession,
  requireDependencyWritePermission,
  async (req, res) => {
    const jobId = await dependencyQueue.enqueue({
      skillId: req.params.id, type: 'dependency_update',
      triggeredBy: req.session.userId
    });
    res.json({ jobId });
  }
);
Fixed
// CORS79-002 — FIXED: allowlist CORS; CSRF token; per-skill rate limit
router.post('/skills/:id/dependencies/update',
  requireSession,
  requireDependencyWritePermission,
  applyCorsAllowlist,
  validateCsrfToken,
  async (req, res) => {
    const rlKey = `deps:update:ratelimit:${req.params.id}`;
    if (await redis.get(rlKey)) {
      return res.status(429).json({ error: 'update_rate_limited', retryAfterSeconds: 3600 });
    }
    await redis.set(rlKey, '1', 'EX', 3600);
    const jobId = await dependencyQueue.enqueue({
      skillId: req.params.id, type: 'dependency_update',
      triggeredBy: req.session.userId
    });
    res.json({ jobId });
  }
);

CORS79-003 — Timing oracle reveals skills with active dependency vulnerability audits

The GET /api/skills/:id/dependencies/audit endpoint reflects the caller's Origin header before the authentication middleware runs. Skills with an active dependency vulnerability audit job have a hot Redis cache entry for the audit state (~6ms). Skills with no current audit job fall through to a database lookup (~185ms). An attacker probing the latency of this endpoint across the catalog identifies skills with in-progress vulnerability audits — skills that may have recently disclosed or discovered supply-chain vulnerabilities not yet published, giving the attacker advance intelligence on which skills are under active security review before any public disclosure.

Vulnerable
// CORS79-003 — VULNERABLE: Origin reflected before auth check
router.get('/skills/:id/dependencies/audit',
  (req, res, next) => {
    res.set('Access-Control-Allow-Origin', req.headers.origin || '*');
    res.set('Access-Control-Allow-Credentials', 'true');
    next();
  },
  requireSession,  // too late — timing observable
  async (req, res) => {
    const cached = await redis.get(`deps:audit:${req.params.id}`);
    if (cached) return res.json(JSON.parse(cached));  // ~6ms
    const audit = await db.getDependencyAuditState(req.params.id);  // ~185ms
    res.json(audit);
  }
);
Fixed
// CORS79-003 — FIXED: auth before CORS; constant-time response floor 50ms
router.get('/skills/:id/dependencies/audit',
  requireSession,
  applyCorsAllowlist,
  async (req, res) => {
    const start = Date.now();
    const cached = await redis.get(`deps:audit:${req.params.id}`);
    const result = cached
      ? JSON.parse(cached)
      : await db.getDependencyAuditState(req.params.id);
    const pad = Math.max(0, 50 - (Date.now() - start));
    if (pad > 0) await new Promise(r => setTimeout(r, pad));
    res.json(result);
  }
);

CORS79-004 — Credential-bearing CORS permanently removes dependencies breaking skill installation

The DELETE /api/skills/:id/dependencies/:packageName endpoint performs a hard removal of a declared dependency from the skill manifest. With cors({origin:true,credentials:true}), any page visited by an authenticated admin can remove any dependency from any skill. An attacker who systematically removes core dependencies from popular skills causes installation failures for every user who attempts to install the affected skills. Downstream users receive missing-dependency errors with no visible explanation, breaking workflows and eroding trust in the registry's reliability. Because the deletion is applied to the canonical manifest rather than a local copy, the damage affects every future installation until a maintainer notices and manually re-adds the removed dependency.

Vulnerable
// CORS79-004 — VULNERABLE: credential-bearing CORS on dependency deletion
router.delete('/skills/:id/dependencies/:packageName',
  cors({ origin: true, credentials: true }),
  requireSession,
  requireDependencyAdminPermission,
  async (req, res) => {
    // Hard delete — no soft-delete, no recovery
    const result = await db.query(
      'DELETE FROM skill_dependencies WHERE skill_id=$1 AND package_name=$2',
      [req.params.id, req.params.packageName]
    );
    res.json({ deleted: result.rowCount });
  }
);
Fixed
// CORS79-004 — FIXED: auth first; allowlist CORS; re-auth; soft-delete with retention; audit log
router.delete('/skills/:id/dependencies/:packageName',
  requireSession,
  requireDependencyAdminPermission,
  applyCorsAllowlist,
  requireRecentReAuthentication(300),
  async (req, res) => {
    const now = new Date().toISOString();
    const retentionExpiry = new Date(Date.now() + 90 * 24 * 3600 * 1000).toISOString();
    const result = await db.query(
      `UPDATE skill_dependencies SET deleted_at=$1, retention_expiry=$2, deleted_by=$3
       WHERE skill_id=$4 AND package_name=$5 AND deleted_at IS NULL`,
      [now, retentionExpiry, req.session.userId, req.params.id, req.params.packageName]
    );
    await auditLog.record({
      action: 'dependency_removal', actorId: req.session.userId,
      skillId: req.params.id, packageName: req.params.packageName, retentionExpiry
    });
    res.json({ softDeleted: result.rowCount, retentionExpiry });
  }
);

SkillAudit detects all SA-SKL-CORS79 patterns via static AST analysis. Run a free audit on your MCP skill or Claude plugin and get a graded report with fix guidance in under 60 seconds.