Claude MCP skill privilege escalation — skill publication and verification status endpoints
SA-SKL-PRIVESC19 documents four privilege escalation vulnerabilities in MCP skill registry skill publication and verification status endpoints. JWT-encoded skill status claims let attackers self-grant the “verified” badge without undergoing review; missing admin role checks on the verification and featuring endpoints let any authenticated user mark skills as verified or feature them in paid placement slots; and a rate limit key scoped to only the skill ID (not the skill ID plus the requesting org) lets attackers with multiple accounts exhaust legitimate users’ request budgets while bypassing their own.
skillStatus claim; attacker crafts JWT with skillStatus:'verified' granting all verified-skill benefits (featured placement, trust badge, reduced rate limits) without review process; fix: fetch status from skill record in DB; JWT carries skillId only
PATCH /api/skills/:id/verify missing admin check; any authenticated user marks any skill as verified; fix: requireRole('admin'); require manual review record to exist in DB; audit log all verification changes
POST /api/skills/:id/feature missing admin check; any user promotes their skill to featured section displacing paid placements; fix: requireRole('admin'); billing check for paid featured slots; audit log
skillId; attacker with multiple accounts uses same skill across accounts to bypass per-skill rate limit; fix: rate limit key = skillId + orgId; server-side counter; never trust client-supplied rate limit headers
PRIVESC19-001 — JWT skillStatus claim forgery grants verified badge without review
The skill publication status is encoded as a skillStatus claim in the JWT issued when a skill is published. When a skill request is made, the registry reads decoded.skillStatus directly from the token to determine whether to show a verified badge, grant priority placement, and apply the reduced scan rate limit reserved for verified skills. An attacker who publishes a skill obtains a valid JWT from the registry, then crafts a new JWT with the same header and an identical payload except with skillStatus: 'verified' set, signing it with a known weak secret or exploiting an algorithm confusion vulnerability (e.g., RS256 to HS256 downgrade using the public key as the HMAC secret). The crafted token passes standard JWT signature verification if the downgrade is successful, and the skill receives all verified benefits without ever undergoing the review process.
// PRIVESC19-001 — VULNERABLE
// Skill status read from JWT claim — attacker crafts JWT with skillStatus:'verified'.
router.get('/skills/:id', async (req, res) => {
const token = req.headers.authorization?.split(' ')[1];
const decoded = jwt.verify(token, process.env.JWT_SECRET);
const skill = await db.skills.findById(req.params.id);
res.json({
...skill,
// VULNERABLE: status from JWT claim — attacker controls this via crafted token
isVerified: decoded.skillStatus === 'verified',
isFeatured: decoded.skillStatus === 'featured',
rateLimitTier: decoded.skillStatus === 'verified' ? 'premium' : 'standard',
});
});
JWTs encode identity claims, not authorization state: A JWT should carry the user’s or service account’s identity (subject, issuer, expiry, scopes) but never the authorization state of objects they interact with. Object state like skillStatus belongs in the database and must be fetched from there on each request. The database is the authoritative source; JWTs are authentication artifacts, not capability grants.
// PRIVESC19-001 — FIXED
// Fetch skill status from DB on every request; JWT carries skillId only (not status).
// Cache status server-side with short TTL to avoid N+1 queries without trusting the token.
const statusCache = new Map(); // skillId → { status, cachedAt }
const STATUS_TTL_MS = 30_000; // 30 second server-side cache
async function getSkillStatus(skillId) {
const cached = statusCache.get(skillId);
if (cached && (Date.now() - cached.cachedAt) < STATUS_TTL_MS) return cached.status;
const { status } = await db.skills.findStatusById(skillId);
statusCache.set(skillId, { status, cachedAt: Date.now() });
return status;
}
router.get('/skills/:id', requireSession, async (req, res) => {
const skill = await db.skills.findById(req.params.id);
if (!skill) return res.status(404).json({ error: 'Skill not found' });
// Fetch authoritative status from DB — never from JWT claim
const status = await getSkillStatus(req.params.id);
res.json({
...skill,
isVerified: status === 'verified',
isFeatured: status === 'featured',
rateLimitTier: status === 'verified' ? 'premium' : 'standard',
});
});
PRIVESC19-002 — Missing admin check on skill verification allows any user to mark skills verified
The skill verification endpoint PATCH /api/skills/:id/verify is intended for use only by registry administrators after completing a manual security review. The endpoint was added during rapid feature development and the requireRole('admin') middleware was noted as a TODO but never added before shipping. Any authenticated user can call the endpoint and mark any skill in the registry as verified, granting it the trust badge, priority placement, and reduced rate limits. Combined with PRIVESC19-003, an attacker can both verify and feature their own skill without admin involvement, gaining the highest-visibility placement in the registry with a fraudulent trust signal.
// PRIVESC19-002 — VULNERABLE
// Missing requireRole('admin') — any authenticated user marks any skill as verified.
router.patch('/skills/:id/verify', requireSession, async (req, res) => {
// TODO: add requireRole('admin') — shipped without it
await db.skills.updateStatus(req.params.id, 'verified');
res.json({ verified: true });
});
// PRIVESC19-002 — FIXED
// requireRole('admin'); require manual review record; audit log on every change.
router.patch('/skills/:id/verify',
requireSession,
requireRole('admin'), // admin only
async (req, res) => {
// Require that a manual review record exists and is in 'approved' state
const review = await db.skillReviews.findLatestBySkillId(req.params.id);
if (!review || review.status !== 'approved') {
return res.status(422).json({
error: 'No approved review found. Complete a manual review before verifying.'
});
}
await db.skills.updateStatus(req.params.id, 'verified');
// Audit log: who verified, when, which review record authorized it
await auditLog.write({
action: 'skill_verified',
skillId: req.params.id,
reviewId: review.id,
adminId: req.session.userId,
at: new Date().toISOString(),
});
// Invalidate server-side status cache
statusCache.delete(req.params.id);
res.json({ verified: true });
}
);
PRIVESC19-003 — Missing admin check on featured placement displaces paid slots
The featured placement endpoint POST /api/skills/:id/feature promotes a skill to the featured section of the registry homepage. Featured placement is a paid tier feature — organizations pay for featured slots as part of their registry subscription. Without a requireRole('admin') check and a billing verification step, any authenticated user can call the endpoint to feature their own skill, displacing a legitimately paying customer from the featured slots and degrading the marketplace integrity that paying customers rely on.
// PRIVESC19-003 — VULNERABLE
// Missing admin check — any user features their own skill, displacing paid placements.
router.post('/skills/:id/feature', requireSession, async (req, res) => {
// No admin check, no billing check, no ownership check
await db.skills.setFeatured(req.params.id, true);
res.json({ featured: true });
});
// PRIVESC19-003 — FIXED
// requireRole('admin'); billing check; check available featured slot count; audit log.
router.post('/skills/:id/feature',
requireSession,
requireRole('admin'),
async (req, res) => {
const skill = await db.skills.findById(req.params.id);
if (!skill) return res.status(404).json({ error: 'Skill not found' });
// Verify the skill's org has a paid featured-placement entitlement
const entitlement = await db.billingEntitlements.findFeaturedSlot(skill.orgId);
if (!entitlement || entitlement.slotsRemaining < 1) {
return res.status(402).json({
error: 'No featured placement slots available on this org\'s plan.'
});
}
await db.skills.setFeatured(req.params.id, true);
await db.billingEntitlements.decrementSlot(entitlement.id);
await auditLog.write({
action: 'skill_featured',
skillId: req.params.id,
orgId: skill.orgId,
adminId: req.session.userId,
at: new Date().toISOString(),
});
statusCache.delete(req.params.id);
res.json({ featured: true });
}
);
PRIVESC19-004 — Per-skill rate limit key bypass via multiple accounts
The per-skill API rate limit is keyed only on skillId to prevent a single skill from being called too frequently. An attacker who controls multiple accounts (or multiple orgs on a free plan) can distribute their calls across accounts: each account makes requests against the same skill, and since the rate limit key is skillId alone, each account’s calls are counted independently. The attacker effectively multiplies the rate limit by the number of accounts they control, while each individual account stays within the per-key limit. Additionally, some implementations read the remaining rate limit count from a client-supplied X-Rate-Limit-Remaining header, allowing a client to claim an unlimited remaining budget.
// PRIVESC19-004 — VULNERABLE
// Rate limit key is skillId only — multiple accounts bypass the per-skill limit.
// Also reads remaining count from client header — trivially bypassed.
const rateLimit = require('express-rate-limit');
const skillRateLimit = rateLimit({
windowMs: 60 * 60 * 1000,
max: 100,
keyGenerator: req => req.params.skillId, // VULNERABLE: orgId not included in key
});
router.get('/skills/:skillId/invoke',
requireSession,
skillRateLimit,
(req, res, next) => {
// VULNERABLE: trusting client-supplied remaining count
req.remainingCalls = parseInt(req.headers['x-rate-limit-remaining'] || '100');
next();
},
async (req, res) => {
if (req.remainingCalls <= 0) return res.status(429).json({ error: 'Rate limited' });
// ... invoke skill
}
);
// PRIVESC19-004 — FIXED
// Rate limit key = skillId + orgId — each org has its own limit per skill.
// Never trust client-supplied rate limit headers.
// Store counter server-side in Redis.
const redis = require('ioredis');
const redisClient = new redis(process.env.REDIS_URL);
async function checkSkillRateLimit(skillId, orgId) {
const key = `rate:skill:${skillId}:org:${orgId}`;
const count = await redisClient.incr(key);
if (count === 1) await redisClient.expire(key, 3600); // 1 hour window
return { allowed: count <= 100, remaining: Math.max(0, 100 - count), count };
}
router.get('/skills/:skillId/invoke', requireSession, async (req, res) => {
const { skillId } = req.params;
const orgId = req.session.orgId;
// Server-side rate limit check — ignore all client-supplied limit headers
const { allowed, remaining } = await checkSkillRateLimit(skillId, orgId);
res.set('X-Rate-Limit-Remaining', remaining); // set response header (not read from request)
if (!allowed) return res.status(429).json({ error: 'Rate limit exceeded for this skill' });
// ... invoke skill
});
Related advisories: For privilege escalation in admin console and system configuration endpoints, see SA-SKL-PRIVESC18. For CORS misconfigurations in team invitation and member onboarding endpoints (the access vector that often precedes privilege escalation), see SA-SKL-CORS35.
SkillAudit checks for PRIVESC19, CORS, SSRF, injection, and 50+ more vulnerability patterns — in 60 seconds, with a shareable grade badge.
Get early access