← Blog

Claude MCP skill privilege escalation — marketplace curation and featured listing management endpoints (SA-SKL-PRIVESC60)

SA-SKL-PRIVESC60 identifies four privilege escalation vulnerabilities in MCP skill registry marketplace curation and featured listing management endpoints. The marketplace curation authorization layer reads the user's curator role directly from the curatorRole claim in the JWT access token without validating the claim against the database, allowing an attacker to forge a JWT with curatorRole:'marketplace_admin' and obtain full featured listing management permissions — including placing any skill in a homepage featured slot, assigning sponsored listing positions, and overriding the algorithmic curation ranking weights — without any database-side authorization check; the featured listing assignment endpoint is missing a role boundary check that prevents publishers from assigning curator roles above their current tier, allowing any verified publisher to invoke the assignment endpoint with their own userId as the target and grant themselves marketplace_admin authority by supplying the target role name in the request body; the global marketplace configuration endpoint is missing an ownership and authorization check entirely, allowing any authenticated user to submit PATCH requests that modify the global curation scoring weights, featured slot pricing, and sponsored content policy parameters that govern the entire marketplace ranking and monetization system; and the marketplace curation role cache uses a cache key that includes only the userId without incorporating the curationPolicyVersionId, causing stale cache entries to bleed across curation policy upgrades and retaining revoked marketplace_admin roles in the cache until the per-user TTL naturally expires.

SA-SKL-PRIVESC60 findings at a glance
CRITICALPRIVESC60-001 — marketplace curation role read from JWT curatorRole claim — craft JWT with curatorRole:'marketplace_admin' grants featured listing management, homepage placement control, and sponsored slot assignment
CRITICALPRIVESC60-002 — POST /api/registry/marketplace/featured/assign missing role boundary check — any verified publisher assigns marketplace_admin role to themselves granting featured listing and homepage placement control
HIGHPRIVESC60-003 — PATCH /api/registry/marketplace/config missing ownership check — any authenticated user modifies global marketplace curation weights, featured slot pricing, and sponsored content policies
MEDIUMPRIVESC60-004 — marketplace curation role cache key uses userId without curationPolicyVersionId — cache entries bleed across curation policy upgrades; revoked marketplace_admin roles retained until TTL expiry

PRIVESC60-001 — JWT curatorRole claim forgery grants marketplace_admin without database validation

The marketplace curation authorization middleware reads the user's curator role from the curatorRole claim embedded in the JWT access token. The JWT is verified for signature authenticity, but the middleware trusts the curatorRole claim value directly without performing a secondary lookup against the database to confirm that the claimed role matches the role actually assigned to the user. This design assumes that the JWT issuance process is the sole control point for curator role assignment and that the JWT signing key is not compromised; however, it means that any attacker who obtains a valid signing key — through a credential leak, an insider, or through another vulnerability in the token issuance pipeline — can craft a token asserting any curator role for any user.

An attacker who obtains or generates a valid JWT for their account crafts a modified token with the curatorRole claim set to marketplace_admin and signs it with the registry's JWT signing key. The forged token passes signature verification, and the marketplace curation middleware grants marketplace_admin access, allowing the attacker to place any skill in a homepage featured slot by crafting the appropriate skill identifiers, assign sponsored listing positions to skills they control — generating revenue from the sponsored slot billing — override the algorithmic curation ranking weights to demote competitor skills and promote their own, and assign curator roles to other accounts. Because the authorization check never touches the database, the escalation is completely invisible in the application-level audit log unless the registry separately logs JWT claim contents.

Vulnerable
// PRIVESC60-001 — VULNERABLE
function requireCuratorRole(minRole) {
  return (req, res, next) => {
    // VULNERABLE: reads curatorRole from JWT claim — never validates against database
    const { curatorRole } = req.user; // populated from JWT payload
    if (!CURATOR_ROLE_ORDER[curatorRole] || CURATOR_ROLE_ORDER[curatorRole] < CURATOR_ROLE_ORDER[minRole]) {
      return res.status(403).json({ error: 'Insufficient curator role' });
    }
    next();
  };
}

router.post(
  '/api/registry/marketplace/featured/place',
  requireSession,
  requireCuratorRole('marketplace_admin'), // VULNERABLE: attacker crafts JWT with this role
  async (req, res) => {
    const { skillId, slotId } = req.body;
    await marketplaceService.placeInFeaturedSlot(skillId, slotId);
    res.json({ placed: true, skillId, slotId });
  }
);

Attack PoC — PRIVESC60-001: Attacker crafts JWT with curatorRole:'marketplace_admin'. Middleware trusts the claim without DB validation — attacker gains full featured listing management, homepage placement control, sponsored slot assignment, and curator role delegation authority with no database-side audit trail.

// PRIVESC60-001 — ATTACK PAYLOAD
// Craft JWT with elevated curatorRole claim
const jwt = require('jsonwebtoken');
const forgedToken = jwt.sign(
  {
    sub: 'attacker-user-id',
    email: 'attacker@example.com',
    curatorRole: 'marketplace_admin', // forge elevated curator role
  },
  process.env.JWT_SECRET, // obtained from leaked credentials or other vuln
  { expiresIn: '8h' }
);
Fixed
// PRIVESC60-001 — FIXED
async function requireCuratorRole(minRole) {
  return async (req, res, next) => {
    // FIXED: DB-backed curator role lookup; JWT carries only sub
    const { curatorRole, curationPolicyVersionId } =
      await curatorRoleDb.getRole(req.user.sub);
    if (!CURATOR_ROLE_ORDER[curatorRole] || CURATOR_ROLE_ORDER[curatorRole] < CURATOR_ROLE_ORDER[minRole]) {
      return res.status(403).json({ error: 'Insufficient curator role' });
    }
    req.curatorRole = curatorRole;
    req.curationPolicyVersionId = curationPolicyVersionId;
    next();
  };
}

router.post(
  '/api/registry/marketplace/featured/place',
  requireSession,
  requireCuratorRole('marketplace_admin'),
  async (req, res) => {
    const { skillId, slotId } = req.body;
    await marketplaceService.placeInFeaturedSlot(skillId, slotId);
    await auditLog.write({
      action: 'featured_slot_placement',
      skillId,
      slotId,
      requestedBy: req.user.sub,
      curatorRole: req.curatorRole,
      timestamp: new Date().toISOString(),
    });
    res.json({ placed: true, skillId, slotId });
  }
);

PRIVESC60-002 — Missing role boundary check on featured listing assignment allows publisher self-promotion

The POST /api/registry/marketplace/featured/assign endpoint allows marketplace curators to assign the marketplace_curator or marketplace_admin role to other users, granting them access to featured listing management and sponsored slot assignment capabilities. The endpoint accepts a targetUserId and a targetRole in the request body and writes the new role assignment to the curator role database. The endpoint requires that the caller is an authenticated verified publisher, but does not check whether the caller's current curator role tier is strictly higher than the target role being assigned — meaning any verified publisher can supply any role name in the targetRole field, including marketplace_admin, without being rejected.

An attacker who is a verified publisher — a low-access tier obtained simply by publishing any skill to the registry — submits a POST request to the assignment endpoint with their own userId as targetUserId and marketplace_admin as targetRole. Because there is no role boundary check, the assignment succeeds and writes marketplace_admin to the curator role database for the attacker's account. The attacker now has full featured listing management authority — placing their own skills in homepage featured slots, demoting competitor skills in the algorithmic ranking, assigning sponsored listing revenue-generating slots to accounts they control, and granting marketplace_admin to other accounts to build an extended network of marketplace-controlling accounts. The revenue impact is direct: sponsored slots are billed to the registry's customers, so an attacker assigning sponsored slots to their own skills redirects paid promotional placement revenue to themselves.

Vulnerable
// PRIVESC60-002 — VULNERABLE
router.post(
  '/api/registry/marketplace/featured/assign',
  requireSession,
  requireVerifiedPublisher, // only checks publisher verification — not current curator tier
  async (req, res) => {
    const { targetUserId, targetRole } = req.body;
    // VULNERABLE: no role boundary check — any publisher can assign marketplace_admin
    await curatorRoleDb.assign({ userId: targetUserId, role: targetRole });
    res.json({ assigned: true, targetUserId, targetRole });
  }
);

Attack PoC — PRIVESC60-002: Verified publisher submits POST with targetUserId set to their own user ID and targetRole:'marketplace_admin'. No role boundary check — assignment succeeds. Attacker gains full featured listing management, homepage placement control, and sponsored slot revenue assignment authority.

// PRIVESC60-002 — ATTACK PAYLOAD
await fetch('/api/registry/marketplace/featured/assign', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  credentials: 'include',
  body: JSON.stringify({
    targetUserId: 'attacker-own-user-id', // self-assignment
    targetRole: 'marketplace_admin',      // escalate to highest curator tier
  }),
});
Fixed
// PRIVESC60-002 — FIXED
const CURATOR_ROLE_ORDER = { publisher: 0, marketplace_curator: 1, marketplace_admin: 2 };

router.post(
  '/api/registry/marketplace/featured/assign',
  requireSession,
  requireVerifiedPublisher,
  async (req, res) => {
    const { targetUserId, targetRole } = req.body;
    // FIXED: validate targetRole is a known curator role
    if (!Object.prototype.hasOwnProperty.call(CURATOR_ROLE_ORDER, targetRole)) {
      return res.status(400).json({ error: 'Unknown curator role' });
    }
    // FIXED: role boundary — caller must hold a strictly higher role than target
    const { curatorRole: callerRole } = await curatorRoleDb.getRole(req.user.sub);
    if (CURATOR_ROLE_ORDER[callerRole] <= CURATOR_ROLE_ORDER[targetRole]) {
      return res.status(403).json({ error: 'Cannot assign a role equal to or higher than your own' });
    }
    // FIXED: prevent self-assignment
    if (targetUserId === req.user.sub) {
      return res.status(403).json({ error: 'Cannot assign curator role to yourself' });
    }
    await curatorRoleDb.assign({ userId: targetUserId, role: targetRole, assignedBy: req.user.sub });
    await auditLog.write({ action: 'curator_role_assigned', targetUserId, targetRole, assignedBy: req.user.sub });
    res.json({ assigned: true, targetUserId, targetRole });
  }
);

PRIVESC60-003 — Missing ownership check on global marketplace config allows curation weight override

The PATCH /api/registry/marketplace/config endpoint allows marketplace administrators to update the global configuration that governs how the marketplace ranks and displays skills, including the algorithmic curation scoring weights that determine which skills appear prominently in category listings, the per-slot pricing for featured and sponsored listing positions, the maximum number of sponsored slots visible on the homepage and category pages, and the content policy thresholds that determine which skills are eligible for featured promotion. These configuration values are global — they affect the ranking and display of every skill in the marketplace — and changes to them are immediately reflected in the live marketplace without any review or approval workflow.

The endpoint validates that the caller has an active session but does not check that the caller holds the marketplace_admin curator role before accepting and applying the configuration changes. Any authenticated user — including free-tier users with no published skills — can submit PATCH requests to this endpoint and modify the global curation scoring weights. An attacker can set the curation weight for the security_audit_score dimension to zero, eliminating security quality as a ranking factor and causing unaudited or low-quality skills to rank equally with highly-audited skills. They can reduce featured slot pricing to zero, allowing any publisher to obtain featured placement without payment. They can increase the sponsored slot count on the homepage to an arbitrarily large number, flooding the marketplace with sponsored content. And they can lower content policy thresholds to enable skills that would otherwise be blocked by quality gates to appear in featured positions.

Vulnerable
// PRIVESC60-003 — VULNERABLE
router.patch(
  '/api/registry/marketplace/config',
  requireSession, // VULNERABLE: only checks session — no curator role check
  async (req, res) => {
    const updates = req.body;
    // VULNERABLE: any authenticated user overwrites global curation config
    await marketplaceConfigDb.update(updates);
    res.json({ updated: true, timestamp: new Date().toISOString() });
  }
);

Attack PoC — PRIVESC60-003: Any authenticated user PATCHes the global marketplace config — setting security_audit_score weight to zero (eliminating security from ranking), reducing featured slot pricing to $0, and maxing out homepage sponsored slot count. Affects every skill's ranking and all sponsored listing revenue globally with no approval workflow.

// PRIVESC60-003 — ATTACK PAYLOAD
await fetch('/api/registry/marketplace/config', {
  method: 'PATCH',
  headers: { 'Content-Type': 'application/json' },
  credentials: 'include',
  body: JSON.stringify({
    curationWeights: { security_audit_score: 0, install_count: 1 }, // remove security from ranking
    featuredSlotPricingUsd: 0,       // free featured placement
    homepageSponsoredSlotCount: 999, // flood homepage with sponsored content
  }),
});
Fixed
// PRIVESC60-003 — FIXED
const MarketplaceConfigUpdateSchema = z.object({
  curationWeights: z.record(z.string(), z.number().min(0).max(1)).optional(),
  featuredSlotPricingUsd: z.number().min(1).max(10000).optional(),
  homepageSponsoredSlotCount: z.number().int().min(1).max(10).optional(),
  contentPolicyMinQualityScore: z.number().min(0.5).max(1).optional(),
}).strict();

router.patch(
  '/api/registry/marketplace/config',
  requireSession,
  requireCuratorRole('marketplace_admin'), // FIXED: require marketplace_admin role
  reAuthRequired({ maxAgeSeconds: 300 }),  // FIXED: require recent re-authentication
  async (req, res) => {
    const updates = MarketplaceConfigUpdateSchema.parse(req.body);
    const before = await marketplaceConfigDb.getCurrent();
    await marketplaceConfigDb.update(updates);
    await marketplaceConfigDb.bumpPolicyVersion();
    await auditLog.write({
      action: 'marketplace_config_updated',
      before,
      after: updates,
      updatedBy: req.user.sub,
      timestamp: new Date().toISOString(),
    });
    res.json({ updated: true, timestamp: new Date().toISOString() });
  }
);

PRIVESC60-004 — Curator role cache key missing policy version bleeds revoked marketplace_admin roles

The marketplace curation authorization middleware caches curator role lookups in an in-process LRU cache using the userId as the sole cache key, with a TTL of 15 minutes. When a curation policy upgrade occurs — for example, when the registry revokes marketplace_admin roles from a set of publishers following a policy violation — the policy enforcement system writes the new role assignments to the curator role database and increments the global curationPolicyVersionId. However, because the authorization cache key does not incorporate the curationPolicyVersionId, the stale cache entries for affected users continue to serve the pre-revocation marketplace_admin role for the remaining duration of their 15-minute TTL windows, even though the database now records the lower role for those users.

An attacker whose marketplace_admin role is revoked as part of a policy enforcement action can continue exercising full marketplace_admin privileges for up to 15 minutes after the revocation, during which time they can place competitor skills in unfeatured positions, assign sponsored slot billing to victim accounts, and modify curation weights — all actions that are immediately visible to marketplace users. For high-value attacks such as mass skill demotion or featured slot reassignment, 15 minutes of continued access after a detected policy violation is sufficient to cause significant marketplace disruption before the cache naturally expires. If the attacker has obtained marketplace_admin access through PRIVESC60-001 or PRIVESC60-002, the same cache bleed applies: even after the registry detects and revokes the escalated role, the attacker retains effective marketplace_admin access for up to one full TTL cycle.

Vulnerable
// PRIVESC60-004 — VULNERABLE
const curatorRoleCache = new LRUCache({ max: 10000, ttl: 15 * 60 * 1000 });

async function getCuratorRole(userId) {
  // VULNERABLE: cache key is userId only — ignores curationPolicyVersionId
  const cached = curatorRoleCache.get(userId);
  if (cached) return cached; // VULNERABLE: returns stale role after policy upgrade/revocation
  const role = await curatorRoleDb.getRole(userId);
  curatorRoleCache.set(userId, role);
  return role;
}

Attack PoC — PRIVESC60-004: Attacker with revoked marketplace_admin role continues exercising full marketplace admin privileges for up to 15 minutes after revocation. Stale cache entry serves pre-revocation role regardless of database state — insufficient to prevent damage during post-compromise incident response window.

// PRIVESC60-004 — DEMONSTRATED IMPACT
// Admin revokes marketplace_admin for attacker's account at T+0
await curatorRoleDb.assign({ userId: attackerUserId, role: 'publisher', revokedBy: 'admin' });
await db.bumpCurationPolicyVersion(); // increments curationPolicyVersionId

// Attacker's requests at T+1m, T+5m, T+14m still authorize as marketplace_admin
// because cache key is userId only — policy version bump is invisible to cache
const { curatorRole } = curatorRoleCache.get(attackerUserId); // still 'marketplace_admin'
Fixed
// PRIVESC60-004 — FIXED
async function getCuratorRole(userId) {
  // FIXED: include curationPolicyVersionId in cache key
  const policyVersion = await db.getCurationPolicyVersion();
  const cacheKey = `${policyVersion}:${userId}`;
  const cached = curatorRoleCache.get(cacheKey);
  if (cached) return cached;
  const role = await curatorRoleDb.getRole(userId);
  curatorRoleCache.set(cacheKey, role);
  return role;
}

// FIXED: revocation path bumps policy version → invalidates all userId entries atomically
async function revokeCuratorRole(userId, newRole, revokedBy) {
  await curatorRoleDb.assign({ userId, role: newRole, revokedBy });
  await db.bumpCurationPolicyVersion(); // all cached role entries for all users invalidated
  await auditLog.write({
    action: 'curator_role_revoked',
    targetUserId: userId,
    newRole,
    revokedBy,
    timestamp: new Date().toISOString(),
  });
}

SkillAudit tip: Run a free audit on your MCP skill at skillaudit.dev to detect privilege escalation patterns in marketplace curation and featured listing endpoints — JWT claim trust without DB validation, missing role boundary checks on assignment endpoints, absent ownership checks on global config mutations, and cache key versioning gaps that allow revoked roles to bleed across policy upgrades — in under 60 seconds.