← Blog

Claude MCP skill privilege escalation — skill publisher verification and trust level management endpoints (SA-SKL-PRIVESC61)

SA-SKL-PRIVESC61 identifies four privilege escalation vulnerabilities in MCP skill registry skill publisher verification and trust level management endpoints. The publisher trust level authorization gate reads from the JWT publisherTier claim rather than from the database, allowing any attacker who can forge or decode-and-re-sign a JWT to claim verified_partner status — granting access to the private skill catalog, a reduced manual review SLA from 14 days to 24 hours, and the ability to publish skills directly without passing through the standard manual review queue; the publisher tier assignment endpoint is missing a role boundary check, allowing any publisher to assign verified_partner status to themselves without undergoing the manual verification process; the publisher verification configuration endpoint is missing an ownership check, allowing any authenticated user to modify global publisher verification thresholds, review queue priority weights, and partner tier eligibility criteria that apply to the entire registry; and the publisher trust level cache key includes only the publisherId without a verificationPolicyVersionId component, causing cache entries from before a policy upgrade to bleed through and serve stale trust levels — including trust levels that were explicitly revoked as part of the policy change — until the cache TTL expires.

SA-SKL-PRIVESC61 findings at a glance
CRITICALPRIVESC61-001 — publisher trust level read from JWT publisherTier claim — craft JWT with publisherTier:'verified_partner' grants private catalog access, reduced review SLA, and direct-publish without manual review queue
CRITICALPRIVESC61-002 — POST /api/registry/publisher/verify/assign missing tier boundary check — any publisher assigns verified_partner tier to themselves bypassing manual review queue and gaining private catalog access
HIGHPRIVESC61-003 — PATCH /api/registry/publisher/verification/config missing ownership check — any authenticated user modifies global publisher verification thresholds, review queue priority weights, and partner tier eligibility criteria
MEDIUMPRIVESC61-004 — publisher trust level cache key uses publisherId without verificationPolicyVersionId — cache entries bleed across verification policy upgrades; revoked verified_partner tiers retained until TTL expiry

PRIVESC61-001 — JWT publisherTier claim forgery grants verified_partner access

The publisher trust level authorization check reads the publisher's tier directly from the JWT publisherTier claim rather than performing a database lookup. If the JWT signing secret is weak, known, or exposed in an environment variable that the attacker has obtained via a prior finding such as INJECTION68-003, the attacker can forge a JWT with publisherTier: 'verified_partner'. This grants access to the private skill catalog (skills only visible to verified partners), changes the manual review SLA for the publisher's skill submissions from 14 days to 24 hours, and enables the direct-publish flow that bypasses the standard manual review queue entirely. All three privileges are gated solely on the JWT claim — there is no server-side database check that cross-validates the claim against the publisher's actual verification status.

Vulnerable
// PRIVESC61-001 — VULNERABLE: publisher tier read from JWT claim — no DB check
function requirePublisherTier(minTier) {
  const TIER_ORDER = ['basic', 'verified', 'verified_partner', 'registry_admin'];
  return (req, res, next) => {
    // VULNERABLE: publisherTier comes from JWT payload — attacker can forge it
    const { publisherTier } = req.jwt.payload;
    if (TIER_ORDER.indexOf(publisherTier) < TIER_ORDER.indexOf(minTier)) {
      return res.status(403).json({ error: 'insufficient_publisher_tier' });
    }
    req.publisherTier = publisherTier;
    next();
  };
}
Fixed
// PRIVESC61-001 — FIXED: DB-backed tier lookup by userId; JWT carries only sub
async function requirePublisherTier(minTier) {
  const TIER_ORDER = ['basic', 'verified', 'verified_partner', 'registry_admin'];
  return async (req, res, next) => {
    // JWT carries only sub (userId) — tier is always fetched from DB
    const publisherId = req.jwt.payload.sub;
    const record = await db.query(
      'SELECT publisher_tier FROM publishers WHERE id=$1 AND deleted_at IS NULL',
      [publisherId]
    );
    if (!record.rows[0]) return res.status(403).json({ error: 'publisher_not_found' });
    const { publisher_tier } = record.rows[0];
    if (TIER_ORDER.indexOf(publisher_tier) < TIER_ORDER.indexOf(minTier)) {
      return res.status(403).json({ error: 'insufficient_publisher_tier' });
    }
    req.publisherTier = publisher_tier;
    next();
  };
}

PRIVESC61-002 — Missing tier boundary check allows self-assignment to verified_partner

The publisher tier assignment endpoint allows a publisher to request a tier upgrade by submitting a tier name and optionally providing verification evidence (domain ownership proof, identity document, etc.). The endpoint validates that the publisher is authenticated but does not enforce a tier boundary check: it allows the requesting publisher to assign any tier, including verified_partner, to their own account without the target tier exceeding their current tier. An attacker who is a basic-tier publisher can call this endpoint and directly assign themselves verified_partner status, completely bypassing the manual verification process.

Vulnerable
// PRIVESC61-002 — VULNERABLE: no tier boundary check — any publisher can assign any tier
router.post('/registry/publisher/verify/assign',
  requireSession,
  async (req, res) => {
    const { targetTier, evidenceUrl } = req.body;
    const publisherId = req.session.publisherId;

    // VULNERABLE: no check that targetTier <= currentTier + 1
    // any publisher can assign themselves 'verified_partner' directly
    await db.query(
      'UPDATE publishers SET publisher_tier=$1, verification_evidence=$2, verified_at=NOW() WHERE id=$3',
      [targetTier, evidenceUrl, publisherId]
    );
    res.json({ tier: targetTier });
  }
);
Fixed
// PRIVESC61-002 — FIXED: PUBLISHER_TIER_ORDER ordinal comparison; prevent self-assignment above current+1; audit log
const PUBLISHER_TIER_ORDER = ['basic', 'verified', 'verified_partner', 'registry_admin'];

router.post('/registry/publisher/verify/assign',
  requireSession,
  async (req, res) => {
    const { targetTier, evidenceUrl } = req.body;
    const publisherId = req.session.publisherId;

    const current = await db.query(
      'SELECT publisher_tier FROM publishers WHERE id=$1',
      [publisherId]
    );
    const currentTier = current.rows[0]?.publisher_tier ?? 'basic';
    const currentOrdinal = PUBLISHER_TIER_ORDER.indexOf(currentTier);
    const targetOrdinal = PUBLISHER_TIER_ORDER.indexOf(targetTier);

    if (targetOrdinal < 0) return res.status(400).json({ error: 'unknown_tier' });
    // Publishers may only REQUEST one tier above their current level (requires manual approval above that)
    if (targetOrdinal > currentOrdinal + 1) {
      return res.status(403).json({ error: 'tier_jump_too_large', max: PUBLISHER_TIER_ORDER[currentOrdinal + 1] });
    }
    // verified_partner and above always require admin approval — place in queue instead
    if (targetOrdinal >= PUBLISHER_TIER_ORDER.indexOf('verified_partner')) {
      await verificationQueue.enqueue({ publisherId, targetTier, evidenceUrl });
      await auditLog.record({ action: 'tier_upgrade_requested', publisherId, targetTier });
      return res.json({ status: 'pending_review', expectedSla: '14_days' });
    }

    await db.query(
      'UPDATE publishers SET publisher_tier=$1, verification_evidence=$2, verified_at=NOW() WHERE id=$3',
      [targetTier, evidenceUrl, publisherId]
    );
    await auditLog.record({ action: 'tier_upgrade_applied', publisherId, fromTier: currentTier, toTier: targetTier });
    res.json({ tier: targetTier });
  }
);

PRIVESC61-003 — Global publisher verification config writable by any authenticated user

The publisher verification configuration endpoint accepts PATCH requests to update global configuration fields: the minimum verification score threshold required for automatic verified tier approval, the review queue priority weights for different publisher categories, and the eligibility criteria for the verified_partner tier. These fields affect every publisher and every skill submission across the entire registry. The endpoint requires authentication but does not check whether the authenticated user has administrative authority over the global verification configuration. Any publisher — including one who registered an account minutes ago — can call this endpoint and lower the minimum verification score threshold to zero, granting all publishers automatic verified tier approval without any review.

Vulnerable
// PRIVESC61-003 — VULNERABLE: no ownership check on global verification config
router.patch('/registry/publisher/verification/config',
  requireSession,
  async (req, res) => {
    // VULNERABLE: any authenticated user can modify global config
    const updates = req.body;
    await db.query(
      'UPDATE publisher_verification_config SET config=$1, updated_at=NOW() WHERE id=1',
      [JSON.stringify(updates)]
    );
    res.json({ updated: true });
  }
);
Fixed
// PRIVESC61-003 — FIXED: require registry_admin tier; Zod schema with min/max bounds; bump policy version; audit log
const { z } = require('zod');
const VerificationConfigUpdateSchema = z.object({
  minVerificationScore: z.number().int().min(0).max(100).optional(),
  queuePriorityWeights: z.record(z.string(), z.number().min(0).max(10)).optional(),
  partnerEligibilityMinInstalls: z.number().int().min(100).optional(),
}).strict();

router.patch('/registry/publisher/verification/config',
  requireSession,
  requirePublisherTier('registry_admin'),  // only registry admins may change global config
  async (req, res) => {
    const updates = VerificationConfigUpdateSchema.parse(req.body);

    const result = await db.query(
      `UPDATE publisher_verification_config
       SET config = config || $1::jsonb, policy_version = policy_version + 1, updated_at=NOW()
       WHERE id=1 RETURNING policy_version`,
      [JSON.stringify(updates)]
    );
    const { policy_version } = result.rows[0];

    await auditLog.record({
      action: 'verification_config_updated', actorId: req.session.userId,
      updates, newPolicyVersion: policy_version
    });
    res.json({ updated: true, newPolicyVersion: policy_version });
  }
);

PRIVESC61-004 — Publisher trust level cache bleed across policy upgrades retains revoked tiers

The publisher trust level lookup caches the result under the key publisher:tier:{publisherId}. When the registry administrator upgrades the verification policy — for example, introducing stricter requirements that cause some existing verified_partner publishers to no longer meet the new criteria — the policy version increments but the cache entries for affected publishers are not invalidated. The old verified_partner cache entries continue to be served for up to the TTL (typically 15 minutes) after the policy change, meaning revoked publishers retain their elevated access for the duration of the TTL bleed window.

Vulnerable
// PRIVESC61-004 — VULNERABLE: cache key uses publisherId only — bleeds across policy upgrades
async function getPublisherTier(publisherId) {
  const cacheKey = `publisher:tier:${publisherId}`;  // no policy version in key
  const cached = await redis.get(cacheKey);
  if (cached) return cached;  // stale tier returned after policy upgrade revokes it
  const row = await db.query('SELECT publisher_tier FROM publishers WHERE id=$1', [publisherId]);
  const tier = row.rows[0]?.publisher_tier ?? 'basic';
  await redis.set(cacheKey, tier, 'EX', 900);  // 15-min TTL — revoked tiers bleed for up to 15 min
  return tier;
}
Fixed
// PRIVESC61-004 — FIXED: cache key = policyVersionId:publisherId; revokePublisherTier() bumps version invalidating all entries
async function getPublisherTier(publisherId) {
  const policyVersion = await getPolicyVersion();  // cached separately; cheap
  const cacheKey = `publisher:tier:${policyVersion}:${publisherId}`;
  const cached = await redis.get(cacheKey);
  if (cached) return cached;
  const row = await db.query('SELECT publisher_tier FROM publishers WHERE id=$1', [publisherId]);
  const tier = row.rows[0]?.publisher_tier ?? 'basic';
  await redis.set(cacheKey, tier, 'EX', 900);
  return tier;
}

async function revokePublisherTier(publisherId, reason) {
  await db.query(
    'UPDATE publishers SET publisher_tier=\'basic\', revoked_at=NOW(), revocation_reason=$2 WHERE id=$1',
    [publisherId, reason]
  );
  // Bump policy version — all policyVersion:publisherId cache keys are now stale
  await db.query('UPDATE publisher_verification_config SET policy_version=policy_version+1 WHERE id=1');
  // No need to enumerate and delete individual cache entries — new version key suffix makes them unreachable
  await auditLog.record({ action: 'publisher_tier_revoked', publisherId, reason });
}

SkillAudit detects all SA-SKL-PRIVESC61 patterns — JWT claim-based authorization without DB cross-validation, missing role boundary checks in assignment endpoints, missing ownership checks on global config mutations, and cache key design that omits policy versioning — via static analysis and data-flow review. Run a free audit on your MCP skill or Claude plugin.