Claude MCP skill CORS misconfiguration — skill subscription billing and payment processing endpoints (SA-SKL-CORS87)
SA-SKL-CORS87 identifies four CORS misconfiguration vulnerabilities in MCP skill registry skill subscription billing and payment processing endpoints. Credential-bearing CORS on the subscription read endpoint exposes the full billing record including payment method last four digits and card network that reveal the financial instrument on file, the billing address used for tax and fraud purposes, the complete invoice history with line items and payment timestamps, and admin-only revenue share override flags that document non-standard commercial agreements negotiated outside the registry's standard terms. Wildcard ACAO on the subscription upgrade endpoint allows any page to trigger subscription tier changes under a registry admin's identity, flooding upgrade operations that exhaust admin trial credits and generate real billing charges against the admin's payment method on file. A timing oracle on the subscription invoice probe endpoint reveals which skills currently have an active billing cycle generating invoices, exposing the registry's commercial activity cadence without authentication. And credential-bearing CORS on the invoice deletion endpoint allows any page to permanently erase invoice records that publishers depend on for tax filing, enterprise procurement compliance, and regulatory audit trails.
GET /api/skills/:id/subscription has cors({origin:true,credentials:true}) — any origin reads full subscription record including payment method last4, billing address, invoice history, and admin-only revenue share override flags using victim admin sessionPOST /api/skills/:id/subscription/upgrade has ACAO:* — any page triggers subscription upgrades under victim admin identity; attacker floods upgrade requests exhausting admin trial credits and triggering billing charges against admin payment methodGET /api/skills/:id/subscription/invoice reflects Origin before auth check — timing oracle reveals skills with active billing cycle (invoice-generating warm ~2ms vs cold ~190ms)DELETE /api/skills/:id/subscription/:invoiceId has cors({origin:true,credentials:true}) — any origin permanently deletes invoice records destroying the publisher's billing history needed for tax compliance and enterprise procurement verificationCORS87-001 — Credential-bearing CORS exposes payment details and admin revenue share overrides on subscription endpoint
The GET /api/skills/:id/subscription endpoint returns the complete subscription record for a skill, combining fields visible to the publisher with admin-only commercial fields that the registry never intends to expose externally. With cors({origin:true,credentials:true}) applied before authentication, any cross-origin page visited by an authenticated admin reads the full record using the admin's session credentials. The payment method section returns the last four digits and card network of the payment instrument on file — partial card data that is nonetheless sufficient to correlate with leaked datasets in card fraud investigations, to social-engineer the registry's billing support team by reciting apparently authentic payment details, or to identify the specific issuing bank from the card network prefix. The billing address combines the publisher's physical address with the tax jurisdiction code used for VAT and sales tax calculations, disclosing both the publisher's location and their tax treatment under the registry's billing rules.
The revenue share override flags field is the most commercially sensitive component of the exposure. Standard publishers earn the registry's published revenue share percentage — typically 70% for free-tier skills and 80% for certified skills. Admin-only revenue share overrides document non-standard agreements negotiated directly between specific publishers and registry business development staff, often in exchange for exclusivity commitments, volume guarantees, or early access to beta features. These override percentages are explicitly confidential: their disclosure to other publishers creates demands for equal treatment, undermines the registry's pricing leverage in future negotiations, and in some jurisdictions triggers regulatory scrutiny of price discrimination practices. Because the CORS middleware issues the permissive headers before the authentication layer inspects the requester's role, the runtime field-gating on admin-only fields provides no protection against a cross-origin read by an admin session.
// CORS87-001 — VULNERABLE: cors({origin:true,credentials:true}) before auth on subscription endpoint
const express = require('express');
const cors = require('cors');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const router = express.Router();
router.get('/skills/:id/subscription',
cors({ origin: true, credentials: true }),
requireSession,
async (req, res) => {
const isAdmin = req.session.roles.includes('billing_admin');
const subscription = await db.getSkillSubscription(req.params.id, {
includePaymentMethod: true,
includeBillingAddress: true,
includeInvoiceHistory: true,
includeRevenueShareOverrides: isAdmin
});
res.json(subscription);
}
);
module.exports = router;
Revenue share override flags document the exact commercial terms negotiated under NDA with individual publishers — exposing them to any cross-origin page an admin visits creates breach-of-contract liability and destroys the registry's ability to offer differentiated commercial terms. Authentication must run before CORS header issuance; admin-only billing fields must live on a separate admin endpoint unreachable from the publisher-facing subscription route.
// CORS87-001 — FIXED: auth before CORS; strip admin fields; separate admin endpoint
const express = require('express');
const { db } = require('../db');
const { requireSession, requireBillingAdmin } = require('../middleware/auth');
const { applyCorsAllowlist } = require('../middleware/cors');
const router = express.Router();
// Publisher-facing subscription endpoint — no commercial internals
router.get('/skills/:id/subscription',
requireSession,
applyCorsAllowlist,
async (req, res) => {
const subscription = await db.getSkillSubscription(req.params.id, {
includePaymentMethod: false,
includeBillingAddress: false,
includeInvoiceHistory: true,
includeRevenueShareOverrides: false
});
res.json(subscription);
}
);
// Admin-only subscription internals — explicit billing_admin role gate before CORS
router.get('/admin/skills/:id/subscription',
requireSession,
requireBillingAdmin,
applyCorsAllowlist,
async (req, res) => {
const subscription = await db.getSkillSubscription(req.params.id, {
includePaymentMethod: true,
includeBillingAddress: true,
includeInvoiceHistory: true,
includeRevenueShareOverrides: true
});
res.json(subscription);
}
);
module.exports = router;
CVSS score: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N — Base Score 6.5 (HIGH); with payment method last4 and confidential revenue share terms exposed, effective commercial and legal impact escalates to CVSS 8.1.
CORS87-002 — Wildcard ACAO on subscription upgrade endpoint triggers unauthorized billing charges
The POST /api/skills/:id/subscription/upgrade endpoint initiates a subscription tier upgrade for a skill, moving it from the registry's free tier to a paid plan or from a paid plan to a higher tier. Each upgrade triggers a billing event: either consuming credits from the admin's trial balance or charging the admin's payment method on file for the prorated cost of the tier change. With Access-Control-Allow-Origin: *, any page the admin visits can trigger upgrade requests using the admin's session credentials. An attacker who lures a registry admin to a malicious page can fire hundreds of upgrade requests per minute against skills the attacker controls or against arbitrary skills in the registry, exhausting the admin's trial credits in a single session and generating real charges against the admin's payment instrument if the trial balance runs dry.
The billing consequence is not merely inconvenient. In jurisdictions where unauthorized card charges require the issuing bank to investigate and potentially charge back, a successful flood attack generates chargeback disputes that damage the registry's payment processor relationship and may trigger the processor's fraud review threshold, temporarily suspending the registry's ability to process legitimate subscription payments for all publishers. The per-admin rate limiting that prevents legitimate upgrade flood scenarios — a human admin would never create hundreds of upgrades in a minute — is absent, making this endpoint a reliable entry point for both financial damage and payment infrastructure disruption.
// CORS87-002 — VULNERABLE: wildcard ACAO on subscription upgrade endpoint
const express = require('express');
const cors = require('cors');
const { billing } = require('../billing');
const { requireSession } = require('../middleware/auth');
const router = express.Router();
router.post('/skills/:id/subscription/upgrade',
cors({ origin: '*' }),
requireSession,
async (req, res) => {
const result = await billing.upgradeSubscription({
skillId: req.params.id,
targetTier: req.body.targetTier,
billingAdminId: req.session.userId
});
res.json({ subscriptionId: result.id, tier: result.tier });
}
);
module.exports = router;
Flooding upgrade requests against an admin's payment method generates real billing charges and potentially chargeback disputes that damage the registry's payment processor relationship — unauthorized billing via CORS is a financial attack, not just a data exposure. Allowlisted CORS prevents cross-origin upgrade triggering; a per-admin rate limit of two tier changes per hour matches legitimate upgrade cadence; CSRF protection prevents non-browser cross-site request forgery; and requireBillingAdmin ensures only credentialed billing staff can execute tier changes.
// CORS87-002 — FIXED: allowlist CORS; CSRF; per-admin rate limit 2/hr; requireBillingAdmin
const express = require('express');
const { billing } = require('../billing');
const { requireSession, requireBillingAdmin } = require('../middleware/auth');
const { applyCorsAllowlist } = require('../middleware/cors');
const { csrfProtection } = require('../middleware/csrf');
const { rateLimit } = require('../middleware/rate-limit');
const router = express.Router();
router.post('/skills/:id/subscription/upgrade',
requireSession,
applyCorsAllowlist,
csrfProtection,
requireBillingAdmin,
rateLimit({
key: req => `subscription-upgrade:${req.session.userId}`,
max: 2,
window: '1h',
message: 'Subscription upgrade rate limit exceeded — max 2 tier changes per admin per hour'
}),
async (req, res) => {
const result = await billing.upgradeSubscription({
skillId: req.params.id,
targetTier: req.body.targetTier,
billingAdminId: req.session.userId
});
res.json({ subscriptionId: result.id, tier: result.tier });
}
);
module.exports = router;
CVSS score: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H — Base Score 8.1 (HIGH); integrity impact reflects unauthorized billing charges against admin payment method; availability impact reflects potential payment processor suspension following chargeback dispute threshold breach.
CORS87-003 — Timing oracle reveals skills with active billing cycles via Origin reflection before auth
The GET /api/skills/:id/subscription/invoice endpoint returns the current invoice state for a skill's active billing cycle. Skills currently generating an invoice maintain a warm billing context in the registry's in-memory billing cache, returning in approximately 2ms. Skills with no active billing cycle incur a cold path requiring a database lookup and billing eligibility check, taking approximately 190ms. Because the endpoint reflects the requesting Origin header before the authentication middleware executes, an unauthenticated cross-origin page can measure response latency to determine whether a given skill has an active billing cycle in progress — without possessing any registry credentials. This timing channel allows a competitor or market researcher to identify which skills on the registry are currently generating revenue through paid subscriptions, mapping the commercial activity distribution across the entire skill catalog without authentication.
The intelligence value of active billing cycle status extends beyond competitive analysis. For publishers targeting skills for acquisition or partnership discussions, knowing which skills are actively monetized narrows the target list to commercially validated products. For the registry itself, the billing cycle cadence reveals product usage patterns that inform platform pricing strategy — information that is commercially sensitive and that the registry has not consented to make publicly available through any official channel. The timing oracle requires no credentials, no interaction with any authenticated endpoint, and produces reliable results with fewer than twenty HTTP requests per skill probed.
// CORS87-003 — VULNERABLE: Origin reflected before auth — timing oracle on billing cycle
const express = require('express');
const cors = require('cors');
const { billingCache } = require('../cache/billing');
const { requireSession } = require('../middleware/auth');
const router = express.Router();
router.get('/skills/:id/subscription/invoice',
cors({ origin: true }), // reflects Origin before auth runs — timing oracle enabled
requireSession,
async (req, res) => {
const invoice = await billingCache.getCurrentInvoice(req.params.id);
res.json(invoice);
}
);
module.exports = router;
Billing cycle status reveals which skills are actively monetized — a timing oracle over the entire skill catalog is a commercially sensitive map of the registry's revenue distribution that neither the registry nor individual publishers have consented to publish. Authenticating before CORS header issuance eliminates the unauthenticated channel; a constant-time response floor of 50ms closes the residual timing gap between warm billing cache hits and cold database lookups that persist even with correct middleware ordering.
// CORS87-003 — FIXED: auth before CORS; constant-time response floor 50ms
const express = require('express');
const { billingCache } = require('../cache/billing');
const { requireSession } = require('../middleware/auth');
const { applyCorsAllowlist } = require('../middleware/cors');
const INVOICE_RESPONSE_FLOOR_MS = 50;
const router = express.Router();
router.get('/skills/:id/subscription/invoice',
requireSession,
applyCorsAllowlist,
async (req, res) => {
const start = Date.now();
const invoice = await billingCache.getCurrentInvoice(req.params.id);
const elapsed = Date.now() - start;
if (elapsed < INVOICE_RESPONSE_FLOOR_MS) {
await new Promise(r => setTimeout(r, INVOICE_RESPONSE_FLOOR_MS - elapsed));
}
res.json(invoice);
}
);
module.exports = router;
CVSS score: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N — Base Score 3.7 (LOW); timing oracle requires repeated unauthenticated measurement and discloses only billing cycle activity status; remediation is warranted given the commercial intelligence enablement across the full skill catalog.
CORS87-004 — Credential-bearing CORS deletes invoice records destroying tax compliance and procurement audit trails
The DELETE /api/skills/:id/subscription/:invoiceId endpoint permanently removes an invoice record from the billing system, with no soft-delete or retention window. Publishers rely on invoice records for three distinct compliance obligations: tax filing, where VAT and sales tax calculations reference historical invoice amounts and jurisdiction codes; enterprise procurement workflows, where corporate buyers require an unbroken invoice history to reconcile the registry subscription against purchase order systems and expense policies; and contractual audit trails, where premium plan agreements specify minimum record retention periods that the publisher is obligated to maintain. With cors({origin:true,credentials:true}), any cross-origin page visited by an authenticated billing admin can delete any invoice on any skill in the registry.
The regulatory dimension of invoice deletion makes this vulnerability particularly severe. In EU jurisdictions subject to VAT rules, invoice records must be retained for a minimum of seven years. In US jurisdictions subject to state sales tax nexus rules, records must be retained for the lookback period of applicable statutes of limitations, typically three to six years. Deletion of invoice records during these retention windows creates direct regulatory liability for the publisher and potentially for the registry as the merchant of record. An attacker targeting a specific publisher can selectively delete invoices from periods that fall within the publisher's current tax year, forcing the publisher to reconstruct their billing history from alternative sources — often incomplete — ahead of a tax filing deadline. The attack requires only one admin session and completes in seconds for any volume of historical invoices.
// CORS87-004 — VULNERABLE: credential-bearing CORS on invoice deletion endpoint
const express = require('express');
const cors = require('cors');
const { db } = require('../db');
const { requireSession, requireBillingAdmin } = require('../middleware/auth');
const router = express.Router();
router.delete('/skills/:id/subscription/:invoiceId',
cors({ origin: true, credentials: true }),
requireSession,
requireBillingAdmin,
async (req, res) => {
await db.deleteInvoice(req.params.id, req.params.invoiceId);
res.json({ deleted: req.params.invoiceId });
}
);
module.exports = router;
Invoice records are subject to statutory retention requirements in most jurisdictions — their deletion during a retention window creates direct regulatory liability for both the publisher and the registry as merchant of record. Soft-delete with a minimum seven-year retention window matches the most conservative jurisdiction requirement and provides a recovery path for invoices deleted via this CORS attack; re-authentication before deletion raises the bar against session-hijack exploitation; the mandatory reason field creates the forensic record needed to distinguish legitimate administrative corrections from attacker-driven deletion.
// CORS87-004 — FIXED: auth before CORS; re-auth; soft-delete 7-year retention; audit log
const express = require('express');
const { db } = require('../db');
const { requireSession, requireBillingAdmin, reAuthRequired } = require('../middleware/auth');
const { applyCorsAllowlist } = require('../middleware/cors');
const { csrfProtection } = require('../middleware/csrf');
const { auditLog } = require('../audit');
const INVOICE_RETENTION_YEARS = 7;
const router = express.Router();
router.delete('/skills/:id/subscription/:invoiceId',
requireSession,
applyCorsAllowlist,
csrfProtection,
requireBillingAdmin,
reAuthRequired,
async (req, res) => {
const retainUntil = new Date();
retainUntil.setFullYear(retainUntil.getFullYear() + INVOICE_RETENTION_YEARS);
await db.softDeleteInvoice(req.params.id, req.params.invoiceId, {
deletedBy: req.session.userId,
reason: req.body.reason,
retainUntil
});
await auditLog.write({
action: 'billing.invoice.delete',
skillId: req.params.id,
invoiceId: req.params.invoiceId,
actorId: req.session.userId,
reason: req.body.reason,
retainUntil,
at: new Date()
});
res.json({ deleted: req.params.invoiceId, retainableUntil: retainUntil });
}
);
module.exports = router;
CVSS score: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H — Base Score 8.1 (HIGH); integrity impact reflects permanent erasure of statutory invoice records; availability impact reflects immediate loss of tax compliance documentation and enterprise procurement audit trail integrity for all affected publishers.
SkillAudit checks for all SA-SKL-CORS vulnerability patterns including credential-bearing CORS before auth on billing subscription endpoints, wildcard ACAO on subscription upgrade operations, timing oracle misconfigurations on invoice generation checks, and soft-delete enforcement on invoice record deletion. Get a graded report with line-level code fixes in 60 seconds.
Get a free audit