← Security advisories

Claude MCP skill CORS misconfiguration — skill licensing and intellectual property management endpoints — SA-SKL-CORS62

SA-SKL-CORS62 documents four CORS misconfiguration vulnerabilities in MCP skill registry licensing and intellectual property management endpoints. License endpoints govern the contractual terms under which skills can be used, distributed, and commercialized — including SPDX license identifiers, dual-license conditions, commercial use restrictions, attribution requirements, and proprietary exception clauses that may not yet be publicly announced. CORS62 identifies four distinct cross-origin attack paths: credential-bearing CORS on the license config read endpoint exposes full licensing strategy including unreleased commercial terms to any origin; wildcard ACAO on the license creation endpoint allows any page to inject false open-source license claims under victim admin identity, exposing skill publishers to license violation claims from commercial users who relied on the false open-source claim; a timing oracle via Origin reflection before ownership check identifies skills with active licensing negotiations as high-value exfiltration targets; and credential-bearing CORS on the license deletion endpoint allows any cross-origin page to remove any license entry, leaving skills in an unlicensed state that blocks commercial adoption and triggers automated compliance scanners in enterprise CI pipelines.

SA-SKL-CORS62 findings at a glance
CRITICALCORS62-001 — GET /api/skills/:id/license has cors({origin:true,credentials:true}) — any origin reads full license configuration including SPDX identifiers, dual-license conditions, commercial use restrictions, and attribution requirements using victim admin session; reveals licensing strategy including unreleased commercial terms and proprietary exception handling; fix: per-route allowlist cors; requireSession + requireRole('admin'); never return unreleased commercial terms to non-admin callers
CRITICALCORS62-002 — POST /api/skills/:id/license has ACAO:* — any page creates attacker-controlled license entries under victim admin identity; attacker injects false open-source license claims replacing a commercial license, exposing the skill publisher to license violation claims from commercial users who relied on the false open-source claim; fix: remove wildcard; require session; requireRole('admin'); CSRF token; Zod LicenseEntrySchema; audit log with origin
MEDIUMCORS62-003 — GET /api/skills/:id/license/history reflects Origin before ownership check — timing oracle reveals license modification velocity identifying skills with active licensing negotiations as CORS62-001 targets; fix: auth before CORS; unified WHERE; 60ms constant-time floor
CRITICALCORS62-004 — DELETE /api/skills/:id/license/:licenseId has cors({origin:true,credentials:true}) — any origin removes any license entry using victim admin session, leaving skills in an unlicensed state that blocks commercial adoption and triggers automated compliance scanners in enterprise CI pipelines; fix: allowlist + requireSession + ownership check + notify skill owner + audit log; soft-delete active licenses preserving compliance audit trail

CORS62-001 — Credential-bearing CORS on license config exposes unreleased commercial terms

Severity: CRITICAL

The license config 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 the complete license configuration including unpublished dual-license arrangements, commercial exception clauses negotiated with enterprise customers, and proprietary use restrictions not yet announced publicly.

License configurations in a multi-tier registry typically contain three tiers of sensitive data: SPDX identifiers that govern the base open-source terms (which may differ from what the skill's README claims), dual-license conditions that specify the commercial licensing terms available to paying customers (which may include undisclosed pricing or exclusivity arrangements), and proprietary exception records that document which enterprise customers have been granted commercial licenses under non-standard terms. Reading this configuration cross-origin tells a competitor exactly what commercial terms the publisher is offering to enterprise customers — including confidential pricing and exclusivity windows that the publisher has not yet announced.

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

router.get('/:id/license', requireSession, async (req, res) => {
  const license = await License.findOne({ skillId: req.params.id });
  return res.json(license);  // exposes unreleased commercial terms, proprietary exceptions
});
Fixed
// GET /api/skills/:id/license — per-route allowlist cors + role-scoped fields
const ALLOWED = process.env.ALLOWED_ORIGINS.split(',');
const licenseCors = cors({ origin: ALLOWED, credentials: true });

router.get('/:id/license', licenseCors, requireSession, requireRole('admin'), async (req, res) => {
  const license = await License.findOne({ skillId: req.params.id })
    .select('+spdxId +licenseType +commercialAllowed +attributionRequired -proprietaryExceptions -unreleasedTerms');
  return res.json({
    spdxId:             license.spdxId,
    licenseType:        license.licenseType,     // 'open-source' | 'commercial' | 'dual'
    commercialAllowed:  license.commercialAllowed,
    attributionRequired: license.attributionRequired,
    // proprietaryExceptions and unreleasedTerms intentionally omitted
  });
});

The fix applies CORS on a per-route basis using an explicit allowlist. Proprietary exception records and unreleased commercial terms are never included in list responses — they are available only via a separate admin-only single-license detail endpoint protected by additional audit logging. This ensures that even a compromised admin session reached via CORS cannot extract confidential commercial licensing arrangements from the license API.

CORS62-002 — Wildcard ACAO on license creation enables false open-source license claim injection

Severity: CRITICAL

The license 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 license creation request using the victim admin's session, with the attacker controlling the SPDX identifier, license type, commercial restrictions, and attribution requirements.

An attacker who injects a license entry claiming spdxId: 'MIT' for a skill that is actually commercially licensed exposes the publisher to license violation claims. Commercial users who installed the skill under the false MIT claim have a reasonable reliance argument — they read the license as MIT and deployed accordingly. When the publisher later corrects the license to its true commercial terms, existing commercial users face retroactive license compliance issues. The injected entry is indistinguishable from a legitimate change in the audit log — it carries the legitimate admin's user ID, appears at a time when that admin had an active session, and passes all integrity checks that only verify the author's authentication status.

Vulnerable
// POST /api/skills/:id/license — ACAO:* from upstream cors() middleware
// No CSRF, no role boundary, no Zod schema, no audit log origin
router.post('/:id/license', requireSession, async (req, res) => {
  const { spdxId, licenseType, commercialAllowed } = req.body;
  const entry = await License.create({
    skillId:          req.params.id,
    createdBy:        req.session.userId,
    spdxId,                               // attacker-controlled: 'MIT', 'Apache-2.0' etc.
    licenseType,                          // attacker-controlled: 'open-source' overrides commercial
    commercialAllowed,
  });
  return res.status(201).json(entry);
});
Fixed
// POST /api/skills/:id/license — allowlist cors + requireRole + CSRF + Zod + audit log
import { z } from 'zod';
const LicenseEntrySchema = z.object({
  spdxId:             z.string().regex(/^[A-Za-z0-9.\-+]+$/),
  licenseType:        z.enum(['open-source', 'commercial', 'dual', 'proprietary']),
  commercialAllowed:  z.boolean(),
  attributionRequired: z.boolean(),
  commercialTermsUrl: z.string().url().optional(),
});

router.post('/:id/license', licenseCors, requireSession, requireRole('admin'), verifyCsrf,
  async (req, res) => {
    const parsed = LicenseEntrySchema.safeParse(req.body);
    if (!parsed.success) return res.status(400).json({ error: 'Invalid license payload', issues: parsed.error.issues });
    const entry = await License.create({ skillId: req.params.id, createdBy: req.session.userId, ...parsed.data });
    await AuditLog.create({ action: 'license.created', actorId: req.session.userId, skillId: req.params.id,
      licenseId: entry.id, spdxId: parsed.data.spdxId, origin: req.headers.origin, at: new Date() });
    return res.status(201).json({ id: entry.id });
  }
);

CORS62-003 — Timing oracle on license history endpoint identifies active licensing negotiations

Severity: MEDIUM

The license history 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 high license modification activity in under 5 ms (from an in-memory LRU cache), while skills with low 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 recent licensing activity from response time alone.

License modifications cluster around specific events: enterprise negotiation cycles, dual-license launches, compliance audits. These are exactly when admins are working in the licensing UI with an active session. An attacker probing skills in parallel with cross-origin timing requests identifies which skills have live licensing negotiation sessions before issuing CORS62-001 credential-bearing requests.

Vulnerable
// GET /api/skills/:id/license/history — Origin reflected before auth
router.get('/:id/license/history', 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 history = licenseHistoryCache.get(req.params.id) || await LicenseHistory.find({ skillId: req.params.id });
  return res.json(history);
});
Fixed
// GET /api/skills/:id/license/history — auth before CORS + constant-time floor
router.get('/:id/license/history', 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' }); }
  licenseCors(req, res, async () => {
    const history = licenseHistoryCache.get(req.params.id) || await LicenseHistory.find({ skillId: req.params.id });
    await sleep(Math.max(0, 60 - (Date.now() - start)));
    return res.json(history);
  });
});

CORS62-004 — Credential-bearing CORS on license deletion leaves skills unlicensed

Severity: CRITICAL

The license deletion endpoint shares the router-level cors({origin:true,credentials:true}) policy from CORS62-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 license entry by ID without verifying the caller has authority over the skill.

When a skill's license entries are deleted, most registry implementations treat the skill as unlicensed — meaning enterprise CI pipelines that require an explicit license SPDX identifier will reject the skill as non-compliant. Skills can be rendered commercially un-adoptable from a single cross-origin session without any notification to the skill publisher or existing commercial licensees. The absence of a soft-delete mechanism means the license history is irrecoverably destroyed unless the deletion is captured in an audit log with enough detail to reconstruct the previous state.

Vulnerable
// DELETE /api/skills/:id/license/:licenseId
// cors({origin:true,credentials:true}) from router.use()
// No ownership check, no audit log, no notification, no soft-delete
router.delete('/:id/license/:licenseId', requireSession, async (req, res) => {
  await License.deleteOne({ _id: req.params.licenseId });
  return res.status(204).end();
});
Fixed
// DELETE /api/skills/:id/license/:licenseId
// Per-route allowlist CORS + ownership check + soft-delete + audit log + notification
router.delete('/:id/license/:licenseId', licenseCors, requireSession, async (req, res) => {
  const license = await License.findOne({ _id: req.params.licenseId, skillId: req.params.id });
  if (!license) return res.status(404).json({ error: 'License not found' });
  const isAdmin   = req.session.role === 'admin' || req.session.role === 'registry_admin';
  const isCreator = String(license.createdBy) === req.session.userId;
  if (!isAdmin && !isCreator) return res.status(403).json({ error: 'Forbidden' });
  // soft-delete active licenses — preserve compliance audit trail
  await license.updateOne({ deletedAt: new Date(), deletedBy: req.session.userId });
  await AuditLog.create({ action: 'license.deleted', actorId: req.session.userId,
    licenseId: req.params.licenseId, skillId: req.params.id,
    spdxId: license.spdxId, origin: req.headers.origin, at: new Date() });
  if (!isCreator) await notify(license.createdBy, { type: 'license.deleted',
    licenseId: req.params.licenseId, skillId: req.params.id, by: req.session.userId, spdxId: license.spdxId });
  return res.status(204).end();
});

The fix soft-deletes active license entries rather than hard-deleting them, preserving the compliance audit trail. The notification mechanism alerts the original license creator when deletion is performed by a third party, enabling rapid detection of cross-origin deletion attacks. The audit log records the SPDX identifier alongside the origin header — enabling post-incident reconstruction of which license terms were in place before the deletion.

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