← Security advisories

Claude MCP skill CORS misconfiguration — skill permission and access control list endpoints — SA-SKL-CORS42

SA-SKL-CORS42 documents four CORS misconfiguration patterns in MCP skill registry permission and access control list endpoints. Permission endpoints manage the most security-critical resource in a skill registry — who can read, write, publish, and administer each skill. Credential-bearing CORS on ACL read endpoints hands the full member permission tree to any origin. Wildcard ACAO on permission grant endpoints lets any page add attacker-controlled members to private skills. A timing oracle on the inherited permission endpoint reveals role chain existence system-wide. And credential-bearing CORS on member revocation lets any origin lock out legitimate collaborators using a victim admin session.

SA-SKL-CORS42 findings at a glance
CRITICALCORS42-001 — cors({origin:true,credentials:true}) on GET /api/skills/:id/permissions; any origin reads full ACL including member permissions, team assignments, and inherited role tree using victim session
CRITICALCORS42-002 — ACAO: * on POST /api/skills/:id/permissions; any page grants arbitrary permissions on behalf of victim org admin, adding attacker-controlled members to private skills; exploitable via XSS with Bearer token
MEDIUMCORS42-003 — ACAO origin reflection on GET /api/skills/:id/permissions/inherited emitted before ownership check; timing oracle reveals inherited permission chain existence across all orgs
CRITICALCORS42-004 — cors({origin:true,credentials:true}) on DELETE /api/skills/:id/permissions/:memberId; any origin revokes any member's access to any skill using victim admin session, locking out legitimate collaborators

CORS42-001 — Credential-bearing CORS on ACL read leaks full permission tree

The permissions endpoint at GET /api/skills/:id/permissions returns the complete access control list for a skill: each member's permission level (read, write, publish, admin), their team assignments, and the inherited role tree derived from org-level group memberships. When this endpoint is configured with cors({origin:true,credentials:true}), any origin that can run JavaScript in a browser can read this data using the victim's session cookie — without any action on the victim's part beyond visiting a URL.

The ACL is strategically sensitive for two distinct attacker profiles. For a competitor, it reveals the full organizational structure behind a private skill: who is authorized to publish it, which teams are assigned admin access, and whether any external contractors or partner org members are listed as contributors. For an attacker planning a targeted compromise, the ACL is a directory of high-privilege accounts — it identifies exactly which user IDs hold publish and admin roles, making those accounts the highest-value targets for credential stuffing, phishing, or social engineering attacks against the skill's supply chain.

CORS42-001 fix: Replace cors({origin:true,credentials:true}) with an explicit allowlist. Add requireSession before CORS middleware. For public callers (non-members), return only the public visibility setting — never member permissions, team assignments, or inherited role tree.

WRONG
router.get('/skills/:id/permissions',
  cors({ origin: true, credentials: true }),
  async (req, res) => {
    const acl = await db.getSkillPermissions(req.params.id);
    res.json(acl); // includes members, teams, inherited roles
  }
);
RIGHT
router.get('/skills/:id/permissions',
  requireSession,
  strictCors,
  async (req, res) => {
    const isMember = await db.isSkillMember(req.params.id, req.session.orgId);
    if (!isMember) {
      // public callers: visibility setting only
      const skill = await db.getSkill(req.params.id);
      return res.json({ visibility: skill?.visibility ?? 'private' });
    }
    const acl = await db.getSkillPermissions(req.params.id);
    res.json(acl);
  }
);

CORS42-002 — Wildcard ACAO on permission grant enables unauthorized member addition

The permission grant endpoint POST /api/skills/:id/permissions adds a new member to a skill's ACL with a specified role. With ACAO: *, any page that holds the victim org admin's Bearer token (via XSS in the registry frontend) can submit a permission grant request adding an attacker-controlled user ID as an admin member of any private skill. The attacker gains persistent write and admin access to the skill without the org admin ever being notified — no invitation email, no consent prompt, no audit trail visible to the owner in the default dashboard view.

This attack is particularly damaging for private skills that represent proprietary tooling: once the attacker holds admin permission, they can read the skill's private source code via the registry API, modify its publish configuration to route future versions through an attacker-controlled pipeline, or add additional attacker-controlled members before the initial grant is discovered. The permission record survives session invalidation, password resets, and token rotation unless explicitly removed.

CORS42-002 fix: Remove wildcard. Require session. Add CSRF token. Require requireRole('admin') and skill ownership verification. Emit an audit log entry and trigger a notification email to existing admins on every permission grant.

// WRONG — wildcard; anyone with a Bearer token can add members
router.post('/skills/:id/permissions',
  cors({ origin: '*' }),
  async (req, res) => {
    await db.grantPermission(req.params.id, req.body.userId, req.body.role);
    res.json({ ok: true });
  }
);

// RIGHT — allowlist + session + CSRF + admin role + audit log
router.post('/skills/:id/permissions',
  requireSession,
  requireRole('admin'),
  strictCors,
  verifyCsrfToken,
  async (req, res) => {
    const skill = await db.getSkill(req.params.id);
    if (!skill || skill.orgId !== req.session.orgId) return res.status(403).json({ error: 'forbidden' });
    await db.grantPermission(req.params.id, req.body.userId, req.body.role);
    await audit.log('permission_granted', { skillId: req.params.id, grantedTo: req.body.userId, role: req.body.role, grantedBy: req.session.userId });
    await notifications.notifyAdmins(req.params.id, 'permission_granted', req.body.userId);
    res.json({ ok: true });
  }
);

CORS42-003 — Timing oracle on inherited permission endpoint reveals role chain existence

The inherited permissions endpoint GET /api/skills/:id/permissions/inherited reflects the Origin header before the ownership check executes. When a skill has inherited permission chains (org-level group memberships resolved into skill-level roles), the server executes a multi-join query across the org, team, and skill_permission tables — a measurably slower operation than the immediate 404 returned when the skill ID is unknown. The latency difference is cross-origin observable via performance.now().

An attacker uses this oracle to enumerate which private skills have complex inherited permission structures — a signal that those skills are managed by larger organizations with structured team hierarchies. Skills with inherited permission chains are higher-value targets for the CORS42-001 credential-bearing read, since their ACL is likely to contain more members and more team assignments worth exfiltrating.

CORS42-003 fix: Move CORS middleware after auth and ownership checks. Unify the WHERE clause to include both skillId and orgId. Apply a minimum-latency strategy to normalize 403 and 404 response times. Never emit the ACAO header for requests that fail authorization.

CORS42-004 — Credential-bearing CORS on member revocation locks out legitimate collaborators

The permission revocation endpoint DELETE /api/skills/:id/permissions/:memberId uses cors({origin:true,credentials:true}). An attacker who tricks an org admin into visiting a malicious page can revoke the access of any member from any skill in the organization. The impact extends beyond the targeted victim: in a CI/CD pipeline where the publish bot is listed as a member of the skill, revoking the bot's permission breaks every automated deployment that depends on it. For a team skill with multiple contributor members, revoking all non-admin members silently locks out the development team from the skill they maintain.

Permission revocation attacks are particularly insidious because they are operationally disruptive without being immediately visible. The revoked member simply receives 403 on their next API call. The error looks like a transient permission issue. By the time the problem is diagnosed as an unauthorized revocation rather than a configuration mistake, the attacker may have used the disruption window to substitute their own access (via CORS42-002) while the legitimate members were locked out.

CORS42-004 fix: Replace credential-bearing CORS with an explicit allowlist. Add requireRole('admin') and skill ownership verification. Require CSRF token. Emit an audit log entry and notification email to the revoked member. Prevent self-revocation of the last admin to avoid accidental lockout.

// WRONG — credential-bearing CORS; any origin revokes any member
router.delete('/skills/:id/permissions/:memberId',
  cors({ origin: true, credentials: true }),
  async (req, res) => {
    await db.revokePermission(req.params.id, req.params.memberId);
    res.json({ ok: true });
  }
);

// RIGHT — allowlist + admin role + ownership check + audit log + last-admin guard
router.delete('/skills/:id/permissions/:memberId',
  requireSession,
  requireRole('admin'),
  strictCors,
  verifyCsrfToken,
  async (req, res) => {
    const skill = await db.getSkill(req.params.id);
    if (!skill || skill.orgId !== req.session.orgId) return res.status(403).json({ error: 'forbidden' });

    const admins = await db.getSkillAdmins(req.params.id);
    if (admins.length === 1 && admins[0].userId === req.params.memberId) {
      return res.status(400).json({ error: 'cannot revoke last admin' });
    }

    await db.revokePermission(req.params.id, req.params.memberId);
    await audit.log('permission_revoked', { skillId: req.params.id, revokedUserId: req.params.memberId, revokedBy: req.session.userId });
    res.json({ ok: true });
  }
);
Detect SA-SKL-CORS42 in your registry

SkillAudit scans for credential-bearing CORS reflection on permission endpoints, wildcard ACAO on permission grant operations, and middleware ordering that emits CORS before auth — across all permission and ACL sub-routers in your MCP skill registry codebase.

Scan your registry
FindingSeverityEndpointImpact
CORS42-001CRITICALGET /api/skills/:id/permissionsFull ACL exfiltration including member permissions, team assignments, and inherited role tree
CORS42-002CRITICALPOST /api/skills/:id/permissionsUnauthorized member addition to private skills; persistent backdoor access via attacker-controlled user ID
CORS42-003MEDIUMGET /api/skills/:id/permissions/inheritedTiming oracle reveals inherited permission chain existence across all orgs
CORS42-004CRITICALDELETE /api/skills/:id/permissions/:memberIdMember access revocation locks out collaborators and CI/CD bots; enables disruption-then-substitution attack

See also: SA-SKL-CORS41 (analytics endpoint CORS patterns) and SA-SKL-CORS41 deep dive blog post for the compound competitive intelligence exfiltration chain that credential-bearing CORS enables across analytics and permission endpoints.