← Blog

Claude MCP skill privilege escalation — skill content moderation and policy enforcement endpoints (SA-SKL-PRIVESC69)

SA-SKL-PRIVESC69 identifies four privilege escalation vulnerabilities in MCP skill registry skill content moderation and policy enforcement endpoints. PRIVESC69-001 exploits the content moderation pipeline's trust in a JWT moderationExempt claim without a database-side verification step — an attacker who crafts a JWT with moderationExempt:true bypasses all content policy checks, automated keyword flagging, manual review queues, and the submission rate limits that apply to non-exempt publishers, allowing unlimited skill publishing without any moderation oversight. PRIVESC69-002 exploits a missing boundary check on the POST /api/registry/moderation/exempt/assign endpoint — any standard publisher can assign moderation exemption to their own account, bypassing the trust score threshold and manual trust-and-safety review that exemption is gated behind. PRIVESC69-003 exploits a missing ownership check on the PATCH /api/registry/moderation/policy endpoint — any authenticated user can modify the platform's global content moderation policy rules, keyword blocklists, and automated flagging thresholds, affecting every skill submission on the platform. PRIVESC69-004 exploits a cache key construction that includes only publisherId without the moderationPolicyVersionId — when an admin revokes a publisher's moderation exemption, the cached exemption status continues to be used for all moderation decisions until the TTL expires.

SA-SKL-PRIVESC69 findings at a glance
CRITICALPRIVESC69-001 — moderation exemption status read from JWT moderationExempt claim — craft JWT with moderationExempt:true bypasses all content policy checks, automated flagging, manual review queues, and rate limits applied to non-exempt publishers
CRITICALPRIVESC69-002 — POST /api/registry/moderation/exempt/assign missing boundary check — any standard publisher assigns moderation exemption to themselves bypassing the trust score threshold and manual review that exemption requires
HIGHPRIVESC69-003 — PATCH /api/registry/moderation/policy missing ownership check — any authenticated user modifies global content moderation policy rules, keyword blocklists, and automated flagging thresholds affecting all skills on the platform
MEDIUMPRIVESC69-004 — moderation exemption cache key uses publisherId without moderationPolicyVersionId — cache entries bleed across policy updates; revoked moderation exemptions retained until TTL expiry

PRIVESC69-001 — JWT moderationExempt claim trusted without database verification

The content moderation pipeline reads the publisher's exemption status from the moderationExempt claim in the authenticated JWT rather than performing a database lookup by publisher ID. The JWT is signed by the registry's authentication service, but the claim is populated at login time from the publisher's exemption status at the moment of login — the moderation pipeline trusts this static snapshot for the entire JWT lifetime rather than performing a fresh database lookup for each skill submission. An attacker who obtains or creates a publisher account and either forges a JWT using a compromised signing key or exploits an algorithm confusion vulnerability in the JWT validation library can inject moderationExempt:true into their JWT. The moderation pipeline uses this claim to skip all content checks: exempt publishers bypass the keyword blocklist check that filters for prohibited content categories, bypass the automated flagging system that routes suspicious skills to the manual review queue, bypass the trust-and-safety manual review gate that all new publishers must pass before unrestricted publishing, and bypass the per-day skill submission rate limit that prevents abuse of the platform by high-volume automated publishing. Even without a signing key compromise, any publisher whose exemption was legitimately granted and then revoked retains their old JWT until it expires — typically 24 hours — continuing to publish without moderation oversight during that window.

The moderationExempt claim is especially dangerous to trust from a JWT because exemption status is a high-privilege, low-frequency permission change — it is set once during a trust-and-safety review process and rarely modified. This infrequency means that developers building the moderation pipeline are less likely to anticipate the time-of-check to time-of-use window between JWT issuance and claim evaluation, and are less likely to implement the database lookup that would detect a revocation that occurred after the JWT was issued. Storing exemption status in a JWT rather than a database also makes it invisible to the standard admin tooling used to audit publisher permissions — a publisher who exploits this vulnerability leaves no audit trail in the database privilege records.

Vulnerable
// PRIVESC69-001 — VULNERABLE: JWT moderationExempt claim trusted without DB check
const { verifyJWT } = require('../auth/jwt');

async function checkModerationRequired(publisherId, skillSubmission, token) {
  const claims = verifyJWT(token);
  // JWT claim used directly — no DB lookup to verify current exemption status
  // attacker crafts JWT with moderationExempt:true
  const isExempt = claims.moderationExempt === true;
  if (isExempt) {
    return { required: false, reason: 'publisher is moderation-exempt' };
  }
  return {
    required: true,
    checks: ['keyword_blocklist', 'automated_flagging', 'manual_review_queue'],
    rateLimit: { dailySubmissions: 5 }
  };
}

Moderation exemption allows unlimited skill publishing without content policy checks — an attacker who bypasses it can flood the registry with prohibited-content skills that reach users before any moderation action is taken, with zero rate limiting to slow the attack. DB-backed exemption status lookup by publisherId ensures the current exemption state is always authoritative; the JWT carries only the subject identifier; any exemption revocation takes effect immediately on the next skill submission without requiring a re-login or token invalidation.

Fixed
// PRIVESC69-001 — FIXED: DB-backed moderation exemption lookup; JWT carries only sub
const { verifyJWT } = require('../auth/jwt');
const { db } = require('../db');

async function checkModerationRequired(publisherId, skillSubmission, token) {
  const claims = verifyJWT(token);
  if (claims.sub !== publisherId) {
    throw new Error('Token subject does not match publisher ID');
  }
  // Always look up current exemption status from DB — never trust JWT claim
  const publisher = await db.getPublisher(publisherId);
  const isExempt = publisher.moderationExempt === true;
  if (isExempt) {
    return { required: false, reason: 'publisher is moderation-exempt' };
  }
  return {
    required: true,
    checks: ['keyword_blocklist', 'automated_flagging', 'manual_review_queue'],
    rateLimit: { dailySubmissions: 5 }
  };
}

CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N — Base Score 6.5 (HIGH); integrity impact because bypassing content moderation allows prohibited-content skills to be published to the registry and distributed to end users without any safety review.

PRIVESC69-002 — Moderation exemption assignment endpoint missing boundary check

The POST /api/registry/moderation/exempt/assign endpoint allows publishers to request a moderation exemption status assignment. The endpoint is intended to allow publishers to request the lower trusted_publisher status (a self-service upgrade available to publishers who have met an automated trust score threshold) while routing full moderation_exempt requests through a manual trust-and-safety review. However, the endpoint validates that the requesting publisher is assigning the status to their own account but does not validate that the requested exemption level is at or below the maximum self-service level. An attacker who is a standard publisher sends a request to assign moderationStatus:'moderation_exempt' to their own account. The endpoint processes this request, writes the new exemption status to the database, and all subsequent skill submissions from this publisher bypass the full content moderation pipeline — including keyword blocklists, automated flagging, manual review queues, and submission rate limits — without having completed the trust-and-safety review that the moderation_exempt status is designed to gate behind. Because moderation exemptions are designed for high-volume publishers who have demonstrated sustained compliance, this bypass allows an attacker to publish an unlimited number of skills per day without any content oversight.

The absence of a boundary check on the exemption level is a particularly common pattern in moderation systems where the same endpoint handles both self-service status upgrades and admin-granted exemptions. Developers building the endpoint often implement the self-assignment check — preventing Publisher A from granting exemption to Publisher B — but fail to implement the privilege boundary check that prevents Publisher A from granting themselves a higher exemption level than they are entitled to through self-service. The two checks look similar at code review time and the missing boundary check is easy to miss in a PR where the self-assignment check is present and superficially appears to cover the security requirement.

Vulnerable
// PRIVESC69-002 — VULNERABLE: POST /api/registry/moderation/exempt/assign missing boundary check
const express = require('express');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');

const router = express.Router();

router.post('/registry/moderation/exempt/assign',
  requireSession,
  async (req, res) => {
    const { publisherId, moderationStatus } = req.body;
    // Checks self-assignment — but no exemption level boundary check
    // attacker sends moderationStatus:'moderation_exempt' — no validation
    if (publisherId !== req.session.userId) {
      return res.status(403).json({ error: 'forbidden' });
    }
    await db.setPublisherModerationStatus(publisherId, moderationStatus);
    res.json({ publisherId, moderationStatus });
  }
);

module.exports = router;

The moderation_exempt status is gated behind a trust-and-safety review that exists specifically to prevent self-assignment — this boundary check must be enforced in the API endpoint itself, not only in the UI workflow that presents the multi-step review process. MODERATION_STATUS_ORDER provides an ordinal comparison that rejects self-assignment to any status above the maximum self-service level; moderation_exempt always creates a trust-and-safety review queue entry requiring admin approval; an audit log entry records every status assignment with the assignment method for forensic review.

Fixed
// PRIVESC69-002 — FIXED: MODERATION_STATUS_ORDER boundary; moderation_exempt requires admin; audit log
const express = require('express');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const { auditLog } = require('../audit');

const MODERATION_STATUS_ORDER = ['standard', 'trusted_publisher', 'moderation_exempt'];
const MAX_SELF_SERVICE_STATUS = 'trusted_publisher';

const router = express.Router();

router.post('/registry/moderation/exempt/assign',
  requireSession,
  async (req, res) => {
    const { publisherId, moderationStatus } = req.body;
    if (publisherId !== req.session.userId) {
      return res.status(403).json({ error: 'forbidden' });
    }
    const requestedOrdinal = MODERATION_STATUS_ORDER.indexOf(moderationStatus);
    const maxSelfServiceOrdinal = MODERATION_STATUS_ORDER.indexOf(MAX_SELF_SERVICE_STATUS);
    if (requestedOrdinal < 0) {
      return res.status(400).json({ error: 'invalid moderation status' });
    }
    if (requestedOrdinal > maxSelfServiceOrdinal) {
      await db.createModerationExemptReviewRequest(publisherId, moderationStatus);
      await auditLog.write({
        action: 'moderation.exempt.review_requested',
        publisherId,
        moderationStatus,
        at: new Date()
      });
      return res.json({
        status: 'review_requested',
        message: 'moderation_exempt status requires trust-and-safety review'
      });
    }
    await db.setPublisherModerationStatus(publisherId, moderationStatus);
    await auditLog.write({
      action: 'moderation.status.self_assigned',
      publisherId,
      moderationStatus,
      at: new Date()
    });
    res.json({ publisherId, moderationStatus });
  }
);

module.exports = router;

CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N — Base Score 6.5 (HIGH); integrity impact because self-assignment to moderation_exempt bypasses the trust-and-safety review that protects the registry's content integrity and user safety guarantees.

PRIVESC69-003 — Global content moderation policy endpoint missing ownership check

The PATCH /api/registry/moderation/policy endpoint allows modification of the platform's global content moderation policy configuration, including the keyword blocklist used for automated content screening, the sensitivity thresholds for the automated flagging classifiers, the categories of content that require mandatory manual review, and the submission rate limits applied to non-exempt publishers. The endpoint validates that the request is authenticated but does not check that the requesting user holds the moderation_admin role required to modify global policy configuration. Any authenticated publisher — including free-tier accounts — can send a PATCH request to this endpoint and modify the global moderation policy. An attacker can remove all keywords from the blocklist, set all automated flagging thresholds to their maximum values effectively disabling automated detection, remove mandatory review requirements for all content categories, or raise submission rate limits to allow unlimited publishing for all users — changes that affect every skill submission on the platform until an admin notices and reverts the configuration.

The unprotected global policy endpoint is a particularly high-impact vulnerability in the content moderation context because moderation policy determines what content is permissible on the platform and what content reaches end users. Unlike financial configuration changes that affect payout calculations, moderation policy changes have immediate safety consequences: disabling keyword blocklists and automated flagging classifiers means that prohibited content — including malicious skill packages that execute harmful code, skills that exfiltrate user data, or skills containing illegal content — can be submitted and immediately published to the registry without any safety review. Because Claude-based agents consume skills from MCP registries as part of their tool execution environment, a compromised moderation policy can allow malicious skills to reach agent deployments used in production systems.

Vulnerable
// PRIVESC69-003 — VULNERABLE: PATCH /api/registry/moderation/policy missing ownership check
const express = require('express');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');

const router = express.Router();

router.patch('/registry/moderation/policy',
  requireSession,
  async (req, res) => {
    // No role check — any authenticated user can modify global moderation policy
    await db.updateModerationPolicy(req.body);
    res.json({ updated: true });
  }
);

module.exports = router;

Global content moderation policy determines what content reaches every user of the registry — unauthorized modification can disable all safety checks simultaneously, allowing prohibited or malicious skills to be published and consumed by agent deployments without any review. The moderation_admin role gate restricts modifications to authorized trust-and-safety team members; Zod ModerationPolicyUpdateSchema with valid-value constraints prevents individual fields from being set to values outside operationally valid ranges; re-authentication before each policy change provides an additional barrier against session-hijack attacks; bumping the moderationPolicyVersion on every update invalidates the cache for all dependent exemption lookups.

Fixed
// PRIVESC69-003 — FIXED: moderation_admin role; Zod schema with bounds; reAuthRequired; bump version; audit log
const express = require('express');
const { z } = require('zod');
const { db } = require('../db');
const { requireSession, requireRole, reAuthRequired } = require('../middleware/auth');
const { auditLog } = require('../audit');

const ModerationPolicyUpdateSchema = z.object({
  keywordBlocklist: z.array(z.string().max(200)).max(10000).optional(),
  automatedFlaggingThreshold: z.number().min(0.5).max(1.0).optional(),
  mandatoryReviewCategories: z.array(z.string()).optional(),
  dailySubmissionRateLimit: z.number().int().min(1).max(100).optional()
});

const router = express.Router();

router.patch('/registry/moderation/policy',
  requireSession,
  requireRole('moderation_admin'),
  reAuthRequired,
  async (req, res) => {
    const update = ModerationPolicyUpdateSchema.parse(req.body);
    const newVersion = await db.updateModerationPolicy(update);
    await auditLog.write({
      action: 'moderation.policy.update',
      actorId: req.session.userId,
      update,
      newPolicyVersion: newVersion,
      at: new Date()
    });
    res.json({ updated: true, newPolicyVersion: newVersion });
  }
);

module.exports = router;

CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H — Base Score 8.1 (HIGH); integrity impact because global moderation policy modification allows prohibited content to bypass all safety checks and reach end users; availability impact because disabling flagging thresholds and rate limits allows unlimited spam publishing that degrades registry discoverability for legitimate users.

PRIVESC69-004 — Moderation exemption cache key missing policy version ID allows revoked exemption to persist

The content moderation pipeline caches the publisher's exemption status using a cache key composed solely of publisherId. When an admin revokes a publisher's moderation_exempt status — for example, after discovering that PRIVESC69-002 was exploited to self-assign the exemption — the revocation writes the new standard status to the database but does not invalidate the existing cache entry for that publisher. The cache TTL for moderation exemption status is typically set to thirty minutes to reduce database load during high-traffic skill submission windows. During this TTL window, every skill submission from the revoked publisher still reads the cached moderation_exempt status and skips the full content moderation pipeline — including keyword blocklist checks, automated flagging, and manual review queues — continuing to publish unmoderated content for up to thirty minutes after the admin completed the revocation. Because the cache is keyed only by publisher ID, there is no way to invalidate the specific publisher's cache entry without either flushing the entire moderation cache (which degrades performance for all publishers) or waiting for the TTL to expire.

The post-revocation persistence window is particularly damaging in the content moderation context because harmful content published during the window reaches users before it can be taken down. Unlike financial privilege escalation where the damage is bounded by transaction volume during the TTL window, moderation bypass during a thirty-minute window can allow a large number of prohibited-content skills to be published, indexed, and consumed by agent deployments before the revocation fully takes effect. The combination of PRIVESC69-002 (self-assignment bypass) and PRIVESC69-004 (revocation persistence) creates a compound attack where an attacker repeatedly self-assigns exemption, publishes prohibited content during the TTL window, and then allows the exemption to be revoked knowing they can re-exploit PRIVESC69-002 to restart the cycle.

Vulnerable
// PRIVESC69-004 — VULNERABLE: cache key uses publisherId without moderationPolicyVersionId
const { cache } = require('../cache');
const { db } = require('../db');

async function getPublisherModerationStatus(publisherId) {
  const cacheKey = `moderation-status:${publisherId}`;
  const cached = await cache.get(cacheKey);
  if (cached) return cached;
  const publisher = await db.getPublisher(publisherId);
  await cache.set(cacheKey, publisher.moderationStatus, { ttl: 1800 });
  return publisher.moderationStatus;
}

// Admin revokes moderation_exempt status — but cache still returns moderation_exempt
// for up to 30 minutes, allowing continued unmoderated publishing:
async function revokeModerationExemption(publisherId) {
  await db.setPublisherModerationStatus(publisherId, 'standard');
  // No cache invalidation — revoked exemption persists in cache for TTL duration
}

Moderation exemption revocation is a time-sensitive trust-and-safety action — a thirty-minute window where prohibited-content skills can be published without checks allows significant platform harm that scales with the publisher's submission rate. Including moderationPolicyVersionId in the cache key ensures that every policy update — including exemption revocations — produces cache misses for the affected publisher, forcing a fresh database lookup; the revokeModerationExemption() function increments the publisher's moderationPolicyVersion in the database, invalidating all cache entries for that publisher atomically with the revocation write.

Fixed
// PRIVESC69-004 — FIXED: cache key = moderationPolicyVersionId:publisherId; revoke increments version
const { cache } = require('../cache');
const { db } = require('../db');

async function getPublisherModerationStatus(publisherId) {
  // lightweight meta fetch: id + moderationPolicyVersion (no full publisher record needed)
  const meta = await db.getPublisherMeta(publisherId);
  const cacheKey = `moderation-status:${meta.moderationPolicyVersion}:${publisherId}`;
  const cached = await cache.get(cacheKey);
  if (cached) return cached;
  const status = await db.getPublisherModerationStatus(publisherId);
  await cache.set(cacheKey, status, { ttl: 1800 });
  return status;
}

async function revokeModerationExemption(publisherId) {
  await db.transaction(async tx => {
    await tx.setPublisherModerationStatus(publisherId, 'standard');
    await tx.incrementPublisherModerationPolicyVersion(publisherId);
    // Old cache key (old version) will never be read again
    // Next moderation check fetches 'standard' status directly from DB via cache miss
  });
}

CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N — Base Score 4.3 (MEDIUM); integrity impact because revoked moderation exemption continues to allow unmoderated skill publishing during the TTL window; severity is medium because exploitation requires a prior exemption escalation, making this a post-exploitation persistence mechanism rather than a standalone attack.

SkillAudit scans for privilege escalation patterns as part of its automated skill security audit. Get on the waitlist to audit your MCP skill registry.