Claude MCP skill CORS misconfiguration — skill payment and billing subscription endpoints — SA-SKL-CORS50
SA-SKL-CORS50 documents four CORS misconfiguration patterns in MCP skill registry payment and billing subscription endpoints. These endpoints control billing configuration reads, subscription initiation, invoice enumeration, and subscription cancellation — all surfaces with direct financial impact. Credential-bearing CORS on the billing config endpoint exposes subscription plan details, card summary, upcoming invoice amount, and billing period to any origin visiting with the victim's session. Wildcard ACAO on the subscribe endpoint lets any page initiate a skill subscription, charging an attacker-selected plan to the victim's payment method without victim consent. A timing oracle on the invoices endpoint identifies billing accounts with the highest invoice volumes, targeting the richest CORS50-001 victims. And credential-bearing CORS on subscription cancellation allows any origin to cancel any active subscription using the victim admin's session, immediately disrupting paid access and triggering churn events across the subscriber base.
cors({origin:true,credentials:true}) on GET /api/skills/:id/billing; any origin reads full billing configuration including subscription plan, card details summary, upcoming invoice amount, and billing period using victim session; fix: allowlist; requireSession; return only public billing summary; treat card details as write-onlyACAO: * on POST /api/skills/:id/billing/subscribe; any page initiates skill subscription flow consuming one subscription slot and charging attacker-selected plan to victim payment method; fix: remove wildcard; require session; CSRF token; Zod BillingPlanSchema; validate payment intent before accepting subscriptionACAO origin reflection on GET /api/skills/:id/billing/invoices emitted before billing account check; timing oracle reveals invoice existence across all billing accounts, enumerating high-revenue skills as CORS50-001 targets; fix: unified WHERE clause; auth before CORS emission; normalize 403/404 latencycors({origin:true,credentials:true}) on DELETE /api/skills/:id/billing/subscription; any origin cancels any skill subscription using victim admin session, immediately disrupting paid access and triggering subscriber churn; fix: allowlist + requireRole('admin') + ownership check + audit log + cancellation confirmation emailCORS50-001 — Credential-bearing CORS on billing config exposes subscription plan, card summary, and invoice details
Severity: CRITICAL
The GET /api/skills/:id/billing endpoint is configured with cors({origin:true,credentials:true}), reflecting every origin back as Access-Control-Allow-Origin and setting Access-Control-Allow-Credentials: true. Cross-origin JavaScript can read the full billing configuration document using the victim's session cookie.
The billing config object includes the active subscription plan identifier, card details summary (last four digits, expiry, billing name), upcoming invoice amount, billing period start and end dates, and payment method type. While none of these fields constitute a full payment credential, they represent financial account intelligence. An attacker who can correlate card details summary with an email address (available from a companion account endpoint in the same registry) can mount targeted phishing attacks with specific card and billing details that make the lure highly convincing. The upcoming invoice amount reveals what the victim is paying for skills, which is commercially sensitive. The billing period reveals renewal windows that can be used to time social engineering attacks.
// GET /api/skills/:id/billing — cors({origin:true,credentials:true}) inherited from router
router.get('/:id/billing', requireSession, async (req, res) => {
const billing = await Billing.findOne({ skillId: req.params.id })
.populate('paymentMethod')
.populate('subscription');
return res.json(billing); // full document including card details summary
});
// GET /api/skills/:id/billing — per-route allowlist cors
router.get('/:id/billing', billingCors, requireSession, async (req, res) => {
const billing = await Billing.findOne({
skillId: req.params.id,
accountId: req.session.accountId, // ownership enforced in query
}).populate('subscription');
if (!billing) return res.status(404).json({ error: 'Not found' });
// Card details are write-only — never return raw values in GET
return res.json({
skillId: billing.skillId,
subscriptionPlan: billing.subscription?.planId ?? null,
billingPeriod: {
start: billing.periodStart,
end: billing.periodEnd,
},
nextInvoiceAmount: billing.nextInvoiceAmount,
// paymentMethod: intentionally omitted — read via dedicated write-only flow
});
});
CORS50-002 — Wildcard ACAO on subscribe initiates unauthorized subscriptions charged to victim payment method
Severity: HIGH
The POST /api/skills/:id/billing/subscribe endpoint returns Access-Control-Allow-Origin: *. The endpoint processes subscription initiation requests without validating that the caller owns the billing account: any authenticated user whose session is used can be subscribed to an attacker-selected plan on an attacker-selected skill. The endpoint accepts planId from the request body without schema validation, allowing the attacker to select the most expensive available plan.
The practical impact is unauthorized financial charges: the victim's default payment method is charged for the subscription. The fix removes the wildcard, requires session authentication independently, adds CSRF token validation, enforces Zod BillingPlanSchema against the submitted plan to restrict to known plan identifiers, and validates a payment intent confirmation token from Stripe before the subscription record is committed to avoid charges on unauthenticated flows.
Financial endpoints require session authentication regardless of CORS policy. The wildcard ACAO assumption of safety collapses entirely when the endpoint processes financial transactions without an independent session gate. Wildcard ACAO prevents cookie attachment, but once a user is authenticated and an attacker can induce a cross-origin request using that session, the absence of an independent auth check means the transaction proceeds. Always authenticate at the handler level before initiating any charge.
CORS50-003 — Timing oracle on invoices endpoint enumerates high-revenue billing accounts
Severity: MEDIUM
The GET /api/skills/:id/billing/invoices endpoint reflects the Origin header before performing the billing account ownership check. The invoices query joins invoice rows with payment events, and billing accounts with many invoices (high transaction volume) take measurably longer to respond than accounts with no history. The latency difference — typically 25–60 ms for high-volume accounts — is cross-origin-detectable, letting an attacker rank billing accounts by revenue activity and prioritize them for CORS50-001 card-details exfiltration.
The fix performs authentication and billing account ownership checks before emitting any CORS header, uses a single WHERE skillId = ? AND accountId = ? clause so the ownership check and existence check share the same query path, and normalizes 403/404 response latency with a constant-time floor to eliminate the timing signal.
CORS50-004 — Credential-bearing CORS on subscription cancellation disrupts paid access and triggers churn
Severity: CRITICAL
The DELETE /api/skills/:id/billing/subscription endpoint shares the same cors({origin:true,credentials:true}) policy as CORS50-001. Any web page can instruct the victim admin's browser to cancel any active subscription in the registry — there is no ownership check on the subscription record and no confirmation gate. Cancellation takes effect immediately, cutting off paid access for all seats on the cancelled subscription. The impacted users continue receiving the product but their entitlements are downgraded to free-tier limits, which may not trigger an operational alert if the downgrade is gradual or if the team does not monitor subscription status actively.
// DELETE /api/skills/:id/billing/subscription
// No ownership check, no confirmation gate
router.delete('/:id/billing/subscription', requireSession, async (req, res) => {
const sub = await Subscription.findOne({ skillId: req.params.id });
if (!sub) return res.status(404).json({ error: 'Not found' });
await sub.deleteOne();
return res.status(204).end();
});
// DELETE /api/skills/:id/billing/subscription
router.delete('/:id/billing/subscription', billingCors, requireSession, requireRole('admin'), async (req, res) => {
const sub = await Subscription.findOne({
skillId: req.params.id,
accountId: req.session.accountId, // ownership enforced in query
});
if (!sub) return res.status(404).json({ error: 'Not found' });
await sub.deleteOne();
await AuditLog.create({
action: 'subscription.cancelled',
skillId: req.params.id,
subscriptionId: sub._id,
actorId: req.session.userId,
timestamp: new Date(),
});
// Cancellation confirmation email to account holder
await sendCancellationConfirmation(req.session.userId, {
skillId: req.params.id,
plan: sub.planId,
cancelledAt: new Date(),
});
return res.status(204).end();
});
Remediation summary
| Finding | Severity | Primary remediation | Secondary hardening |
|---|---|---|---|
| CORS50-001 | Critical | Replace origin:true with allowlist; return only public billing summary; omit card details from GET | Require requireSession + ownership in query WHERE clause |
| CORS50-002 | High | Remove ACAO: *; require session, CSRF token; validate plan via Zod BillingPlanSchema | Validate payment intent token before committing subscription; rate-limit per account |
| CORS50-003 | Medium | Auth before CORS header emission; unified WHERE clause | Constant-time 403/404 latency floor |
| CORS50-004 | Critical | Replace origin:true with allowlist; requireRole('admin'); ownership check | Audit log; cancellation confirmation email; immediate seat-entitlement notification |
Find CORS misconfigurations like these before attackers do. SkillAudit scans your MCP skill registry billing endpoints for all four SA-SKL-CORS50 patterns plus the broader CORS advisory series. See the SA-SKL-CORS49 marketplace listing advisory and the SA-SKL-CORS48 search and discovery advisory for related findings. Connect your repository at skillaudit.dev.