← Blog

Claude MCP skill privilege escalation — skill rate limiting and quota management endpoints (SA-SKL-PRIVESC70)

SA-SKL-PRIVESC70 identifies four privilege escalation vulnerabilities in MCP skill registry skill rate limiting and quota management endpoints. The rate limit enforcement middleware reads the publisher's tier directly from the JWT rateLimitTier claim without a database-side verification, allowing any publisher to craft a JWT with rateLimitTier:'enterprise_unlimited' and bypass all per-publisher request quotas and throttling windows without any approved enterprise agreement. The rate limit tier assignment endpoint is missing a tier boundary check, allowing any standard publisher account to assign the enterprise_unlimited tier to themselves through a direct API call, bypassing the revenue threshold and enterprise agreement requirements that the tier is supposed to enforce. The global rate limit configuration endpoint is missing an ownership check, allowing any authenticated publisher to modify the platform-wide rate limit thresholds, burst limits, and throttling windows that govern all publishers' API quotas simultaneously. And the rate limit tier cache key uses only the publisher ID without including the rate limit policy version identifier, causing cache entries to bleed across policy updates and retain revoked enterprise_unlimited tiers until the cache TTL expires naturally.

SA-SKL-PRIVESC70 findings at a glance
CRITICALPRIVESC70-001 — rate limit tier read from JWT rateLimitTier:'enterprise_unlimited' claim — craft JWT with rateLimitTier:'enterprise_unlimited' grants unlimited API calls without DB check bypassing per-publisher request quotas and throttling
CRITICALPRIVESC70-002 — POST /api/registry/rate-limit/tier/assign missing boundary check — any standard publisher assigns enterprise_unlimited rate limit tier to themselves bypassing the enterprise agreement requirement
HIGHPRIVESC70-003 — PATCH /api/registry/rate-limit/config missing ownership check — any authenticated user modifies global rate limit thresholds, burst limits, and throttling windows affecting all publishers on the platform
MEDIUMPRIVESC70-004 — rate limit tier cache key uses publisherId without rateLimitPolicyVersionId — cache entries bleed across policy updates; revoked enterprise_unlimited tiers retained until TTL expiry

PRIVESC70-001 — JWT rateLimitTier claim bypasses all API quotas without database verification

The rate limit enforcement middleware reads the publisher's rate limit tier from the JWT payload's rateLimitTier claim, using the claim value directly to look up the tier's quota parameters — requests per minute, burst limit, and throttling window — from an in-memory tier configuration table. The middleware does not perform a database-side lookup to verify that the publisher has an active record associating them with the claimed tier. When the JWT signature is valid and the token is not expired, the middleware trusts the rateLimitTier claim unconditionally. Any publisher who can generate a valid JWT — either by holding a valid signing key or by exploiting a JWT algorithm confusion vulnerability such as RS256-to-HS256 downgrade — can include rateLimitTier:'enterprise_unlimited' in the payload and receive unlimited API quota for the duration of the token's validity period without paying for or signing an enterprise agreement.

The enterprise_unlimited tier is specifically designed for high-volume registry integrations that require guaranteed API throughput for production CI/CD pipelines and enterprise skill deployment workflows. Granting this tier to unauthorized publishers creates two distinct harms. First, it allows the attacker to consume registry API capacity far beyond what their standard tier permits, degrading throughput available to legitimate publishers during high-traffic periods and potentially triggering the registry's platform-level rate limiting that applies to all publishers collectively. Second, it represents direct revenue leakage: the registry's enterprise tier pricing is typically ten to twenty times the pro tier price, and an attacker with unlimited quota has no incentive to pay for the tier they are consuming through JWT manipulation.

Vulnerable
// PRIVESC70-001 — VULNERABLE: rateLimitTier read from JWT claim without DB verification
const jwt = require('jsonwebtoken');
const { TIER_CONFIGS } = require('../config/rate-limit-tiers');

function rateLimitMiddleware(req, res, next) {
  const token = req.headers.authorization?.replace('Bearer ', '');
  if (!token) return res.status(401).json({ error: 'Missing token' });

  const payload = jwt.verify(token, process.env.JWT_SECRET);
  // JWT claim trusted directly — no DB lookup to verify publisher has this tier
  const tierConfig = TIER_CONFIGS[payload.rateLimitTier] || TIER_CONFIGS['free'];

  req.rateLimitConfig = tierConfig;
  req.publisherId = payload.sub;
  next();
}

Trusting rateLimitTier from the JWT payload allows any publisher with a valid signing key to self-grant enterprise_unlimited quota — the JWT claim is attestation, not authorization; tier entitlements must be verified against a database record that only registry admins can write. A DB-backed lookup by publisherId replaces the JWT claim as the authoritative source; the JWT carries only the subject claim; and the tier lookup result is cached with the rateLimitPolicyVersionId in the cache key to ensure revocation propagates correctly.

Fixed
// PRIVESC70-001 — FIXED: DB-backed rateLimitTier lookup; JWT carries only sub
const jwt = require('jsonwebtoken');
const { db } = require('../db');
const { rateLimitCache } = require('../cache/rate-limit');
const { TIER_CONFIGS } = require('../config/rate-limit-tiers');

async function rateLimitMiddleware(req, res, next) {
  const token = req.headers.authorization?.replace('Bearer ', '');
  if (!token) return res.status(401).json({ error: 'Missing token' });

  const payload = jwt.verify(token, process.env.JWT_SECRET);
  const publisherId = payload.sub;

  // DB-backed lookup — JWT carries only sub, tier comes from authoritative DB record
  const publisher = await rateLimitCache.getOrSet(
    `rate-limit-tier:${publisherId}`,
    () => db.getPublisherRateLimitTier(publisherId),
    { ttl: 60 }
  );
  const tierConfig = TIER_CONFIGS[publisher.rateLimitTier] || TIER_CONFIGS['free'];

  req.rateLimitConfig = tierConfig;
  req.publisherId = publisherId;
  next();
}

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 reflects unauthorized consumption of enterprise quota tiers and direct revenue leakage; availability impact reflects quota exhaustion degrading throughput for all legitimate publishers during high-traffic periods.

PRIVESC70-002 — Missing tier boundary check on /api/registry/rate-limit/tier/assign enables self-assignment of enterprise_unlimited

The rate limit tier assignment endpoint allows administrators to change a publisher's rate limit tier by submitting a request specifying the target publisherId and the desired targetTier. The endpoint validates that the requesting user holds the rate_limit_admin role, but it does not validate that the targetTier value being assigned is within the bounds of tiers that the requesting publisher is authorized to reach — it validates only that the requester is an admin, not that the assignment operation is consistent with the target publisher's commercial standing. Additionally, the endpoint contains a path that processes self-assignment requests — where the requesting publisher is also the publisherId target — without applying the admin role check, because the endpoint was originally designed to allow publishers to downgrade their own tier to manage costs.

An attacker who discovers the self-assignment path can submit a request with their own publisher ID as the target and enterprise_unlimited as the tier, bypassing both the admin role check (because the self-assignment path skips it) and the enterprise agreement requirement (because no agreement verification is performed for self-submitted tier changes). The resulting database record reflects enterprise_unlimited as the publisher's authoritative tier, which the fixed PRIVESC70-001 implementation then reads and applies, granting unlimited quota through the legitimate DB-backed path rather than through JWT manipulation. This means that even a fully remediated PRIVESC70-001 implementation remains exploitable through PRIVESC70-002 until the tier boundary check is applied to self-assignment operations as well as admin-initiated assignments.

Vulnerable
// PRIVESC70-002 — VULNERABLE: self-assignment path skips admin check and tier boundary
const express = require('express');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');

const router = express.Router();

router.post('/registry/rate-limit/tier/assign',
  requireSession,
  async (req, res) => {
    const { publisherId, targetTier } = req.body;
    const isSelfAssign = publisherId === req.session.publisherId;

    if (!isSelfAssign) {
      // Admin check only applied to non-self assignments
      if (!req.session.roles.includes('rate_limit_admin')) {
        return res.status(403).json({ error: 'Requires rate_limit_admin role' });
      }
    }
    // No tier boundary check — attacker self-assigns enterprise_unlimited
    await db.setPublisherRateLimitTier(publisherId, targetTier);
    res.json({ publisherId, tier: targetTier });
  }
);

module.exports = router;

The self-assignment bypass allows any publisher to elevate to enterprise_unlimited without admin involvement — fixing PRIVESC70-001 without fixing PRIVESC70-002 leaves the DB-backed lookup exploitable through the legitimate write path. RATE_LIMIT_TIER_ORDER enforces an ordinal boundary: publishers can only self-assign to tiers at or below their current tier; enterprise_unlimited always requires an admin queue review; an audit log entry records every tier change for forensic investigation of unauthorized escalations.

Fixed
// PRIVESC70-002 — FIXED: RATE_LIMIT_TIER_ORDER boundary; enterprise_unlimited requires admin queue
const express = require('express');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const { auditLog } = require('../audit');

const RATE_LIMIT_TIER_ORDER = ['free', 'pro', 'team', 'enterprise', 'enterprise_unlimited'];

const router = express.Router();

router.post('/registry/rate-limit/tier/assign',
  requireSession,
  async (req, res) => {
    const { publisherId, targetTier } = req.body;
    const isSelfAssign = publisherId === req.session.publisherId;

    if (!RATE_LIMIT_TIER_ORDER.includes(targetTier)) {
      return res.status(400).json({ error: 'Invalid targetTier' });
    }

    if (isSelfAssign) {
      const current = await db.getPublisherRateLimitTier(publisherId);
      const currentIdx = RATE_LIMIT_TIER_ORDER.indexOf(current.rateLimitTier);
      const targetIdx = RATE_LIMIT_TIER_ORDER.indexOf(targetTier);
      // Self-assignment: only allow downgrade; enterprise_unlimited always requires admin queue
      if (targetIdx > currentIdx || targetTier === 'enterprise_unlimited') {
        return res.status(403).json({ error: 'Tier upgrade requires admin approval' });
      }
    } else {
      if (!req.session.roles.includes('rate_limit_admin')) {
        return res.status(403).json({ error: 'Requires rate_limit_admin role' });
      }
      if (targetTier === 'enterprise_unlimited') {
        return res.status(400).json({ error: 'enterprise_unlimited requires enterprise agreement review queue' });
      }
    }

    await db.setPublisherRateLimitTier(publisherId, targetTier);
    await auditLog.write({
      action: 'rate-limit.tier.assign',
      publisherId, targetTier,
      actorId: req.session.publisherId, isSelfAssign,
      at: new Date()
    });
    res.json({ publisherId, tier: targetTier });
  }
);

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); any publisher account can self-assign enterprise_unlimited without admin involvement; combined with PRIVESC70-001 remediation that trusts the DB record, this finding is a direct bypass of the entire rate limit enforcement system.

PRIVESC70-003 — Missing ownership check on /api/registry/rate-limit/config enables global rate limit modification

The global rate limit configuration endpoint allows updates to the platform-wide rate limit thresholds: the per-publisher request-per-minute limit for each tier, the burst allowance that permits short-term traffic spikes above the sustained rate, and the throttling window duration that determines how long a publisher remains throttled after exceeding their quota. The endpoint requires authentication but performs no ownership check — it does not verify that the requesting user holds the rate_limit_admin role or any elevated privilege before applying the submitted configuration changes to the platform-wide settings. Any authenticated publisher can submit a PATCH request to this endpoint and modify the rate limiting parameters that govern the API access of every publisher on the platform simultaneously.

The practical consequence is that any publisher can lower the rate limits for all tiers to effectively zero — setting request-per-minute to 0 and burst to 0 — creating a platform-wide denial-of-service condition in which every API call by every publisher is immediately throttled, regardless of their tier or usage pattern. Alternatively, a publisher can raise the limits for the free tier to match the enterprise tier, eliminating the commercial differentiation that motivates tier upgrades and directly damaging the registry's subscription revenue. The absence of an ownership check means this endpoint requires no privilege escalation, no token manipulation, and no vulnerability chain — it is directly exploitable by any account created through the standard publisher registration flow.

Vulnerable
// PRIVESC70-003 — VULNERABLE: PATCH /rate-limit/config missing ownership check
const express = require('express');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');

const router = express.Router();

router.patch('/registry/rate-limit/config',
  requireSession,
  async (req, res) => {
    // No role check — any authenticated publisher modifies global rate limits
    await db.updateRateLimitConfig(req.body);
    res.json({ updated: true });
  }
);

module.exports = router;

Any authenticated publisher can zero out global rate limits causing platform-wide API denial-of-service, or raise free tier limits to enterprise levels destroying the registry's subscription revenue model — this endpoint requires no privilege escalation because the ownership check is entirely absent. The rate_limit_admin role check closes the missing ownership check; Zod RateLimitConfigUpdateSchema with min/max bounds prevents zero-value and excessively permissive configurations from reaching the database; re-authentication before config changes raises the bar against session-hijack exploitation; and bumping rateLimitPolicyVersion on every write invalidates all cached tier lookups, ensuring the new configuration takes effect immediately.

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

const RateLimitConfigUpdateSchema = z.object({
  tiers: z.record(
    z.enum(['free', 'pro', 'team', 'enterprise', 'enterprise_unlimited']),
    z.object({
      requestsPerMinute: z.number().int().min(1).max(100000),
      burstAllowance: z.number().int().min(1).max(10000),
      throttlingWindowSeconds: z.number().int().min(10).max(3600)
    })
  ).optional()
});

const router = express.Router();

router.patch('/registry/rate-limit/config',
  requireSession,
  requireRateLimitAdmin,
  reAuthRequired,
  async (req, res) => {
    const update = RateLimitConfigUpdateSchema.parse(req.body);
    const newVersion = await db.updateRateLimitConfig(update);
    await auditLog.write({
      action: 'rate-limit.config.update',
      update, actorId: req.session.publisherId, newVersion, at: new Date()
    });
    res.json({ updated: true, rateLimitPolicyVersion: 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); any authenticated publisher can zero global rate limits for immediate platform-wide API denial-of-service, or raise free tier limits to destroy subscription revenue differentiation — no privilege escalation required.

PRIVESC70-004 — Rate limit tier cache key missing rateLimitPolicyVersionId retains revoked enterprise_unlimited tiers

The rate limit enforcement middleware caches the result of the database tier lookup using a Redis key constructed from only the publisher ID: rate-limit-tier:${publisherId}. When a publisher's tier is revoked or downgraded — for example, when an enterprise agreement expires or is terminated, or when PRIVESC70-002 is detected and the unauthorized enterprise_unlimited assignment is reversed — the cache key for that publisher still contains the previous tier value until the TTL expires. During the TTL window, every API request from the publisher still receives the enterprise_unlimited quota allowance, because the enforcement middleware reads the cached value rather than querying the database for the updated tier.

The cache TTL for rate limit tier lookups is typically set to sixty seconds to reduce database read load during high-traffic periods. Under normal circumstances this is an acceptable consistency tradeoff: legitimate tier changes are propagated within a minute. However, when the tier change is a security response — reversing an unauthorized privilege escalation discovered during an incident — a sixty-second window in which the attacker retains unlimited quota may allow them to exhaust significant API capacity or complete operations that require high-volume API access before the revocation takes effect. The fix requires including the rateLimitPolicyVersionId in the cache key so that every write to the rate limit policy namespace produces cache keys that do not match any previously cached entry, ensuring that all workers read fresh tier values after a policy update regardless of when their current cache entry was written.

Vulnerable
// PRIVESC70-004 — VULNERABLE: cache key missing rateLimitPolicyVersionId — revoked tiers cached
const { db } = require('../db');
const { rateLimitCache } = require('../cache/rate-limit');

async function getPublisherRateLimitConfig(publisherId) {
  // Cache key uses only publisherId — revoked enterprise_unlimited cached until TTL
  const cacheKey = `rate-limit-tier:${publisherId}`;
  return rateLimitCache.getOrSet(
    cacheKey,
    () => db.getPublisherRateLimitTier(publisherId),
    { ttl: 60 }
  );
}

A sixty-second cache TTL is an acceptable consistency tradeoff for routine tier changes but is unacceptable for security revocations — an attacker whose unauthorized enterprise_unlimited tier is revoked retains unlimited quota for up to a minute, during which they can exhaust significant API capacity. Including rateLimitPolicyVersionId in the cache key ensures that every policy write produces cache misses across all workers immediately, without requiring manual cache invalidation or reduced TTLs that would increase database read load under normal operating conditions.

Fixed
// PRIVESC70-004 — FIXED: cache key = rateLimitPolicyVersionId:publisherId; revokeRateLimitTier() bumps version
const { db } = require('../db');
const { rateLimitCache } = require('../cache/rate-limit');

async function getPublisherRateLimitConfig(publisherId) {
  // Read current policy version — incremented on every tier change or config update
  const { rateLimitPolicyVersionId } = await db.getRateLimitPolicyVersion();
  // Cache key includes version — revoked tiers produce cache misses immediately
  const cacheKey = `rate-limit-tier:${rateLimitPolicyVersionId}:${publisherId}`;
  return rateLimitCache.getOrSet(
    cacheKey,
    () => db.getPublisherRateLimitTier(publisherId),
    { ttl: 60 }
  );
}

// Revocation function increments policy version — invalidates all cached entries
async function revokeRateLimitTier(publisherId, actorId) {
  await db.setPublisherRateLimitTier(publisherId, 'free');
  // Incrementing rateLimitPolicyVersionId makes all existing cache keys stale
  await db.incrementRateLimitPolicyVersion();
  await auditLog.write({
    action: 'rate-limit.tier.revoke',
    publisherId, actorId, newTier: 'free', at: new Date()
  });
}

CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L — Base Score 5.4 (MEDIUM); cache bleed is a secondary vulnerability that extends the impact window of PRIVESC70-001 and PRIVESC70-002 revocations; direct exploitation requires a prior unauthorized tier escalation; remediation is nonetheless required to ensure security revocations take effect immediately without TTL delay.

Scan your MCP skill for PRIVESC70 and 200+ other vulnerability classes

SkillAudit checks for all SA-SKL-PRIVESC vulnerability patterns including JWT claim rate limit tier bypass, missing boundary checks on tier self-assignment, missing ownership checks on global rate limit configuration, and cache key version contamination allowing revoked tiers to persist. Get a graded report with line-level code fixes in 60 seconds.

Get a free audit