Claude MCP skill CORS misconfiguration — skill version pinning and dependency resolution endpoints (SA-SKL-CORS82)
SA-SKL-CORS82 identifies four CORS misconfiguration vulnerabilities in MCP skill registry skill version pinning and dependency resolution endpoints. Credential-bearing CORS on the dependency graph endpoint exposes the full pinned dependency manifest including internal fork identifiers that reveal private code-forking practices, private package registry URLs that expose internal infrastructure, and admin-only vulnerability annotation entries that disclose unpatched CVEs tracked against specific dependency versions using the victim admin's session; wildcard ACAO on the dependency update endpoint allows any page to trigger mass dependency resolution under the admin's identity, and flooding these requests simultaneously exhausts the registry's upstream package API rate limit budget causing dependency resolution to fail with rate-limit errors for every legitimate installation attempt across the entire platform; a timing oracle on the lock resolution endpoint reveals which skills are currently mid-resolution by exploiting the cache latency differential between lock-active warm entries (~5ms) and cold queries (~190ms); and credential-bearing CORS on the pinned dependency removal endpoint allows any page to silently delete pinned packages from any skill, permanently breaking that skill's installation pipeline for every user who attempts to install it.
GET /api/skills/:id/dependencies has cors({origin:true,credentials:true}) — any origin reads full dependency graph including pinned versions with internal fork identifiers, private package registry URLs, and admin-only vulnerability annotation entries using victim admin sessionPOST /api/skills/:id/dependencies/update has ACAO:* — any page triggers dependency update under victim admin identity; attacker floods update requests exhausting package registry API rate limits causing installation DoS for all usersGET /api/skills/:id/dependencies/lock reflects Origin before auth check — timing oracle reveals skills with active dependency lock resolution in progress (resolution-active warm cache ~5ms vs cold ~190ms)DELETE /api/skills/:id/dependencies/:packageId has cors({origin:true,credentials:true}) — any origin removes pinned dependencies from skill permanently breaking installation for all usersCORS82-001 — Credential-bearing CORS exposes private registry URLs and vulnerability annotations
The GET /api/skills/:id/dependencies endpoint returns the full dependency manifest for a skill, including every pinned package version, internal fork identifiers that expose the registry's private code-forking infrastructure, the private package registry URLs from which each dependency is resolved, and admin-only vulnerability annotation entries that document unpatched CVEs tracked against specific dependency versions. With cors({origin:true,credentials:true}) applied before authentication, any cross-origin page visited by an authenticated admin reads this complete manifest using the admin's session credentials. An attacker extracting private registry URLs can fingerprint internal infrastructure and attempt direct access; the exposed vulnerability annotations constitute a roadmap of unpatched weaknesses that can be exploited before patches are deployed.
// CORS82-001 — VULNERABLE
router.get('/skills/:id/dependencies',
cors({ origin: true, credentials: true }),
requireSession,
async (req, res) => {
const isAdmin = req.session.roles.includes('registry_admin');
const deps = await db.getSkillDependencies(req.params.id, {
includeInternalForkIds: true,
includePrivateRegistryUrls: true,
includeVulnAnnotations: isAdmin
});
res.json(deps);
}
);
// CORS82-001 — FIXED: auth before CORS; strip admin-only fields; separate admin endpoint
router.get('/skills/:id/dependencies',
requireSession,
applyCorsAllowlist,
async (req, res) => {
const deps = await db.getSkillDependencies(req.params.id, {
includeInternalForkIds: false,
includePrivateRegistryUrls: false,
includeVulnAnnotations: false
});
res.json(deps);
}
);
// Admin-only endpoint — separate route with admin role gate
router.get('/admin/skills/:id/dependencies',
requireSession,
requireAdminRole,
applyCorsAllowlist,
async (req, res) => {
const deps = await db.getSkillDependencies(req.params.id, {
includeInternalForkIds: true,
includePrivateRegistryUrls: true,
includeVulnAnnotations: true
});
res.json(deps);
}
);
Private package registry URLs in dependency manifests are high-value targets. Once an attacker knows your internal registry hostname and path structure they can probe authentication mechanisms, attempt credential stuffing against package registry credentials, and enumerate all packages hosted internally. The vulnerability annotation leak compounds this by revealing which dependency versions are unpatched and therefore exploitable.
CORS82-002 — Wildcard ACAO on update endpoint exhausts package registry rate limits
The POST /api/skills/:id/dependencies/update endpoint triggers an upstream package registry resolution pass that counts against the registry's shared API rate limit budget. With ACAO:*, any page can trigger this endpoint without credentials and direct it at any skill ID. An attacker floods update requests across hundreds of concurrent skill IDs, consuming the entire rate limit allocation in seconds; subsequent legitimate dependency resolution requests from real users receive rate-limit error responses, causing all skill installations platform-wide to fail until the rate limit window resets. Because the endpoint accepts unauthenticated cross-origin requests, rate-limiting by user identity provides no protection — the attacker exhausts the shared budget from one browser tab.
// CORS82-002 — VULNERABLE: wildcard ACAO on dependency update endpoint
router.post('/skills/:id/dependencies/update',
cors({ origin: '*' }),
requireSession,
async (req, res) => {
const result = await dependencyService.resolveAndUpdate({
skillId: req.params.id,
requestedBy: req.session.userId
});
res.json({ updated: result.updatedCount, lockHash: result.lockHash });
}
);
// CORS82-002 — FIXED: allowlist CORS; CSRF token; per-skill rate limit 2/hour
router.post('/skills/:id/dependencies/update',
requireSession,
applyCorsAllowlist,
csrfProtection,
requireSkillOwnerRole,
rateLimit({ key: req => `dep-update:${req.params.id}`, max: 2, window: '1h' }),
async (req, res) => {
const result = await dependencyService.resolveAndUpdate({
skillId: req.params.id,
requestedBy: req.session.userId
});
res.json({ updated: result.updatedCount, lockHash: result.lockHash });
}
);
Shared upstream rate limit budgets require skill-level throttling independent of user identity. Even with CORS fixed, a single skill owner can exhaust the budget by polling the update endpoint. A per-skill limit of 2 updates per hour matches normal dependency management cadence while preventing budget exhaustion attacks.
CORS82-003 — Timing oracle reveals skills with active dependency lock resolution via Origin reflection
The GET /api/skills/:id/dependencies/lock endpoint returns the resolved dependency lock file for a skill. Skills that have an active lock resolution job in progress maintain a warm cache entry that returns in approximately 5ms. Skills with no active resolution hit a cold database path that takes approximately 190ms. Because the endpoint reflects the requesting Origin header before the authentication check, an unauthenticated cross-origin request can measure this latency differential to identify exactly which skills are currently undergoing dependency resolution. This reveals timing intelligence about skill update activity that can be used to target supply-chain injection attacks during the brief window when new dependency versions are being resolved and before the resulting lock file has been integrity-checked.
// CORS82-003 — VULNERABLE: Origin reflected before auth
router.get('/skills/:id/dependencies/lock',
cors({ origin: true }),
requireSession,
async (req, res) => {
const lock = await lockResolutionCache.get(`lock:${req.params.id}`)
|| await db.getDependencyLockFile(req.params.id);
res.json(lock);
}
);
// CORS82-003 — FIXED: auth before CORS; constant-time response floor 50ms
const LOCK_RESPONSE_FLOOR_MS = 50;
router.get('/skills/:id/dependencies/lock',
requireSession,
applyCorsAllowlist,
async (req, res) => {
const start = Date.now();
const lock = await lockResolutionCache.get(`lock:${req.params.id}`)
|| await db.getDependencyLockFile(req.params.id);
const elapsed = Date.now() - start;
if (elapsed < LOCK_RESPONSE_FLOOR_MS) await sleep(LOCK_RESPONSE_FLOOR_MS - elapsed);
res.json(lock);
}
);
Timing oracles on dependency resolution state are supply-chain attack enablers. Knowing a skill is mid-resolution allows a targeted attacker to race a malicious package upload against the resolution window. Fixing Origin reflection before auth eliminates the timing channel; the constant-time floor prevents residual measurement even after auth is correctly ordered.
CORS82-004 — Credential-bearing CORS removes pinned dependencies breaking all installations
The DELETE /api/skills/:id/dependencies/:packageId endpoint removes a pinned package entry from a skill's dependency manifest. Once removed, any user attempting to install that skill receives a dependency resolution error because the required package is no longer declared in the manifest. With cors({origin:true,credentials:true}), any cross-origin page visited by an authenticated admin can silently remove any dependency from any skill in the registry. An attacker who lures an admin to a malicious page can remove critical runtime dependencies from thousands of skills simultaneously, triggering cascading installation failures across the entire platform with no on-disk artifact that explains what changed.
// CORS82-004 — VULNERABLE: credential-bearing CORS on dependency removal
router.delete('/skills/:id/dependencies/:packageId',
cors({ origin: true, credentials: true }),
requireSession,
requireSkillOwnerRole,
async (req, res) => {
await db.removePinnedDependency(req.params.id, req.params.packageId);
res.json({ removed: req.params.packageId });
}
);
// CORS82-004 — FIXED: auth before CORS; re-auth; soft-delete 90-day retention; audit log
router.delete('/skills/:id/dependencies/:packageId',
requireSession,
applyCorsAllowlist,
csrfProtection,
requireSkillOwnerRole,
reAuthRequired,
async (req, res) => {
const expiresAt = new Date(Date.now() + 90 * 24 * 60 * 60 * 1000);
await db.softDeletePinnedDependency(req.params.id, req.params.packageId, {
deletedBy: req.session.userId, expiresAt
});
await auditLog.write({
action: 'dependency.pinned.remove',
skillId: req.params.id,
packageId: req.params.packageId,
actorId: req.session.userId,
at: new Date()
});
res.json({ removed: req.params.packageId, reinstateableUntil: expiresAt });
}
);
Hard-deleting pinned dependencies is irreversible without a backup restore. Soft-delete with 90-day retention ensures a skill owner can reinstate any accidentally or maliciously removed dependency through a self-service recovery path. The audit log provides the forensic record needed to identify whether a deletion was caused by an attacker exploiting the CORS misconfiguration or by a legitimate but mistaken owner action.
SkillAudit checks for all SA-SKL-CORS vulnerability patterns including credential-bearing CORS before auth, wildcard ACAO on state-mutating endpoints, timing oracle misconfigurations, and soft-delete enforcement on destructive operations. Get a graded report with line-level code fixes in 60 seconds.
Get a free audit