← Security advisories

Claude MCP skill CORS misconfiguration — skill notification and alert subscription endpoints — SA-SKL-CORS43

SA-SKL-CORS43 documents four CORS misconfiguration patterns in MCP skill registry notification and alert subscription endpoints. Notification endpoints manage real-time security monitoring for skill registries — alert thresholds, webhook delivery targets, and subscription ownership. Credential-bearing CORS on notification config read exposes the full monitoring configuration to any origin. Wildcard ACAO on the subscribe endpoint lets any page consume notification quota and route alerts to attacker-controlled addresses. A timing oracle on the notification history endpoint reveals event existence across organizational boundaries. And credential-bearing CORS on subscription deletion enables any origin to silently disable security alerts using a victim admin session.

SA-SKL-CORS43 findings at a glance
CRITICALCORS43-001 — cors({origin:true,credentials:true}) on GET /api/skills/:id/notifications; any origin reads full notification config including alert thresholds, email recipients, and webhook targets using victim session
HIGHCORS43-002 — ACAO: * on POST /api/skills/:id/notifications/subscribe; any page creates alert subscriptions consuming notification quota and triggering spurious alert emails to arbitrary addresses
MEDIUMCORS43-003 — ACAO origin reflection on GET /api/skills/:id/notifications/history emitted before ownership check; timing oracle reveals notification event existence across all orgs
CRITICALCORS43-004 — cors({origin:true,credentials:true}) on DELETE /api/skills/:id/notifications/:subId; any origin deletes any notification subscription using victim admin session, disabling security alerts and monitoring

CORS43-001 — Credential-bearing CORS on notification config leaks alert thresholds and webhook targets

The notification configuration endpoint at GET /api/skills/:id/notifications returns the complete monitoring configuration for a skill: alert thresholds for error rates, latency spikes, and security events; the full list of subscribed email recipients; webhook delivery targets including their URLs and signing secrets; and per-subscription metadata including who created each subscription and when. When this endpoint is configured with cors({origin:true,credentials:true}), any page can read this data using the victim's authenticated session without any action on the victim's part beyond visiting an attacker-controlled URL.

The notification configuration is valuable reconnaissance for two attack categories. For an attacker planning a supply chain attack, the webhook URLs reveal the downstream systems that consume security event notifications — CI/CD pipelines, incident response platforms, Slack workspaces, PagerDuty channels. Each webhook URL is an additional attack surface. The signing secrets included in webhook configuration allow an attacker to forge legitimate-looking alert payloads to any downstream system that trusts the notification source. For an attacker planning to maintain persistent access, the alert thresholds reveal exactly what anomaly levels trigger human review — the attacker can stay below those thresholds to avoid detection.

CORS43-001 fix: Replace cors({origin:true,credentials:true}) with an explicit allowlist. Add requireSession before CORS middleware. For public callers, return only a boolean indicating whether notifications are enabled — never thresholds, recipients, webhook URLs, or signing secrets.

WRONG
router.get('/skills/:id/notifications',
  cors({ origin: true, credentials: true }),
  async (req, res) => {
    const config = await db.getNotificationConfig(req.params.id);
    res.json(config); // includes webhookUrl, signingSecret, thresholds, recipients
  }
);
RIGHT
router.get('/skills/:id/notifications',
  requireSession,
  strictCors,
  async (req, res) => {
    const isMember = await db.isSkillMember(req.params.id, req.session.orgId);
    if (!isMember) {
      // public callers: existence flag only, no config details
      const enabled = await db.hasNotificationsEnabled(req.params.id);
      return res.json({ enabled });
    }
    const config = await db.getNotificationConfig(req.params.id);
    res.json(config);
  }
);

CORS43-002 — Wildcard ACAO on subscribe endpoint enables quota exhaustion and alert hijack

The notification subscribe endpoint POST /api/skills/:id/notifications/subscribe creates a new alert subscription with a caller-supplied destination address and event type filter. With ACAO: *, any page that holds the victim's Bearer token (via XSS in the registry frontend) can create subscriptions for arbitrary destinations. The attack has two distinct damage profiles. First, quota exhaustion: most registries enforce per-skill or per-org notification quotas to control email sending costs. An attacker creating hundreds of spurious subscriptions exhausts the quota, suppressing legitimate security alerts. Second, alert hijack: by subscribing an attacker-controlled email address to security event types (failed audit, vulnerability detection, authentication anomaly), the attacker receives real-time notification of security events that the legitimate team is responding to — allowing the attacker to time follow-on actions during the response window when defenders are occupied.

CORS43-002 fix: Remove wildcard. Require session. Add CSRF token. Require requireRole('admin'). Validate destination address against an org-verified domain allowlist. Enforce per-org subscription count limits. Emit an audit log entry and admin notification on every new subscription creation.

// WRONG — wildcard; anyone with a Bearer token can create subscriptions
router.post('/skills/:id/notifications/subscribe',
  cors({ origin: '*' }),
  async (req, res) => {
    await db.createSubscription(req.params.id, req.body.destination, req.body.events);
    res.json({ ok: true });
  }
);

// RIGHT — allowlist + session + CSRF + admin role + domain allowlist + quota check
router.post('/skills/:id/notifications/subscribe',
  requireSession,
  requireRole('admin'),
  strictCors,
  verifyCsrfToken,
  async (req, res) => {
    const skill = await db.getSkill(req.params.id);
    if (!skill || skill.orgId !== req.session.orgId) return res.status(403).json({ error: 'forbidden' });

    const org = await db.getOrg(req.session.orgId);
    if (!isAllowedDestination(req.body.destination, org.verifiedDomains)) {
      return res.status(400).json({ error: 'destination must be a verified org domain' });
    }

    const count = await db.getSubscriptionCount(req.session.orgId);
    if (count >= org.subscriptionQuota) {
      return res.status(429).json({ error: 'subscription quota exceeded' });
    }

    await db.createSubscription(req.params.id, req.body.destination, req.body.events);
    await audit.log('subscription_created', { skillId: req.params.id, destination: req.body.destination, createdBy: req.session.userId });
    res.json({ ok: true });
  }
);

CORS43-003 — Timing oracle on notification history reveals event existence across orgs

The notification history endpoint GET /api/skills/:id/notifications/history reflects the Origin header before the ownership check executes. When a skill has a notification history with many events (high-volume audit activity, frequent security alerts), the server executes a pagination query across the notification_events table that is measurably slower than the immediate 404 returned for unknown skill IDs. The latency difference is cross-origin observable via performance.now() timing in a browser context.

An attacker uses this oracle to enumerate which private skills have active notification histories — a signal that those skills are under active security monitoring and have recent audit or alert events worth investigating. Skills with large notification histories are more likely to be production-critical tooling with active usage, making them higher-value targets for the credential-bearing CORS read in CORS43-001. The oracle is particularly useful for narrowing a large skill ID space to a short list of high-activity targets worth pursuing.

CORS43-003 fix: Move CORS middleware after auth and ownership checks. Include orgId in the WHERE clause so unauthorized skill IDs return a consistent fast path. Apply a minimum-latency strategy (setTimeout to a floor of 50ms) to normalize 403 and 404 response times. Never emit the ACAO header for requests that fail authorization.

CORS43-004 — Credential-bearing CORS on subscription delete disables security monitoring

The subscription deletion endpoint DELETE /api/skills/:id/notifications/:subId uses cors({origin:true,credentials:true}). An attacker who tricks an org admin into visiting a malicious page can delete any notification subscription from any skill in the organization. The security impact is disproportionate: a single request deleting the subscription that routes to the security team's incident response platform silently disables the most important alerting channel for the registry. The admin whose session is used for the deletion may not realize what happened — the registry dashboard shows no active subscriptions for the targeted skill, which the admin may attribute to a configuration error rather than a cross-origin attack.

Alert disablement attacks are preparation for a larger follow-on attack. After deleting the security alert subscription, the attacker proceeds with their primary objective — a supply chain injection, credential harvesting, or permission escalation — without triggering any automated alerting. The first time defenders become aware that monitoring was disabled is during post-incident review, long after the primary damage has occurred.

CORS43-004 fix: Replace credential-bearing CORS with an explicit allowlist. Add requireRole('admin') and skill ownership verification. Require CSRF token. Emit an audit log entry and send a notification to remaining subscribed addresses (and to a fixed security contact) whenever a subscription is deleted. Require re-authentication for deletions of security-category subscriptions.

// WRONG — credential-bearing CORS; any origin deletes any subscription
router.delete('/skills/:id/notifications/:subId',
  cors({ origin: true, credentials: true }),
  async (req, res) => {
    await db.deleteSubscription(req.params.id, req.params.subId);
    res.json({ ok: true });
  }
);

// RIGHT — allowlist + admin role + ownership check + audit log + security contact alert
router.delete('/skills/:id/notifications/:subId',
  requireSession,
  requireRole('admin'),
  strictCors,
  verifyCsrfToken,
  async (req, res) => {
    const skill = await db.getSkill(req.params.id);
    if (!skill || skill.orgId !== req.session.orgId) return res.status(403).json({ error: 'forbidden' });

    const sub = await db.getSubscription(req.params.subId);
    if (!sub || sub.skillId !== req.params.id) return res.status(404).json({ error: 'not found' });

    await db.deleteSubscription(req.params.id, req.params.subId);
    await audit.log('subscription_deleted', { skillId: req.params.id, subId: req.params.subId, deletedBy: req.session.userId, destination: sub.destination });
    // notify security contact regardless of which subscription was deleted
    await notifications.notifySecurityContact(req.session.orgId, 'subscription_deleted', { skillId: req.params.id, destination: sub.destination });
    res.json({ ok: true });
  }
);
Detect SA-SKL-CORS43 in your registry

SkillAudit scans for credential-bearing CORS reflection on notification configuration endpoints, wildcard ACAO on subscription creation operations, and middleware ordering that emits CORS before auth — across all notification and alert subscription sub-routers in your MCP skill registry codebase.

Scan your registry
FindingSeverityEndpointImpact
CORS43-001CRITICALGET /api/skills/:id/notificationsFull notification config exfiltration including alert thresholds, email recipients, webhook URLs, and signing secrets
CORS43-002HIGHPOST /api/skills/:id/notifications/subscribeQuota exhaustion via spurious subscriptions; alert hijack by routing security events to attacker-controlled destinations
CORS43-003MEDIUMGET /api/skills/:id/notifications/historyTiming oracle reveals notification event existence across all orgs for target enumeration
CORS43-004CRITICALDELETE /api/skills/:id/notifications/:subIdSecurity monitoring disabled by deleting alert subscriptions; enables blind follow-on attacks without automated detection

See also: SA-SKL-CORS42 (permission and ACL endpoint CORS patterns) and SA-SKL-CORS41 deep dive blog post for the compound competitive intelligence exfiltration chain that credential-bearing CORS enables across analytics and permission endpoints.