← Security advisories

Claude MCP skill CORS misconfiguration — skill dependency vulnerability scanning and patch management endpoints — SA-SKL-CORS63

SA-SKL-CORS63 documents four CORS misconfiguration vulnerabilities in MCP skill registry dependency vulnerability scanning and patch management endpoints. Vulnerability scanning endpoints govern when CVE data is surfaced, which alerts are suppressed, and what remediation history exists for published skills — including unpublished CVE identifiers, CVSS scores, affected dependency versions, and scheduled patch release timelines that have not yet been publicly disclosed. CORS63 identifies four distinct cross-origin attack paths: credential-bearing CORS on the scan results endpoint exposes full vulnerability intelligence including embargoed CVE details to any origin; wildcard ACAO on the suppression endpoint allows any page to silently disable critical CVE alerts under victim admin identity, preventing vulnerability scanners from alerting teams to active exploits in production; a timing oracle via Origin reflection before ownership check identifies skills with active vulnerability management cycles as high-value exfiltration targets; and credential-bearing CORS on the scan result deletion endpoint allows any cross-origin page to erase vulnerability findings, eliminating evidence of known security issues and creating remediation tracking gaps.

SA-SKL-CORS63 findings at a glance
CRITICALCORS63-001 — GET /api/skills/:id/vulnerability-scan has cors({origin:true,credentials:true}) — any origin reads full vulnerability scan results including unpublished CVEs, CVSS scores, and affected dependency trees using victim admin session; reveals internal vulnerability management backlog and patch priorities before public disclosure; fix: per-route allowlist cors; requireSession + requireRole('admin'); never return unpublished CVE identifiers or embargoed CVSS scores to non-admin callers
CRITICALCORS63-002 — POST /api/skills/:id/vulnerability-scan/suppress has ACAO:* — any page creates attacker-controlled suppression entries under victim admin identity; attacker suppresses critical CVE alerts preventing vulnerability scanner from alerting team to active exploits in production dependencies; fix: remove wildcard; requireSession; requireRole('admin'); CSRF token; Zod SuppressionSchema with CVE-ID and justification fields; audit log with origin
MEDIUMCORS63-003 — GET /api/skills/:id/vulnerability-scan/schedule reflects Origin before ownership check — timing oracle reveals scan schedule modification velocity identifying skills with active vulnerability management cycles as CORS63-001 targets; fix: auth before CORS; unified WHERE; 60ms constant-time floor
CRITICALCORS63-004 — DELETE /api/skills/:id/vulnerability-scan/results/:resultId has cors({origin:true,credentials:true}) — any origin removes any scan result using victim admin session, erasing evidence of vulnerability findings and preventing patch tracking systems from detecting remediation gaps; fix: allowlist + requireSession + ownership check + notify skill owner + audit log; soft-delete published scan results preserving compliance audit trail

CORS63-001 — Credential-bearing CORS on vulnerability scan results exposes embargoed CVE intelligence

Severity: CRITICAL

The vulnerability scan results endpoint is configured with cors({origin:true,credentials:true}) applied at the router level, reflecting any Origin header as an allowed origin while setting Access-Control-Allow-Credentials: true. Any web page can issue a credentialed cross-origin request and receive complete vulnerability scan results including CVE identifiers that are under embargo, CVSS base scores that have not been published, and the full affected dependency tree with version ranges.

Vulnerability scan results in a registry typically contain three tiers of sensitive data: published CVE references that are already public (low sensitivity), CVE identifiers that the registry has detected and queued for disclosure but not yet announced (medium sensitivity — reveals the registry's internal detection timeline), and embargoed CVE details received from coordinated disclosure programs that the registry is holding under NDA until the upstream maintainer ships a patch (high sensitivity — premature disclosure breaks coordinated disclosure agreements and may alert attackers before defenders have a patch available). An attacker receiving embargoed CVE details cross-origin can exploit the vulnerability window before the patch is released.

Vulnerable
// GET /api/skills/:id/vulnerability-scan — cors({origin:true,credentials:true}) at router level
router.use(cors({ origin: true, credentials: true }));

router.get('/:id/vulnerability-scan', requireSession, async (req, res) => {
  const results = await VulnScan.find({ skillId: req.params.id }).sort({ detectedAt: -1 });
  return res.json(results);  // exposes embargoed CVE IDs, unpublished CVSS scores, full dep tree
});
Fixed
// GET /api/skills/:id/vulnerability-scan — per-route allowlist cors + role-scoped fields
const ALLOWED = process.env.ALLOWED_ORIGINS.split(',');
const vulnCors = cors({ origin: ALLOWED, credentials: true });

router.get('/:id/vulnerability-scan', vulnCors, requireSession, requireRole('admin'), async (req, res) => {
  const results = await VulnScan.find({ skillId: req.params.id, embargoed: false })
    .select('+cveId +cvss +affectedVersions +patchedVersion -embargoedCveId -embargoedCvss -internalNotes')
    .sort({ detectedAt: -1 });
  return res.json(results.map(r => ({
    cveId:            r.cveId,
    cvss:             r.cvss,
    severity:         r.severity,
    affectedVersions: r.affectedVersions,
    patchedVersion:   r.patchedVersion,
    // embargoedCveId and internalNotes intentionally omitted
  })));
});

The fix applies CORS on a per-route basis using an explicit allowlist. Embargoed CVE identifiers, unreleased CVSS scores, and internal analyst notes are never included in list responses — they are available only via a separate admin-only embargoed-findings endpoint protected by additional audit logging and IP restriction. This ensures that even a compromised admin session reached via CORS cannot extract coordinated disclosure intelligence from the vulnerability scan API.

CORS63-002 — Wildcard ACAO on suppression endpoint enables silent CVE alert disabling

Severity: CRITICAL

The vulnerability suppression creation endpoint returns Access-Control-Allow-Origin: * regardless of requesting origin. The endpoint requires a valid session but no role boundary or CSRF check. Any web page can submit a suppression creation request using the victim admin's session, with the attacker controlling the CVE identifier, suppression justification, and expiry period.

An attacker who creates suppression entries for critical CVEs in a target skill's dependency tree effectively blinds the vulnerability scanner. When developers install the affected skill in their project, their scanner queries the registry's suppression list and skips alerting on suppressed CVEs. The suppression entry carries the legitimate admin's user ID and appears at a time when that admin had an active session — it is indistinguishable from a deliberate false-positive suppression decision. Teams relying on the registry's suppression data to tune their scanners will continue shipping vulnerable dependencies without alerts until the suppression entry expires or is manually audited.

Vulnerable
// POST /api/skills/:id/vulnerability-scan/suppress — ACAO:* from upstream cors() middleware
// No CSRF, no role boundary, no Zod schema, no audit log origin
router.post('/:id/vulnerability-scan/suppress', requireSession, async (req, res) => {
  const { cveId, justification, expiresAt } = req.body;
  const entry = await Suppression.create({
    skillId:       req.params.id,
    createdBy:     req.session.userId,
    cveId,          // attacker-controlled: suppress any CVE including CRITICAL severity
    justification,  // attacker-controlled: 'false positive' masks real vulnerability
    expiresAt,
  });
  return res.status(201).json(entry);
});
Fixed
// POST /api/skills/:id/vulnerability-scan/suppress — allowlist cors + requireRole + CSRF + Zod + audit log
import { z } from 'zod';
const SuppressionSchema = z.object({
  cveId:         z.string().regex(/^CVE-\d{4}-\d{4,}$/),
  justification: z.string().min(20).max(2000),
  expiresAt:     z.string().datetime().optional(),
  maxSeverity:   z.enum(['LOW', 'MEDIUM', 'HIGH']),  // CRITICAL suppressions require extra review
});

router.post('/:id/vulnerability-scan/suppress', vulnCors, requireSession, requireRole('security_admin'), verifyCsrf,
  async (req, res) => {
    const parsed = SuppressionSchema.safeParse(req.body);
    if (!parsed.success) return res.status(400).json({ error: 'Invalid suppression payload', issues: parsed.error.issues });
    const entry = await Suppression.create({ skillId: req.params.id, createdBy: req.session.userId, ...parsed.data });
    await AuditLog.create({ action: 'vuln.suppression.created', actorId: req.session.userId,
      skillId: req.params.id, suppressionId: entry.id, cveId: parsed.data.cveId,
      origin: req.headers.origin, at: new Date() });
    return res.status(201).json({ id: entry.id });
  }
);

CORS63-003 — Timing oracle on scan schedule endpoint identifies active vulnerability management cycles

Severity: MEDIUM

The vulnerability scan schedule endpoint reflects the Origin header as Access-Control-Allow-Origin before the ownership check executes. This creates a timing oracle: the endpoint serves cached results for skills with recent schedule modifications in under 5 ms (from an in-memory LRU cache), while skills with no recent activity require a full database query that takes 20–50 ms. The latency difference is cross-origin-detectable without reading the response body — the browser measures round-trip time and derives whether the skill has an active vulnerability management cycle from response time alone.

Scan schedule modifications cluster around specific events: when a new CVE advisory lands and an admin triggers an immediate scan, when a coordinated disclosure embargo lifts and the team accelerates patching, or when a security team is running catch-up scans after an incident. These are exactly when admins are working in the vulnerability management console with an active session. An attacker probing skills in parallel with cross-origin timing requests identifies which skills have live vulnerability management sessions before issuing CORS63-001 credential-bearing requests against those same skill endpoints.

Vulnerable
// GET /api/skills/:id/vulnerability-scan/schedule — Origin reflected before auth
router.get('/:id/vulnerability-scan/schedule', async (req, res) => {
  res.setHeader('Access-Control-Allow-Origin', req.headers.origin || '*');
  res.setHeader('Access-Control-Allow-Credentials', 'true');
  const skill = await Skill.findById(req.params.id);
  if (!skill || skill.ownerId !== req.session?.userId) return res.status(403).json({ error: 'Forbidden' });
  const schedule = scanScheduleCache.get(req.params.id) || await ScanSchedule.findOne({ skillId: req.params.id });
  return res.json(schedule);
});
Fixed
// GET /api/skills/:id/vulnerability-scan/schedule — auth before CORS + constant-time floor
router.get('/:id/vulnerability-scan/schedule', requireSession, async (req, res) => {
  const start = Date.now();
  const skill = await Skill.findOne({ _id: req.params.id, ownerId: req.session.userId });
  if (!skill) { await sleep(Math.max(0, 60 - (Date.now() - start))); return res.status(404).json({ error: 'Not found' }); }
  vulnCors(req, res, async () => {
    const schedule = scanScheduleCache.get(req.params.id) || await ScanSchedule.findOne({ skillId: req.params.id });
    await sleep(Math.max(0, 60 - (Date.now() - start)));
    return res.json(schedule);
  });
});

CORS63-004 — Credential-bearing CORS on scan result deletion erases vulnerability evidence

Severity: CRITICAL

The scan result deletion endpoint shares the router-level cors({origin:true,credentials:true}) policy from CORS63-001. Any web page can issue a credentialed DELETE request using the victim admin's session. The endpoint performs no ownership check — it deletes any scan result by ID without verifying the caller has authority over the skill.

When a skill's vulnerability scan results are deleted, patch tracking systems lose the historical record of which vulnerabilities were detected and when they were remediated. Enterprise CI pipelines that query scan history to verify remediation SLA compliance will find no results and either skip the check (treating no-data as compliant) or flag the skill as never-scanned. Skills can have their entire vulnerability history erased from a single cross-origin session without any notification to the skill publisher — the deletion is performed with the legitimate admin's credentials and passes all authorization checks that only verify authentication status, not cross-origin request origin.

Vulnerable
// DELETE /api/skills/:id/vulnerability-scan/results/:resultId
// cors({origin:true,credentials:true}) from router.use()
// No ownership check, no audit log, no notification, no soft-delete
router.delete('/:id/vulnerability-scan/results/:resultId', requireSession, async (req, res) => {
  await VulnScan.deleteOne({ _id: req.params.resultId });
  return res.status(204).end();
});
Fixed
// DELETE /api/skills/:id/vulnerability-scan/results/:resultId
// Per-route allowlist CORS + ownership check + soft-delete + audit log + notification
router.delete('/:id/vulnerability-scan/results/:resultId', vulnCors, requireSession, async (req, res) => {
  const result = await VulnScan.findOne({ _id: req.params.resultId, skillId: req.params.id });
  if (!result) return res.status(404).json({ error: 'Scan result not found' });
  const isAdmin   = req.session.role === 'admin' || req.session.role === 'security_admin';
  const isOwner   = String(result.skillOwnerId) === req.session.userId;
  if (!isAdmin && !isOwner) return res.status(403).json({ error: 'Forbidden' });
  // soft-delete published scan results — preserve compliance audit trail
  await result.updateOne({ deletedAt: new Date(), deletedBy: req.session.userId });
  await AuditLog.create({ action: 'vuln.result.deleted', actorId: req.session.userId,
    resultId: req.params.resultId, skillId: req.params.id,
    cveId: result.cveId, severity: result.severity, origin: req.headers.origin, at: new Date() });
  if (!isOwner) await notify(result.skillOwnerId, { type: 'vuln.result.deleted',
    resultId: req.params.resultId, skillId: req.params.id, by: req.session.userId, cveId: result.cveId });
  return res.status(204).end();
});

The fix soft-deletes published scan results rather than hard-deleting them, preserving the compliance audit trail required by enterprise patch tracking and SLA verification systems. The notification mechanism alerts the skill owner when deletion is performed by a third party, enabling rapid detection of cross-origin deletion attacks. The audit log records the CVE identifier and severity alongside the origin header — enabling post-incident reconstruction of which vulnerabilities were documented before deletion.

Run SkillAudit to detect cors({origin:true,credentials:true}) on vulnerability scan endpoints, wildcard ACAO on CVE suppression routes, and Origin reflection before auth in your MCP skill registry source code. Join the waitlist for access.