Privilege Escalation in MCP Skill Registry Skill Content Moderation and Policy Enforcement Management Endpoints
SA-SKL-PRIVESC72 documents four privilege escalation vulnerabilities across the content moderation and policy enforcement management surface of MCP skill registries. The findings span JWT claim-based moderation tier bypass, missing boundary self-assignment, global policy enforcement destruction, and cache bleed that retains revoked moderation exemptions past their revocation date.
contentModerationTier:'exempt_enterprise' claim without DB check; any publisher crafts a JWT with contentModerationTier:'exempt_enterprise' to bypass all content policy checks and publish otherwise-blocked contentPOST /api/registry/moderation/tier/assign missing boundary check; any standard publisher assigns exempt_enterprise moderation tier to themselves, bypassing the enterprise compliance review and human approval workflowPATCH /api/registry/moderation/policy missing ownership check; any authenticated user modifies global content moderation policy thresholds and enforcement windows, raising violation thresholds to effectively disable moderation for all publisherspublisherId without moderationPolicyVersionId; cache entries bleed across policy updates; revoked exempt_enterprise tiers retained until TTL, allowing publishers to continue bypassing moderation for up to the full cache TTL after revocationPRIVESC72-001 — JWT contentModerationTier claim bypasses content policy without DB check
The content moderation middleware reads the publisher's moderation tier directly from the JWT payload field contentModerationTier, without verifying the tier against the database. The JWT is signed by the registry (preventing forgery via signature), but the token was initially issued with whatever tier the publisher had at token-issue time. If the JWT was issued before a tier downgrade, or if the publisher is using a token that predates the enterprise compliance review being completed, the stale JWT claim grants the higher tier. More critically: if the JWT signing key has ever been exposed (via SSRF, container env exfiltration, or a compromised CI pipeline), an attacker can craft a fresh JWT with contentModerationTier: "exempt_enterprise" and publish content that would otherwise be blocked by safety policy checks, copyright filters, or malware detection.
// PRIVESC72-001 — VULNERABLE
function requireModeratedContent(req, res, next) {
const { contentModerationTier } = req.jwt; // read from JWT payload — no DB check
if (contentModerationTier === 'exempt_enterprise') {
// VULNERABLE: skip all content policy checks based on unverified JWT claim
req.skipContentModeration = true;
return next();
}
applyContentPolicyChecks(req, res, next);
}
router.post('/skills/:skillId/publish', requireSession, requireModeratedContent, async (req, res) => {
// If skipContentModeration is true, all safety checks bypass — attacker publishes anything
if (!req.skipContentModeration) {
await runContentPolicyChecks(req.body.content);
}
await db.skills.publish(req.params.skillId, req.body);
res.json({ published: true });
});
Moderation bypass enables publication of policy-violating content: exempt_enterprise skips copyright filters, malware content detection, prompt-injection pattern matching, and adult content filters. An attacker who obtains or crafts an exempt_enterprise JWT can publish malicious skills to the public registry — including skills with credential-stealing prompt injections — without triggering any moderation check.
// PRIVESC72-001 — FIXED
async function requireModeratedContent(req, res, next) {
// FIXED: always verify tier against DB — JWT claim is a hint only, not authoritative
const publisher = await db.publishers.findByPk(req.jwt.publisherId, {
attributes: ['id', 'contentModerationTier', 'moderationTierVerifiedAt'],
});
if (!publisher) return res.status(401).json({ error: 'Publisher not found' });
// FIXED: DB record is authoritative; JWT claim ignored for privilege decisions
if (publisher.contentModerationTier === 'exempt_enterprise') {
req.skipContentModeration = true;
}
next();
}
PRIVESC72-002 — Missing boundary check on moderation tier self-assignment
The moderation tier assignment endpoint allows a publisher to assign any tier to themselves. The endpoint checks that the publisher is assigning a tier to their own account (not someone else's), but does not enforce a tier boundary — specifically, it does not check that the target tier is not higher than the publisher's currently verified tier. A standard publisher on the standard tier sends POST /api/registry/moderation/tier/assign with {"tier": "exempt_enterprise"}. The endpoint assigns exempt_enterprise without triggering the enterprise compliance review, the legal terms acceptance workflow, or the manual human approval step that the UI enforces only via client-side gating.
// PRIVESC72-002 — VULNERABLE
router.post('/moderation/tier/assign', requireSession, async (req, res) => {
const { tier } = req.body;
// VULNERABLE: checks own account only — no upper-boundary enforcement on tier value
await db.publishers.update(
{ contentModerationTier: tier }, // attacker submits 'exempt_enterprise'
{ where: { id: req.session.publisherId } }
);
res.json({ tier });
});
// PRIVESC72-002 — FIXED
// Tiers ordered by privilege level
const TIER_ORDER = ['standard', 'verified', 'trusted_partner', 'exempt_enterprise'];
router.post('/moderation/tier/assign', requireSession, async (req, res) => {
const { tier } = req.body;
if (!TIER_ORDER.includes(tier)) {
return res.status(400).json({ error: 'Invalid moderation tier' });
}
const publisher = await db.publishers.findByPk(req.session.publisherId);
const currentRank = TIER_ORDER.indexOf(publisher.contentModerationTier);
const targetRank = TIER_ORDER.indexOf(tier);
// FIXED: publishers can only self-assign tiers at or below their current tier
// Upgrades require admin approval or the enterprise compliance review workflow
if (targetRank > currentRank) {
return res.status(403).json({
error: 'Tier upgrade requires admin approval — submit via /moderation/tier/request',
});
}
await publisher.update({ contentModerationTier: tier });
res.json({ tier });
});
PRIVESC72-003 — Missing ownership check on global moderation policy update
The PATCH /api/registry/moderation/policy endpoint updates the global content moderation policy — the shared configuration that sets violation score thresholds, enforcement windows, warning counts before automatic suspension, and which content categories are subject to automated review. The endpoint requires authentication but has no ownership or admin role check. Any authenticated publisher can raise the violation threshold to 9999 (effectively infinite), set the enforcement window to 0 (no enforcement), or disable enforcement for specific content categories. This change affects all publishers on the registry — not just the attacker's account — until an admin notices and reverts the policy.
// PRIVESC72-003 — VULNERABLE
router.patch('/moderation/policy', requireSession, async (req, res) => {
// VULNERABLE: no admin role check — any authenticated publisher modifies global policy
const policy = await db.moderationPolicies.findOne({ where: { isGlobal: true } });
await policy.update({
violationThreshold: req.body.violationThreshold, // attacker sets to 9999
enforcementWindowDays: req.body.enforcementWindowDays, // attacker sets to 0
disabledCategories: req.body.disabledCategories, // attacker disables all checks
});
res.json({ updated: true });
});
// PRIVESC72-003 — FIXED
router.patch('/moderation/policy', requireSession, requireRole('registry_admin'), async (req, res) => {
// FIXED: requireRole('registry_admin') — standard publishers cannot reach this endpoint
const policy = await db.moderationPolicies.findOne({ where: { isGlobal: true } });
// FIXED: allowlist-validate policy fields before update
const allowed = ['violationThreshold', 'enforcementWindowDays', 'warningCountBeforeSuspension'];
const updates = Object.fromEntries(
Object.entries(req.body).filter(([k]) => allowed.includes(k))
);
// FIXED: enforce minimum safety bounds
if (updates.violationThreshold !== undefined && updates.violationThreshold > 100) {
return res.status(400).json({ error: 'violationThreshold cannot exceed 100' });
}
await policy.update(updates);
await auditLog.record({ action: 'moderation_policy_update', by: req.session.userId, updates });
res.json({ updated: true });
});
PRIVESC72-004 — Moderation tier cache bleed retains revoked exempt_enterprise tiers
The moderation tier cache key is publisher:moderation_tier:${publisherId} with a 30-minute TTL. When the registry admin revokes a publisher's exempt_enterprise tier (following a compliance violation), the moderation middleware continues to serve the cached exempt_enterprise value for up to 30 minutes. The cache key does not include moderationPolicyVersionId, so a policy version bump — which is the standard revocation mechanism — does not invalidate the cached entry. During this window, the publisher continues to publish content without any moderation checks. The fix requires including the policy version in the cache key, or implementing a targeted cache invalidation on tier revocation.
// PRIVESC72-004 — VULNERABLE
async function getPublisherModerationTier(publisherId) {
// VULNERABLE: cache key excludes policy version — revocation does not invalidate
const cacheKey = `publisher:moderation_tier:${publisherId}`;
const cached = await redis.get(cacheKey);
if (cached) return cached; // stale exempt_enterprise served for up to 30 min post-revocation
const publisher = await db.publishers.findByPk(publisherId, {
attributes: ['contentModerationTier'],
});
await redis.setex(cacheKey, 1800, publisher.contentModerationTier);
return publisher.contentModerationTier;
}
// PRIVESC72-004 — FIXED
async function getPublisherModerationTier(publisherId) {
// FIXED: include current policy version in cache key — revocation bumps version → cache miss
const policyVersion = await getModerationPolicyVersion(); // cheap: policy version cached globally
const cacheKey = `publisher:moderation_tier:${publisherId}:v${policyVersion}`;
const cached = await redis.get(cacheKey);
if (cached) return cached;
const publisher = await db.publishers.findByPk(publisherId, {
attributes: ['contentModerationTier'],
});
// FIXED: shorter TTL for privileged tiers
const ttl = publisher.contentModerationTier === 'exempt_enterprise' ? 60 : 1800;
await redis.setex(cacheKey, ttl, publisher.contentModerationTier);
return publisher.contentModerationTier;
}
// Called on tier revocation — increments policy version, invalidating all tier caches
async function revokePublisherTier(publisherId, adminUserId) {
await db.publishers.update(
{ contentModerationTier: 'standard' },
{ where: { id: publisherId } }
);
await incrementModerationPolicyVersion(); // all cached tiers become stale immediately
await auditLog.record({ action: 'tier_revoked', publisherId, by: adminUserId });
}
Scan your MCP skill registry for SA-SKL-PRIVESC72
SkillAudit detects JWT claim-based privilege escalation, missing tier boundary checks, unguarded global policy mutation endpoints, and cache key design flaws that enable revocation bypass in under 60 seconds.
Run a free audit