← Security advisories

Claude MCP skill CORS misconfiguration — skill automated testing and QA pipeline endpoints — SA-SKL-CORS64

SA-SKL-CORS64 documents four CORS misconfiguration vulnerabilities in MCP skill registry automated testing and QA pipeline endpoints. Test results endpoints govern which QA findings are surfaced, which test failures are suppressed, and what testing history exists for published skills — including failed security test cases, internal QA notes with pending regression fixes, and scheduled QA cycle timelines. CORS64-001: credential-bearing CORS exposes full test results including internal QA backlog to any origin; CORS64-002: wildcard ACAO on test suppression endpoint silently disables critical security test failure alerts allowing vulnerable skills to pass QA; CORS64-003: timing oracle via Origin reflection identifies active QA cycles as exfiltration targets; CORS64-004: credential-bearing CORS on test result deletion erases evidence of failed security tests enabling retroactive QA gate bypass.

SA-SKL-CORS64 findings at a glance
CRITICALCORS64-001 — GET /api/skills/:id/test-results has cors({origin:true,credentials:true}) — any origin reads full test results including failed security test cases, internal QA notes, and pending regression fixes using victim admin session; reveals internal QA backlog and upcoming fix timeline before public release; fix: per-route allowlist cors; requireSession + requireRole('admin'); never return internal QA notes or pending regression fix details to non-admin callers
CRITICALCORS64-002 — POST /api/skills/:id/test-results/suppress has ACAO:* — any page creates attacker-controlled test suppression entries under victim admin identity; attacker suppresses critical security test failures allowing vulnerable skills to pass QA gate; fix: remove wildcard; requireSession; requireRole('qa_admin'); CSRF token; Zod TestSuppressionSchema with testId and severity fields; audit log with origin
MEDIUMCORS64-003 — GET /api/skills/:id/test-results/schedule reflects Origin before ownership check — timing oracle reveals test schedule modification velocity identifying skills with active QA cycles as CORS64-001 targets; fix: auth before CORS; unified WHERE; 60ms constant-time floor
CRITICALCORS64-004 — DELETE /api/skills/:id/test-results/:resultId has cors({origin:true,credentials:true}) — any origin removes any test result using victim admin session, erasing evidence of failed security tests and enabling retroactive QA gate bypass; fix: allowlist + requireSession + ownership check + soft-delete published test results + audit log + notify skill owner

CORS64-001 — Credential-bearing CORS on test results endpoint exposes internal QA backlog

Severity: CRITICAL

The test 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 test results including failed security test cases, internal QA notes documenting known issues, regression fix identifiers, and QA backlog references that expose the team's remediation timeline before skills are publicly released.

QA test results in a registry typically contain several tiers of sensitive data: test pass/fail status visible to skill owners (low sensitivity), internal QA notes written by security reviewers documenting discovered issues and planned fixes (high sensitivity — reveals what the registry knows about a skill's weaknesses and what timeline the team is tracking), and regression fix identifiers that cross-reference internal issue trackers containing full exploit details (critical sensitivity — these references expose the full vulnerability context before the skill owner has shipped a fix). An attacker who reads these internal notes and backlog references knows exactly which skills have known but unpatched security issues, allowing targeted exploitation before fixes are deployed.

Vulnerable
router.use(cors({ origin: true, credentials: true }));
router.get('/:id/test-results', requireSession, async (req, res) => {
  const results = await TestResult.find({ skillId: req.params.id }).sort({ runAt: -1 });
  return res.json(results);  // exposes failed security tests, internal QA notes, regression backlog
});
Fixed
const ALLOWED = process.env.ALLOWED_ORIGINS.split(',');
const testCors = cors({ origin: ALLOWED, credentials: true });
router.get('/:id/test-results', testCors, requireSession, requireRole('admin'), async (req, res) => {
  const results = await TestResult.find({ skillId: req.params.id, status: { $in: ['pass','fail','skip'] } })
    .select('+testId +testName +status +runAt -internalNotes -regressionFixId -qaBacklogRef')
    .sort({ runAt: -1 });
  return res.json(results.map(r => ({ testId: r.testId, testName: r.testName, status: r.status, runAt: r.runAt })));
});

The fix applies CORS on a per-route basis using an explicit allowlist from environment configuration. Internal QA notes, regression fix identifiers, and QA backlog references are stripped at the query projection level and never included in list responses. Only the sanitized public fields — test identifier, name, status, and run timestamp — are returned, ensuring that even a compromised admin session reached via CORS cannot extract the team's internal remediation backlog through the test results API.

CORS64-002 — Wildcard ACAO on test suppression endpoint enables silent security test failure disabling

Severity: CRITICAL

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

An attacker who creates suppression entries for critical security tests in a target skill's QA pipeline effectively blinds the QA gate. When the affected skill goes through automated testing before publication, the QA pipeline queries the suppression list and skips alerting on suppressed test failures — the skill passes the security gate with known vulnerabilities undetected. The suppression entry carries the legitimate admin's user ID, appears at a time when the admin had an active session, and bears a plausible justification string crafted by the attacker. Skills with suppressed security test failures can be published to the registry and distributed to downstream MCP clients that trust the registry's QA certification without any visible indication that security tests were bypassed.

Vulnerable
router.post('/:id/test-results/suppress', requireSession, async (req, res) => {
  const { testId, justification, expiresAt } = req.body;
  const entry = await TestSuppression.create({
    skillId: req.params.id, createdBy: req.session.userId,
    testId, justification, expiresAt,
  });
  return res.status(201).json(entry);
});
Fixed
const TestSuppressionSchema = z.object({
  testId: z.string().regex(/^[a-zA-Z0-9\-_]{1,128}$/),
  justification: z.string().min(20).max(2000),
  expiresAt: z.string().datetime().optional(),
  maxSeverity: z.enum(['low', 'medium', 'high']),  // critical test failures require security review
});
router.post('/:id/test-results/suppress', testCors, requireSession, requireRole('qa_admin'), verifyCsrf,
  async (req, res) => {
    const parsed = TestSuppressionSchema.safeParse(req.body);
    if (!parsed.success) return res.status(400).json({ error: 'Invalid suppression payload', issues: parsed.error.issues });
    const entry = await TestSuppression.create({ skillId: req.params.id, createdBy: req.session.userId, ...parsed.data });
    await AuditLog.create({ action: 'test.suppression.created', actorId: req.session.userId,
      skillId: req.params.id, suppressionId: entry.id, testId: parsed.data.testId,
      origin: req.headers.origin, at: new Date() });
    return res.status(201).json({ id: entry.id });
  });

The fix removes the wildcard ACAO and applies the per-route allowlist cors middleware. The qa_admin role requirement ensures that standard session users cannot create suppressions. The Zod TestSuppressionSchema enforces that the maxSeverity field cannot be set to critical — suppressions targeting critical-severity test failures require an out-of-band security review workflow. The audit log records the requesting origin alongside the test identifier, enabling post-incident attribution of suppression entries created via cross-origin attack.

CORS64-003 — Timing oracle on test schedule endpoint identifies active QA cycles

Severity: MEDIUM

The test results 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 recently modified schedules in under 5 ms (from an in-memory cache), while skills with no recent schedule 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 determines whether the skill has an active QA cycle in progress from response time alone.

QA schedule modifications cluster around specific events: when a new security test is added to a skill's test suite and an immediate re-run is triggered, when a regression is detected and the team accelerates testing frequency, or when a skill is in the final stages of QA before a scheduled publication. These are exactly the moments when QA admins are working in the management console with an active session. An attacker probing skills in parallel with cross-origin timing requests can identify which skills have live QA sessions before issuing CORS64-001 credential-bearing requests against those same skill endpoints to extract internal QA notes and pending regression fix details.

Vulnerable
router.get('/:id/test-results/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 = testScheduleCache.get(req.params.id) || await TestSchedule.findOne({ skillId: req.params.id });
  return res.json(schedule);
});
Fixed
router.get('/:id/test-results/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' }); }
  testCors(req, res, async () => {
    const schedule = testScheduleCache.get(req.params.id) || await TestSchedule.findOne({ skillId: req.params.id });
    await sleep(Math.max(0, 60 - (Date.now() - start)));
    return res.json(schedule);
  });
});

The fix performs authentication and ownership verification before any CORS headers are emitted. The 60ms constant-time floor applied to both the miss path (404) and the hit path (data returned) eliminates the cache-latency differential that enabled timing-based enumeration. The unified Skill.findOne query combines the existence check and the ownership check into a single database round-trip, ensuring that cache hits and misses produce indistinguishable response timings to cross-origin observers.

CORS64-004 — Credential-bearing CORS on test result deletion erases evidence of failed security tests

Severity: CRITICAL

The test result deletion endpoint shares the router-level cors({origin:true,credentials:true}) policy from CORS64-001. Any web page can issue a credentialed DELETE request using the victim admin's session. The endpoint performs no ownership check and no soft-delete — it permanently removes any test result by ID without verifying the caller has authority over the skill or that the result should be deletable.

When a skill's test results are deleted, the QA gate loses its historical record of which security tests failed and when they were resolved. Enterprise CI pipelines that query test history to verify that all security tests have passed before deploying a skill will find no results and either skip the check (treating no-data as compliant) or flag the skill as never-tested. Skills can have their entire QA history erased from a single cross-origin session, retroactively making a skill that failed critical security tests appear as though it has a clean QA record. This enables a skill with known security failures to be re-submitted to the QA gate without the system detecting that the same tests were previously failed — an effective retroactive QA gate bypass that is performed with legitimate admin credentials and leaves no visible deletion audit trail without explicit logging.

Vulnerable
router.delete('/:id/test-results/:resultId', requireSession, async (req, res) => {
  await TestResult.deleteOne({ _id: req.params.resultId });
  return res.status(204).end();
});
Fixed
router.delete('/:id/test-results/:resultId', testCors, requireSession, async (req, res) => {
  const result = await TestResult.findOne({ _id: req.params.resultId, skillId: req.params.id });
  if (!result) return res.status(404).json({ error: 'Test result not found' });
  const isAdmin = req.session.role === 'admin' || req.session.role === 'qa_admin';
  const isOwner = String(result.skillOwnerId) === req.session.userId;
  if (!isAdmin && !isOwner) return res.status(403).json({ error: 'Forbidden' });
  await result.updateOne({ deletedAt: new Date(), deletedBy: req.session.userId });
  await AuditLog.create({ action: 'test.result.deleted', actorId: req.session.userId,
    resultId: req.params.resultId, skillId: req.params.id,
    testId: result.testId, severity: result.severity, origin: req.headers.origin, at: new Date() });
  if (!isOwner) await notify(result.skillOwnerId, { type: 'test.result.deleted',
    resultId: req.params.resultId, skillId: req.params.id, by: req.session.userId });
  return res.status(204).end();
});

The fix soft-deletes test results rather than hard-deleting them, preserving the QA compliance audit trail required by CI pipeline verification systems. The ownership check ensures that deletion is restricted to the skill owner and to admin-role users. The notification mechanism alerts the skill owner when a third party deletes a test result, enabling rapid detection of cross-origin deletion attacks. The audit log records the test identifier and severity alongside the requesting origin, enabling post-incident reconstruction of which failed security tests were removed before QA gate re-submission.

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