CORS Misconfigurations in MCP Skill Registry Skill Version and Changelog Management Endpoints
Version management and changelog endpoints occupy an underappreciated position in MCP skill registry attack surface: they handle data that is explicitly not public — draft versions, unreleased security patch notes, planned deprecation schedules — yet they are frequently built after the registry core with inconsistent CORS middleware. The four SA-SKL-CORS39 patterns expose how these oversights chain into a compound pre-disclosure attack: an attacker who can read draft changelog content in advance of a security patch knows not just what the vulnerability is, but precisely when and how the author plans to fix it, enabling coordinated exploitation before the patch ships.
In this post
- Why version and changelog endpoints are CORS-inconsistent
- CORS39-001 — Credential-bearing CORS on version history endpoint reads draft versions
- CORS39-002 — Wildcard ACAO on draft creation endpoint enables quota abuse and notification spam
- CORS39-003 — Origin reflection timing oracle on changelog endpoint
- CORS39-004 — Credential-bearing CORS on version delete lets any origin yank pinned versions
- Compound pre-disclosure attack chain
- Detection with SkillAudit AST queries
- Summary and remediation checklist
cors({origin:true,credentials:true}) on GET /api/skills/:id/versions; any origin reads full version history including draft versions and unreleased security patch changelogs using victim sessionACAO: * on POST /api/skills/:id/versions/draft; any page creates draft versions on behalf of victim, consuming authoring quota and overwriting existing drafts; triggers pre-publish notification workflowsACAO origin reflection on GET /api/skills/:id/changelog emitted before ownership check; timing oracle reveals changelog entry existence for private skills across all orgscors({origin:true,credentials:true}) on DELETE /api/skills/:id/versions/:versionId; any origin deletes any version using victim admin session, breaking pinned installations globallyWhy version and changelog endpoints are CORS-inconsistent
When a team builds an MCP skill registry, the core authenticated API — submit, search, install, rate — is typically handled in a single sprint with a unified CORS middleware applied at the router level. Version management comes later, often in a dedicated sub-router mounted under /api/skills/:id/versions, and changelog endpoints are frequently a third addition, added as a user-experience feature after the registry is already in production. Each of these additions carries the risk of either missing the CORS middleware entirely, or of picking up a different, more permissive CORS configuration than the one applied to the core API.
The result is a consistent pattern: version history and draft endpoints frequently have cors({origin:true,credentials:true}) applied to them because an engineer copied from an internal docs example that was designed for a trusted first-party client, while changelog endpoints reflect the Origin header from a utility library without realizing that reflection without an allowlist is equivalent to allowing all origins. Version delete endpoints, added for admin tooling, often carry the same permissive CORS config because the engineer who built the admin panel needed credentials and reached for the most permissive option that worked in their browser.
These inconsistencies matter more for version and changelog endpoints than for most other parts of the registry API because the data they expose is specifically not public. A skill's current published version and its badge are public. Its draft next version — including unreleased security patches, planned breaking changes, and changelog entries describing vulnerabilities being fixed — is explicitly private. CORS misconfigurations on these endpoints do not just expose generic user data; they expose the registry's most sensitive pre-publication security information to any origin that can trick a logged-in author or admin into visiting a malicious page.
CORS39-001 — Credential-bearing CORS on version history endpoint reads draft versions
The version history endpoint GET /api/skills/:id/versions is configured with cors({origin:true,credentials:true}). The origin:true option in the Node.js cors package echoes the request's Origin header back as Access-Control-Allow-Origin. Combined with credentials:true, which sets Access-Control-Allow-Credentials: true, this tells the browser that cross-origin requests that include cookies and authorization headers are permitted from any origin that sends a request. This is the most dangerous CORS configuration possible for an authenticated endpoint.
CORS39-001 attack: An attacker hosts a page at evil.example.com. When a logged-in skill author visits, the page calls fetch("https://registry.example.com/api/skills/target-skill-id/versions", {credentials:"include"}). The browser sends the victim's session cookie. The server reflects the attacker's origin and sets ACAC: true. The browser permits the response to be read. The attacker's JavaScript reads the full version list — including draft versions that have never been published, their version numbers, their changelogDraft fields describing vulnerabilities being fixed, and their target release dates.
The critical escalation is what a sophisticated attacker does with draft changelog content. If the registry is used for security-sensitive MCP skills — authentication helpers, credential managers, tool permission brokers — an unreleased changelog entry that reads "fix SSRF in outbound webhook handler" or "patch command injection in shell-exec tool" tells an attacker exactly what vulnerability to look for in the current published version and exactly how long they have before a patch ships. This is a compound disclosure chain: CORS misconfiguration on a version endpoint becomes a pre-disclosure intelligence feed.
The correct fix requires three independent changes. First, replace cors({origin:true,credentials:true}) with an explicit allowlist of first-party origins: cors({origin: ['https://registry.example.com', 'https://app.example.com'], credentials:true}). Second, add a requireSession middleware before the CORS middleware so that unauthenticated requests never receive a credentialed CORS response. Third, modify the query to return only published versions for callers who are not the skill owner — public callers should see status = 'published' rows only, never draft or withdrawn versions regardless of their CORS authorization.
// WRONG — reflects any Origin with credentials
router.get('/skills/:id/versions', cors({origin:true, credentials:true}), async (req, res) => {
const versions = await db.query('SELECT * FROM versions WHERE skillId = ?', [req.params.id]);
res.json(versions);
});
// RIGHT — allowlist + session gate + visibility filter
const allowedOrigins = new Set(['https://registry.example.com', 'https://app.example.com']);
const strictCors = cors({
origin: (origin, cb) => cb(null, allowedOrigins.has(origin) ? origin : false),
credentials: true
});
router.get('/skills/:id/versions', requireSession, strictCors, async (req, res) => {
const isOwner = await db.isSkillOwner(req.params.id, req.session.userId);
const versions = await db.query(
isOwner
? 'SELECT * FROM versions WHERE skillId = ?'
: 'SELECT * FROM versions WHERE skillId = ? AND status = \'published\'',
[req.params.id]
);
res.json(versions);
});
CORS39-002 — Wildcard ACAO on draft creation endpoint enables quota abuse and notification spam
The draft creation endpoint POST /api/skills/:id/versions/draft responds with Access-Control-Allow-Origin: *. At first glance a wildcard on a POST endpoint seems harmless: browsers do not send cookies with wildcard CORS responses, so attackers cannot use a victim's session to create drafts. But this reasoning fails in two directions.
First, many registry clients authenticate using Bearer tokens stored in localStorage rather than HttpOnly cookies. localStorage tokens are accessible to JavaScript and are therefore included in fetch requests regardless of CORS policy. An attacker who has found an XSS vector on any same-site page — including analytics dashboards, documentation pages, or admin panels hosted on a subdomain — can use that XSS to read the token from localStorage and then issue the cross-origin draft creation request with the Authorization header, which the wildcard CORS policy happily permits.
CORS39-002 secondary impact: Even without an XSS vector, the wildcard ACAO on a draft creation endpoint has a notification side-effect. Many registries send pre-publish notifications to skill subscribers and dependent-skill maintainers when a new draft version is created. An attacker who creates a draft using the victim's session triggers these notifications, alerting the victim's subscriber base that a new version is imminent. If the attacker repeats this across dozens of drafts, they exhaust the victim's authoring quota (a rate-limited resource in most registries), prevent the legitimate author from creating drafts, and generate subscriber notification fatigue that causes real release announcements to be ignored.
The fix requires removing the wildcard entirely and adding session and role requirements. The endpoint should require requireSession, check requireRole('author'), verify that req.session.userId owns the skill in question, and add a CSRF token check for browser clients. If the endpoint must support programmatic CI/CD access, that access should be gated on a scoped API key with per-skill scope, not on a session that can be exercised cross-origin.
// WRONG — wildcard ACAO on a state-mutating endpoint
router.post('/skills/:id/versions/draft',
cors({origin: '*'}),
async (req, res) => {
await db.createDraft(req.params.id, req.body);
res.json({ ok: true });
}
);
// RIGHT — no wildcard, full auth chain, ownership check
router.post('/skills/:id/versions/draft',
requireSession,
requireRole('author'),
csrfProtection,
strictCors,
async (req, res) => {
const skill = await db.getSkill(req.params.id);
if (skill.ownerId !== req.session.userId) return res.status(403).json({ error: 'forbidden' });
const body = DraftVersionSchema.parse(req.body);
await db.createDraft(req.params.id, body);
res.json({ ok: true });
}
);
CORS39-003 — Origin reflection timing oracle on changelog endpoint
The changelog endpoint GET /api/skills/:id/changelog reflects the request Origin header as Access-Control-Allow-Origin before it performs the ownership check. The middleware executes in this order: (1) emit ACAO: <origin> and ACAC: true, (2) check whether the authenticated user has access to the skill's changelog. When the user does not have access, the server returns a 403 — but the CORS headers have already been emitted.
An attacker exploits this as a timing oracle. The time between request arrival and response varies depending on how far the server gets into the ownership check before returning. When the requested skill ID exists and has changelog entries, the server queries the changelog table, discovers ownership mismatch, and returns 403 with a measurable query latency. When the skill ID does not exist or has no changelog entries, the server returns 404 or an empty 200 with a different latency profile. By measuring response times across a large number of skill IDs, the attacker builds a map of which private skills have changelog entries — equivalently, which private skills have unreleased versions in progress, including security patches.
CORS39-003 compound effect: When chained with CORS39-001, the timing oracle becomes a targeting tool. CORS39-003 identifies which private skills have unreleased changelog entries. CORS39-001 then exfiltrates the content of those entries. Together they provide a complete pre-disclosure intelligence feed without requiring the attacker to know skill IDs in advance — the oracle provides the discovery, the credential-bearing CORS provides the exfiltration.
The fix requires reordering middleware so that authentication and ownership checks always complete before CORS headers are emitted. The query should also be unified to include both skillId and orgId in a single WHERE clause, so that cross-org timing differences do not leak information about skill existence. Response latency should be normalized using a minimum-latency padding strategy for 403 and 404 responses.
// WRONG — CORS emitted before auth check
router.get('/skills/:id/changelog',
cors({origin: (origin, cb) => cb(null, origin)}), // reflects any origin
async (req, res) => {
if (!req.session?.userId) return res.status(401).json({ error: 'unauthenticated' });
const access = await db.checkOwnership(req.params.id, req.session.userId);
if (!access) return res.status(403).json({ error: 'forbidden' });
const entries = await db.getChangelog(req.params.id);
res.json(entries);
}
);
// RIGHT — auth and ownership first, then CORS, unified query
router.get('/skills/:id/changelog',
requireSession,
async (req, res) => {
// Unified WHERE — no timing difference between non-existent skill and no-access skill
const entries = await db.query(
'SELECT * FROM changelog WHERE skillId = ? AND orgId = ?',
[req.params.id, req.session.orgId]
);
if (!entries.length) return res.status(403).json({ error: 'forbidden' });
strictCors(req, res, () => res.json(entries));
}
);
CORS39-004 — Credential-bearing CORS on version delete lets any origin yank pinned versions
The version delete endpoint DELETE /api/skills/:id/versions/:versionId is configured with cors({origin:true,credentials:true}) — the same credential-bearing reflection pattern as CORS39-001. The endpoint performs a hard delete: it removes the version record from the database and unpublishes the associated artifact from the CDN. Any installed agent that has pinned to the deleted version will receive a 404 on its next skill resolution.
An attacker who tricks an admin into visiting a malicious page can silently delete any version of any skill that the admin has access to. Because most registry admins have access to all skills in their organization, and because many registries have a small number of admins with organization-wide admin roles, the blast radius of a single cross-site request is the entire organization's version history. If the attacker targets a widely-used skill, the deletion of a pinned version breaks every downstream agent that relies on that exact version — a supply-chain disruption executed with nothing more than a cross-origin DELETE.
CORS39-004 supply chain impact: Version pinning is a primary security control in MCP skill deployments. Teams pin to known-good versions precisely to avoid unexpected updates that could introduce regressions or security changes. An attacker who can delete pinned versions using CORS39-004 forces those teams to either accept an auto-upgrade to the latest version (which the attacker may have compromised separately) or suffer a broken agent installation. The attack is especially effective when timed to coincide with a team's deployment window, when engineers are least likely to notice that their pinned version has disappeared.
The fix requires four changes. First, replace credential-bearing CORS reflection with an allowlist. Second, add requireRole('admin') before the endpoint handler. Third, change the delete operation from a hard delete to a soft delete — set status = 'yanked' rather than removing the row, so that existing pinned installations receive a meaningful error rather than a 404 that is indistinguishable from a network error. Fourth, emit an audit log entry and send a webhook notification to all consumers who have pinned to the deleted version, giving them advance notice before their agent breaks.
// WRONG — hard delete with credential-bearing CORS
router.delete('/skills/:id/versions/:versionId',
cors({origin: true, credentials: true}),
async (req, res) => {
await db.query('DELETE FROM versions WHERE id = ?', [req.params.versionId]);
await cdn.unpublish(req.params.versionId);
res.json({ ok: true });
}
);
// RIGHT — allowlist CORS, role check, soft-delete, audit log, consumer notification
router.delete('/skills/:id/versions/:versionId',
requireSession,
requireRole('admin'),
strictCors,
async (req, res) => {
const version = await db.getVersion(req.params.versionId);
if (!version || version.skillId !== req.params.id) return res.status(404).json({ error: 'not found' });
await db.query(
'UPDATE versions SET status = \'yanked\', yankReason = ?, yankedBy = ?, yankedAt = NOW() WHERE id = ?',
[req.body.reason || 'admin_action', req.session.userId, req.params.versionId]
);
await audit.log('version_yanked', { versionId: req.params.versionId, adminId: req.session.userId });
const consumers = await db.getPinnedConsumers(req.params.versionId);
await Promise.all(consumers.map(c => webhooks.notify(c.webhookUrl, { event: 'version_yanked', versionId: req.params.versionId })));
res.json({ ok: true, affected: consumers.length });
}
);
Compound pre-disclosure attack chain
The four CORS39 findings are most dangerous when combined. The compound pre-disclosure attack chain proceeds in four stages.
Stage 1 — Enumeration via timing oracle (CORS39-003). The attacker scans a range of skill IDs using the changelog endpoint timing oracle. For each skill ID, response latency identifies whether the skill has changelog entries — equivalently, whether the skill has an unreleased version in draft. The attacker builds a list of skill IDs with active changelogs, prioritizing those belonging to security-sensitive skill categories: authentication helpers, secret managers, CI/CD tool bridges.
Stage 2 — Draft version exfiltration (CORS39-001). For each skill ID identified in Stage 1, the attacker uses CORS39-001 to exfiltrate the full version history including draft versions. The draft version records include changelogDraft fields that describe the vulnerability being fixed, the affected component, and the planned fix approach. The attacker now knows the vulnerability, the affected version, and the target release date — without having received any responsible disclosure notice from the author.
Stage 3 — Delay patching via quota exhaustion (CORS39-002). To maximize the window of exploitation, the attacker uses CORS39-002 to exhaust the author's authoring quota by creating dozens of empty drafts via cross-origin requests. This prevents the author from creating the legitimate security patch draft and delays the patch's release. The attacker also creates a draft with malicious changelog content to confuse the author's subscribers about which version contains the fix.
Stage 4 — Extend blast radius via version deletion (CORS39-004). After exploiting the vulnerability in the current published version — made possible by the advance knowledge from Stage 2 — the attacker uses CORS39-004 to delete the pinned version that the majority of downstream agents are running. This forces all consumers to auto-upgrade to the latest published version, which may also be compromised, or to leave their agents broken until a new patch is published.
Compound chain summary: CORS39-003 (timing oracle) discovers targets → CORS39-001 (credential-bearing CORS) exfiltrates draft security content → CORS39-002 (wildcard ACAO on draft creation) delays the legitimate patch → CORS39-004 (credential-bearing CORS on delete) disrupts pinned deployments. All four stages require only that the victim visits a single attacker-controlled page while logged in to the registry.
Detection with SkillAudit AST queries
SkillAudit's static analysis engine detects all four CORS39 patterns using AST queries that inspect middleware configuration at the route level rather than relying on string matching. The queries identify three classes of CORS misconfiguration: credential-bearing origin reflection (CORS39-001, CORS39-004), wildcard ACAO on non-GET endpoints (CORS39-002), and CORS middleware positioned before authentication or authorization checks (CORS39-003).
The credential-bearing reflection query walks the AST for Express router method calls and inspects their middleware array for cors() calls with both origin: true (or a function that returns the input origin) and credentials: true. When both are present, SkillAudit raises a CRITICAL finding regardless of the endpoint's HTTP method, because the combination is never safe on an authenticated endpoint regardless of what the endpoint does.
The wildcard-on-mutation query additionally checks the HTTP method of the route: a wildcard ACAO on a GET endpoint that returns only public data is a LOW finding; the same wildcard on a POST, PUT, PATCH, or DELETE endpoint is HIGH because it may interact with Bearer-token authentication patterns that make credentials available cross-origin even without cookie credentials.
The middleware-ordering query uses control-flow analysis to determine whether the CORS middleware node appears before the first authentication or session-check node in the middleware chain. When CORS is ordered before auth, SkillAudit flags a MEDIUM timing-oracle finding, noting that CORS headers can leak access-determination latency even when the response body is blocked.
All three query classes are available in SkillAudit's CI integration. When run as part of a GitHub Actions workflow on pull requests that touch router files, they catch CORS regressions before they are merged — including the common pattern of a developer adding a new sub-router without inheriting the CORS configuration from the parent router.
Summary and remediation checklist
| Finding | Severity | Root cause | Fix |
|---|---|---|---|
| CORS39-001 | CRITICAL | cors({origin:true,credentials:true}) on version history endpoint | Allowlist of first-party origins; requireSession; filter to published versions for non-owners |
| CORS39-002 | HIGH | ACAO: * on draft creation endpoint | Remove wildcard; add session, role, CSRF, and ownership checks; use scoped API keys for CI/CD access |
| CORS39-003 | MEDIUM | Origin reflection emitted before ownership check creates timing oracle | Auth and ownership before CORS emission; unified WHERE clause; normalize 403/404 latency |
| CORS39-004 | CRITICAL | cors({origin:true,credentials:true}) on version delete endpoint; hard delete | Allowlist CORS; requireRole('admin'); soft-delete only; audit log; consumer webhooks |
The common thread across all four findings is that CORS configuration for version and changelog endpoints was added separately from the registry core, with engineers making local decisions about CORS settings without awareness of the broader security model. The remediation is not just fixing each individual route — it is establishing a registry-wide CORS policy that is applied at the router level and cannot be overridden by individual route handlers, with an explicit allowlist, credential gating, and a code review gate that flags any new cors() call with origin: true or origin: '*'.
SkillAudit scans for all four CORS39 patterns plus 60+ additional CORS, SSRF, injection, deserialization, and privilege escalation findings in MCP skill registries. Paste your registry's GitHub URL to get a full report card, including whether your CORS middleware is applied consistently across all sub-routers.