Claude MCP skill CORS misconfiguration — skill install and deployment pipeline endpoints — SA-SKL-CORS54
SA-SKL-CORS54 documents four CORS misconfiguration patterns in MCP skill registry skill install and deployment pipeline endpoints. Install endpoints bridge the registry with live CI/CD infrastructure — a CORS misconfiguration here does not just leak data; it allows an attacker to trigger real skill installations into victim environments, enumerate which CI systems have active skill integrations, and cancel or remove install records that are required for compliance audits. Credential-bearing CORS on the install history endpoint exposes CI environment names, pipeline configurations, and failed install error details. Wildcard ACAO on the install creation endpoint lets any page trigger skill installation into victim CI environments with attacker-specified configuration overrides. A timing oracle on the install status endpoint enumerates which skills have active CI integrations. And credential-bearing CORS on the install removal endpoint lets any origin cancel CI pipelines and remove the install history that compliance audits depend on.
cors({origin:true,credentials:true}) on GET /api/skills/:id/installs; any origin reads full install history including target environments, install counts, CI pipeline names, and failed install error details using victim session; fix: allowlist; requireSession; scope to caller's install records; redact environment metadataACAO: * on POST /api/skills/:id/install; any page triggers skill installation into victim's CI environment with attacker-specified target environment and configuration overrides; fix: remove wildcard; require session; requireRole('deployer'); CSRF token; Zod InstallRequestSchema; validate target environment against caller's allowed setACAO origin reflection on GET /api/skills/:id/install/status emitted before ownership check; timing oracle reveals install pipeline stage transitions with sub-second precision, enumerating which skills have active CI integrations; fix: auth before CORS emission; unified WHERE clause; normalize 403/404 latencycors({origin:true,credentials:true}) on DELETE /api/skills/:id/installs/:installId; any origin cancels or removes any install record using victim session, breaking CI pipelines and removing install history needed for compliance audits; fix: allowlist + requireSession + ownership check + audit log on install removal eventsCORS54-001 — Credential-bearing CORS on install history exposes CI pipeline metadata
Severity: CRITICAL
The GET /api/skills/:id/installs endpoint is configured with cors({origin:true,credentials:true}). Any origin can read the full install history for any skill using the victim's session. The install history document includes target environment names (production, staging, ci-runner-01), install counts broken down by environment, CI pipeline names, triggering user IDs, install timestamps, and — critically — full error details from failed installs that may include partial configuration values, path structures, or environment variable names from the CI system.
Failed install error details are the most sensitive component. When a skill install fails, the error response typically includes the exact line of configuration that caused the failure, the environment variable that was missing or mismatched, and the filesystem paths that the install script attempted to access. These error strings are essentially a free documentation dump of the CI environment's internal configuration — information that an attacker would otherwise need persistent shell access to gather. Combined with CI pipeline names, an attacker who reads install history via CORS54-001 can map the victim organization's CI topology from a browser page visit.
// GET /api/skills/:id/installs — cors({origin:true,credentials:true}) on router
router.use(cors({ origin: true, credentials: true }));
router.get('/:id/installs', requireSession, async (req, res) => {
const installs = await InstallRecord.find({ skillId: req.params.id })
.populate('environment') // includes full CI environment metadata
.populate('errors'); // includes full error details from failed installs
return res.json(installs);
});
// GET /api/skills/:id/installs — allowlist cors + ownership scope + redacted errors
const installCors = cors({ origin: process.env.ALLOWED_ORIGINS.split(','), credentials: true });
router.get('/:id/installs', installCors, requireSession, async (req, res) => {
// Only return installs the caller owns or is authorized to view
const installs = await InstallRecord.find({
skillId: req.params.id,
installedBy: req.session.userId,
}).select('targetEnvName status installedAt installCount -_id'); // no error details
return res.json(installs);
});
CORS54-002 — Wildcard ACAO on install creation triggers unauthorized skill installations
Severity: CRITICAL
The POST /api/skills/:id/install endpoint returns Access-Control-Allow-Origin: *. Any web page can trigger a skill installation into the victim's CI environment with attacker-specified target environment and configuration overrides. The install request body accepts a target environment identifier and a configuration overrides object — both are passed without validation to the install pipeline that provisions the skill into the specified CI environment. An attacker who controls these parameters can install any registry skill (including malicious ones) into any CI environment the victim has deployer access to, with attacker-specified configuration that may override security settings, hook scripts, or permission scopes.
Install endpoints are CI provisioning surfaces, not read operations. A CORS misconfiguration on an install endpoint does not just leak data — it allows an attacker to provision infrastructure into the victim's live CI environment. Always require session authentication, deployer role verification, CSRF token validation, and target environment allowlist enforcement before triggering any install workflow.
// POST /api/skills/:id/install — ACAO:* with no CSRF or environment validation
router.post('/:id/install', requireSession, async (req, res) => {
const { targetEnv, configOverrides } = req.body;
await InstallPipeline.trigger({
skillId: req.params.id,
targetEnv, // attacker-controlled
configOverrides, // attacker-controlled; no schema validation
triggeredBy: req.session.userId,
});
return res.status(202).json({ triggered: true });
});
// POST /api/skills/:id/install — allowlist cors + deployer role + Zod validation
const InstallRequestSchema = z.object({
targetEnv: z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/),
configOverrides: z.object({
timeout: z.number().min(10).max(600).optional(),
retries: z.number().min(0).max(5).optional(),
}).strict().optional(),
});
router.post('/:id/install', installCors, requireSession, requireRole('deployer'),
verifyCsrf, async (req, res) => {
const parsed = InstallRequestSchema.safeParse(req.body);
if (!parsed.success) return res.status(400).json({ error: 'Invalid install request' });
// Validate target environment belongs to caller's authorized set
const allowedEnvs = await Environment.find({ ownerId: req.session.userId });
const isAllowed = allowedEnvs.some(e => e.name === parsed.data.targetEnv);
if (!isAllowed) return res.status(403).json({ error: 'Target environment not authorized' });
await InstallPipeline.trigger({
skillId: req.params.id,
targetEnv: parsed.data.targetEnv,
configOverrides: parsed.data.configOverrides ?? {},
triggeredBy: req.session.userId,
});
return res.status(202).json({ triggered: true });
}
);
CORS54-003 — Timing oracle on install status endpoint enumerates active CI integrations
Severity: MEDIUM
The GET /api/skills/:id/install/status endpoint reflects the Origin header before performing the ownership check. Skills with active CI integrations have install status records with live pipeline state that is maintained in a hot cache. Skills without active CI integrations require a full record scan that takes measurably longer. The latency difference — typically 10–30 ms — is cross-origin-detectable and reveals which skills have active CI integrations before the caller is authorized to read the status. An attacker can use this oracle to identify the highest-value CORS54-001 targets: skills with active integrations are more likely to have recent error logs and pipeline metadata worth exfiltrating. The fix performs auth and ownership check before emitting any CORS header and normalizes response latency across both paths.
CORS54-004 — Credential-bearing CORS on install removal breaks CI pipelines and destroys compliance records
Severity: CRITICAL
The DELETE /api/skills/:id/installs/:installId endpoint shares the same cors({origin:true,credentials:true}) policy as CORS54-001. Any web page can cancel or remove any install record using the victim's session. Install records serve two operational purposes: they track the active provisioning state of skills in CI environments (removing them triggers deprovisioning), and they constitute the historical audit trail required by compliance frameworks that mandate a record of what software was installed in production environments and when. Removing install records breaks live CI pipelines immediately — any subsequent pipeline run that references the removed install record fails with a resource-not-found error — and also retroactively removes the compliance evidence for audits that review historical installation provenance.
// DELETE /api/skills/:id/installs/:installId — no ownership check, no audit log
router.delete('/:id/installs/:installId', requireSession, async (req, res) => {
await InstallRecord.deleteOne({ _id: req.params.installId });
return res.status(204).end();
});
// DELETE /api/skills/:id/installs/:installId — allowlist cors + ownership check + audit log
router.delete('/:id/installs/:installId', installCors, requireSession, async (req, res) => {
const record = await InstallRecord.findOne({
_id: req.params.installId,
skillId: req.params.id,
installedBy: req.session.userId, // ownership check
});
if (!record) return res.status(404).json({ error: 'Not found' });
await record.deleteOne();
await AuditLog.create({
action: 'skill.install.removed',
skillId: req.params.id,
installId: req.params.installId,
targetEnv: record.targetEnvName,
removedBy: req.session.userId,
timestamp: new Date(),
});
return res.status(204).end();
});
Remediation summary
| Finding | Severity | Primary remediation | Secondary hardening |
|---|---|---|---|
| CORS54-001 | Critical | Allowlist CORS; scope to caller's own installs; redact error details and environment metadata from public fields | Audit install record fields for CI topology disclosure; enforce ownership on all install read paths |
| CORS54-002 | Critical | Remove wildcard; require session + deployer role + CSRF; Zod InstallRequestSchema; validate target env against caller's authorized set | Rate-limit install creation; alert on install triggers from unexpected origins |
| CORS54-003 | Medium | Auth before CORS emission; normalize 403/404 latency; unified query path for status lookup | Add jitter to status endpoint; use constant-time ownership check |
| CORS54-004 | Critical | Allowlist CORS; ownership check on install record; audit log all removals with targetEnv and timestamp | Consider soft-delete with configurable retention for compliance; alert on anomalous bulk removal |
Scan your MCP skill registry install endpoints for CORS54 patterns. SkillAudit checks install and deployment pipeline routes for credential-bearing CORS policies, missing ownership checks, and absent audit logging. See also SA-SKL-CORS53 and SA-SKL-CORS53 blog. Connect at skillaudit.dev.