Claude MCP skill privilege escalation — skill publisher verification and trust level endpoints (SA-SKL-PRIVESC67)
SA-SKL-PRIVESC67 identifies four privilege escalation vulnerabilities across the MCP skill registry's publisher verification and trust level management endpoints. The publisher trust system is the primary mechanism by which the registry differentiates between verified enterprise publishers with relaxed moderation rules and unverified publishers subject to full review; all four findings allow an attacker to manipulate this system without meeting the identity verification, revenue threshold, or administrative authorization requirements that the trust levels are designed to enforce. The most impactful finding allows any publisher to self-assign the highest trust tier by exploiting a missing ordinal boundary check, while a secondary finding allows any authenticated user to modify the global trust algorithm weights that govern every publisher's verification requirements platform-wide.
publisherTrust claim — craft JWT with publisherTrust:'verified_enterprise' grants reduced moderation scrutiny, increased rate limits, and priority support queue access without database-side checkPOST /api/registry/publisher/trust/assign missing level boundary check — any unverified publisher assigns verified_enterprise trust level to themselves bypassing identity verification and revenue threshold requirementsPATCH /api/registry/publisher/trust/config missing ownership check — any authenticated user modifies global publisher trust algorithm weights, verification requirements, and rate limit tiers affecting all publisherspublisherId without trustPolicyVersionId — cache entries bleed across trust policy upgrades; revoked verified_enterprise status retained until TTL expiryPRIVESC67-001 — JWT publisherTrust claim read without database check grants enterprise trust tier to any token holder
The publisher trust middleware reads the publisher's trust level directly from the publisherTrust claim embedded in the JWT access token, without performing any database-side check to verify that the trust level in the token matches the current authoritative value stored in the publishers table. Because JWTs are signed by the registry's token issuer, an attacker who obtains any valid JWT — including one originally issued with publisherTrust:'unverified' — cannot modify the existing token without invalidating the signature. However, if the JWT signing key is ever exposed (which is a common finding in misconfigured environments), the attacker can craft a new JWT with publisherTrust:'verified_enterprise' and present it to every endpoint that relies on this claim. With verified_enterprise trust, the attacker's skills bypass the standard content moderation review queue, receive a tenfold increase in API rate limits, and are automatically placed in the priority support queue — all without undergoing identity verification or meeting the revenue threshold that the enterprise tier formally requires.
// PRIVESC67-001 — VULNERABLE: publisher trust read from JWT claim without DB check
const jwt = require('jsonwebtoken');
const { JWT_SECRET } = require('../config');
function requirePublisherTrust(minimumLevel) {
const TRUST_ORDER = ['unverified', 'basic', 'verified', 'verified_enterprise'];
return async (req, res, next) => {
const token = req.headers.authorization?.split(' ')[1];
if (!token) return res.status(401).json({ error: 'No token' });
const payload = jwt.verify(token, JWT_SECRET);
// Trust level read from JWT claim — no DB lookup to verify current value
const publisherTrust = payload.publisherTrust;
const currentIdx = TRUST_ORDER.indexOf(publisherTrust);
const requiredIdx = TRUST_ORDER.indexOf(minimumLevel);
if (currentIdx < requiredIdx) {
return res.status(403).json({ error: 'Insufficient publisher trust level' });
}
req.publisher = { id: payload.sub, trust: publisherTrust };
next();
};
}
module.exports = { requirePublisherTrust };
Trust levels embedded in JWTs cannot be revoked without key rotation — a compromised token with a crafted trust claim grants enterprise privileges for the full token lifetime. The authoritative trust level must always be fetched from the database on each request using the sub (userId) from the JWT as the lookup key; the JWT should carry only the sub claim and nothing security-sensitive. This ensures that any trust level change — including revocation — takes effect immediately without requiring token rotation or cache invalidation.
// PRIVESC67-001 — FIXED: DB-backed publisher trust lookup by userId; JWT carries only sub
const jwt = require('jsonwebtoken');
const { JWT_SECRET } = require('../config');
const { db } = require('../db');
const TRUST_ORDER = ['unverified', 'basic', 'verified', 'verified_enterprise'];
function requirePublisherTrust(minimumLevel) {
return async (req, res, next) => {
const token = req.headers.authorization?.split(' ')[1];
if (!token) return res.status(401).json({ error: 'No token' });
const payload = jwt.verify(token, JWT_SECRET);
// DB lookup by userId — authoritative trust level, not from JWT claim
const publisher = await db.getPublisherById(payload.sub);
if (!publisher) return res.status(401).json({ error: 'Publisher not found' });
const currentIdx = TRUST_ORDER.indexOf(publisher.trustLevel);
const requiredIdx = TRUST_ORDER.indexOf(minimumLevel);
if (currentIdx < requiredIdx) {
return res.status(403).json({ error: 'Insufficient publisher trust level' });
}
req.publisher = { id: publisher.id, trust: publisher.trustLevel };
next();
};
}
module.exports = { requirePublisherTrust };
CVSS score: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N — Base Score 6.8 (MEDIUM); attack complexity high due to JWT signing key exposure prerequisite; impact high due to full enterprise tier privilege acquisition.
PRIVESC67-002 — Missing trust level boundary check allows self-assignment of verified_enterprise tier
The publisher trust assignment endpoint allows publishers to request a trust level upgrade by submitting a POST request with their desired trustLevel. The endpoint validates that the requested level is a recognized trust tier but fails to enforce a boundary check ensuring that a publisher can only request an upgrade to the level immediately above their current level through the legitimate verification flow. Any unverified publisher can submit a request with trustLevel: 'verified_enterprise' and the endpoint will apply the upgrade directly, bypassing the identity verification step that requires a government-issued document scan, the revenue threshold check that requires documented annual MCP revenue above the enterprise threshold, and the manual admin review queue that is supposed to gate every verified_enterprise assignment. With verified_enterprise status, the attacker's skills receive reduced content moderation scrutiny, allowing malicious skills to bypass the review process that protects users from harmful skill content.
// PRIVESC67-002 — VULNERABLE: no level boundary check on trust assignment
const express = require('express');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const router = express.Router();
const VALID_TRUST_LEVELS = new Set([
'unverified', 'basic', 'verified', 'verified_enterprise'
]);
router.post('/registry/publisher/trust/assign',
requireSession,
async (req, res) => {
const { trustLevel } = req.body;
if (!VALID_TRUST_LEVELS.has(trustLevel)) {
return res.status(400).json({ error: 'Invalid trust level' });
}
// No boundary check — any publisher can self-assign verified_enterprise
await db.updatePublisherTrust(req.session.userId, trustLevel);
res.json({ trustLevel, assignedAt: new Date() });
}
);
module.exports = router;
Without an ordinal boundary check, the trust assignment endpoint is a one-step bypass for the entire publisher verification program. PUBLISHER_TRUST_ORDER ordinal comparison ensures a publisher can only request an upgrade of exactly one level above their current level. verified_enterprise must always require an admin review queue entry — it must never be directly assignable through the self-service endpoint regardless of the publisher's current level. The audit log provides the forensic record needed to detect mass self-assignment attempts.
// PRIVESC67-002 — FIXED: PUBLISHER_TRUST_ORDER boundary; verified_enterprise admin queue
const express = require('express');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const { auditLog } = require('../audit');
const router = express.Router();
const PUBLISHER_TRUST_ORDER = [
'unverified', 'basic', 'verified', 'verified_enterprise'
];
router.post('/registry/publisher/trust/assign',
requireSession,
async (req, res) => {
const { trustLevel } = req.body;
const orderIdx = PUBLISHER_TRUST_ORDER.indexOf(trustLevel);
if (orderIdx === -1) return res.status(400).json({ error: 'Invalid trust level' });
const publisher = await db.getPublisherById(req.session.userId);
const currentIdx = PUBLISHER_TRUST_ORDER.indexOf(publisher.trustLevel);
// Only one level up allowed — prevents skipping verification steps
if (orderIdx !== currentIdx + 1) {
return res.status(403).json({ error: 'Can only request the next trust tier' });
}
// verified_enterprise always requires admin review — never direct assignment
if (trustLevel === 'verified_enterprise') {
const ticket = await db.createTrustUpgradeTicket({
publisherId: req.session.userId,
requestedLevel: trustLevel
});
await auditLog.write({ action: 'publisher.trust.upgrade.requested',
publisherId: req.session.userId, requestedLevel: trustLevel, at: new Date() });
return res.json({ status: 'pending_admin_review', ticketId: ticket.id });
}
await db.updatePublisherTrust(req.session.userId, trustLevel);
await auditLog.write({ action: 'publisher.trust.assigned',
publisherId: req.session.userId, trustLevel, at: new Date() });
res.json({ trustLevel, assignedAt: new Date() });
}
);
module.exports = router;
CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N — Base Score 8.1 (HIGH); any authenticated publisher can self-escalate to the highest trust tier bypassing all verification controls.
PRIVESC67-003 — Missing ownership check allows any user to modify global publisher trust algorithm weights
The publisher trust configuration endpoint allows modification of the global algorithm weights that govern how the trust system evaluates publishers: the minimum revenue threshold for each tier, the weight assigned to identity verification completeness, the rate limit multipliers for each trust level, and the content moderation scrutiny level applied to skills from each tier. The endpoint requires authentication but performs no check that the authenticated user holds the publisher_admin role — any publisher, regardless of their own trust level, can submit a PATCH request and immediately alter the global trust configuration that affects every publisher on the platform. An attacker can set the minimum revenue threshold for verified_enterprise to zero, increase the rate limit multiplier for unverified publishers to match the enterprise tier, or disable content moderation scrutiny for all trust levels — changes that affect every publisher and every user of the registry simultaneously.
// PRIVESC67-003 — VULNERABLE: no publisher_admin role check on trust config update
const express = require('express');
const { z } = require('zod');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const router = express.Router();
const TrustConfigUpdateSchema = z.object({
enterpriseRevenueThreshold: z.number().optional(),
identityVerificationWeight: z.number().min(0).max(1).optional(),
rateLimitMultipliers: z.record(z.number()).optional(),
moderationScruitnyLevel: z.record(z.string()).optional()
});
router.patch('/registry/publisher/trust/config',
requireSession,
// Missing: requireRole('publisher_admin')
async (req, res) => {
const update = TrustConfigUpdateSchema.parse(req.body);
// Any authenticated user can modify global trust config
await db.updateGlobalPublisherTrustConfig(update);
res.json({ updated: true });
}
);
module.exports = router;
Global trust algorithm weights control the verification requirements and rate limits for every publisher on the platform — unauthorized modification is a platform-wide privilege escalation. The publisher_admin role gate ensures only designated administrators can make trust algorithm changes. Re-authentication before every config change raises the bar against session hijack. Bumping policyVersion on every update invalidates all cached trust level evaluations, ensuring no publisher continues operating under the old (potentially attacker-modified) algorithm after a change is made.
// PRIVESC67-003 — FIXED: publisher_admin role; Zod schema; reAuth; policyVersion bump
const express = require('express');
const { z } = require('zod');
const { db } = require('../db');
const { requireSession, requireRole, reAuthRequired } = require('../middleware/auth');
const { auditLog } = require('../audit');
const router = express.Router();
const PublisherTrustConfigUpdateSchema = z.object({
enterpriseRevenueThreshold: z.number().positive().optional(),
identityVerificationWeight: z.number().min(0).max(1).optional(),
rateLimitMultipliers: z.object({
unverified: z.number().min(0.1).max(1),
basic: z.number().min(1).max(5),
verified: z.number().min(1).max(10),
verified_enterprise: z.number().min(1).max(20)
}).partial().optional(),
moderationScrutinyLevel: z.object({
unverified: z.enum(['full', 'standard', 'light']),
basic: z.enum(['full', 'standard', 'light']),
verified: z.enum(['full', 'standard', 'light']),
verified_enterprise: z.enum(['full', 'standard', 'light'])
}).partial().optional()
});
router.patch('/registry/publisher/trust/config',
requireSession,
requireRole('publisher_admin'),
reAuthRequired,
async (req, res) => {
const update = PublisherTrustConfigUpdateSchema.parse(req.body);
const newConfig = await db.updateGlobalPublisherTrustConfig(update);
// Bump policyVersion — invalidates all cached trust level evaluations
await db.incrementPublisherTrustPolicyVersion();
await auditLog.write({ action: 'publisher.trust.config.updated',
actorId: req.session.userId, changes: update, at: new Date() });
res.json({ updated: true, policyVersion: newConfig.policyVersion });
}
);
module.exports = router;
CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N — Base Score 8.5 (HIGH); platform-wide impact from global algorithm modification; scope changed because change affects all publishers.
PRIVESC67-004 — Trust level cache key missing policyVersionId retains revoked enterprise status after policy upgrade
The publisher trust level lookup caches each publisher's resolved trust level in Redis using the cache key publisher-trust:{publisherId}. When an admin revokes a publisher's verified_enterprise status — either because the publisher violated policy or because PRIVESC67-002 was exploited and the fraudulent assignment was discovered — the trust database record is updated immediately but the cache key is not invalidated. Any subsequent request within the cache TTL (typically 15 minutes) hits the stale cache entry and returns verified_enterprise, meaning the revoked publisher continues to operate with enterprise-tier rate limits, reduced moderation scrutiny, and priority queue access for up to 15 minutes after revocation. When a trust policy upgrade is deployed that changes the algorithm weights (see PRIVESC67-003), every cached entry computed under the old algorithm continues to serve the old result until TTL expiry, meaning publishers whose trust levels would change under the new algorithm temporarily retain their old privileges.
// PRIVESC67-004 — VULNERABLE: cache key missing trustPolicyVersionId
const { redis } = require('../redis');
const { db } = require('../db');
const TRUST_CACHE_TTL = 900; // 15 minutes
async function getPublisherTrustLevel(publisherId) {
// Cache key lacks policyVersionId — bleeds across policy upgrades
const cacheKey = `publisher-trust:${publisherId}`;
const cached = await redis.get(cacheKey);
if (cached) return cached;
const publisher = await db.getPublisherById(publisherId);
await redis.setex(cacheKey, TRUST_CACHE_TTL, publisher.trustLevel);
return publisher.trustLevel;
}
async function revokePublisherTrust(publisherId) {
await db.updatePublisherTrust(publisherId, 'unverified');
// Cache not invalidated — revoked publisher retains enterprise trust for TTL
}
module.exports = { getPublisherTrustLevel, revokePublisherTrust };
A cache key that excludes the policy version allows revoked enterprise status to persist for the full cache TTL — up to 15 minutes of continued enterprise-tier access after revocation. Including trustPolicyVersionId in the cache key means every policy version change automatically invalidates all cached entries because the key space changes. revokePublisherTrust() must increment policyVersion to invalidate all entries simultaneously, ensuring revocation takes effect within the next cache population cycle rather than after the TTL expires.
// PRIVESC67-004 — FIXED: cache key = trustPolicyVersionId:publisherId; revoke increments version
const { redis } = require('../redis');
const { db } = require('../db');
const TRUST_CACHE_TTL = 900; // 15 minutes
async function getPublisherTrustLevel(publisherId) {
// Include policyVersionId in cache key — policy upgrade invalidates all entries
const policyVersion = await db.getCurrentTrustPolicyVersion();
const cacheKey = `publisher-trust:${policyVersion}:${publisherId}`;
const cached = await redis.get(cacheKey);
if (cached) return cached;
const publisher = await db.getPublisherById(publisherId);
await redis.setex(cacheKey, TRUST_CACHE_TTL, publisher.trustLevel);
return publisher.trustLevel;
}
async function revokePublisherTrust(publisherId, reason) {
await db.updatePublisherTrust(publisherId, 'unverified');
// Increment policyVersion — invalidates ALL cached trust entries platform-wide
await db.incrementPublisherTrustPolicyVersion();
// Also delete the specific key for immediate effect without waiting for version propagation
const policyVersion = await db.getCurrentTrustPolicyVersion();
await redis.del(`publisher-trust:${policyVersion}:${publisherId}`);
await db.createTrustRevocationRecord({ publisherId, reason, revokedAt: new Date() });
}
module.exports = { getPublisherTrustLevel, revokePublisherTrust };
CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N — Base Score 5.4 (MEDIUM); revoked enterprise status persists for cache TTL duration; reduced scrutiny window allows policy-violating content to bypass moderation review.
SkillAudit checks for all SA-SKL-PRIVESC vulnerability patterns including JWT trust claim bypass without database verification, missing ordinal boundary checks on trust level assignment, missing role gates on global configuration endpoints, and cache key design flaws that allow revoked privileges to persist. Get a graded report with line-level code fixes in 60 seconds.
Get a free audit