Claude skill insecure CDN caching of authenticated responses — SA-SKL-CACHING2
CDN caching is a frequent source of data-exposure bugs in MCP skill deployments: without explicit Cache-Control: no-store headers, a CDN sitting in front of an Express API will cache authenticated responses and serve them to the next requester regardless of identity. SA-SKL-CACHING2 covers four patterns: a missing Cache-Control: private or no-store that lets one user receive another user's audit results from CDN cache; a missing Vary: Origin that causes CORS header collisions across origins; an ETag computed only from response body content that leaks the existence of private resources to unauthenticated callers via 304 Not Modified; and an MCP skill proxy that forwards user-supplied Cache-Control headers to upstream, enabling cache poisoning probes.
Why CDN caching vulnerabilities are common in MCP skill deployments
MCP skills that expose HTTP endpoints frequently add a CDN (Cloudflare, CloudFront, Fastly, or a reverse-proxy cache) to reduce latency and improve availability. The default caching behaviour of most CDNs is permissive: if the origin response does not set Cache-Control: no-store or Cache-Control: private, and the response code is cacheable (200, 203, 204, 206, 300, 301, 404, 405, 410, 414, or 501 by RFC 7231), the CDN will cache it. For public resources this is fine. For responses that contain user-specific data — audit results, skill configurations, API keys, session tokens — it is a severe data exposure vulnerability.
The issue is not unique to MCP skills, but MCP deployments amplify it in two ways. First, skill developers frequently scaffold Express APIs from templates that do not include cache headers, then deploy them behind a CDN as an afterthought. Second, Claude-facing endpoints often carry more sensitive data than typical web API endpoints — skill output may include audit findings, vulnerability details, internal metrics, or other confidential information that must never be shared across users. SkillAudit's header-analysis scanner checks all four CACHING2 patterns on every endpoint discovered in a skill's HTTP layer.
SA-SKL-CACHING2 in scope: CACHING2-001 (CDN caches authenticated API response — missing Cache-Control: no-store serves user A's data to user B), CACHING2-002 (Vary: Origin missing on CORS response — CDN serves wrong Access-Control-Allow-Origin to different origins), CACHING2-003 (ETag computed from response body without user ID — 304 Not Modified leaks existence of private resource to unauthenticated requests), CACHING2-004 (MCP skill proxy forwards user-supplied Cache-Control and conditional headers to upstream — enables cache poisoning probe). Each finding includes SkillAudit detection rules and correct Node.js/Express fixes.
CACHING2-001 — CDN caches authenticated API response: missing Cache-Control: no-store
When an Express endpoint returns user-specific data with res.json(auditResults) and no explicit cache headers, the CDN caches the response keyed on the request URL (and optionally the Vary fields). The next user who requests the same URL — before the CDN TTL expires — receives the cached response from the first user. This is not a hypothetical: Cloudflare's default TTL for 200 OK responses with no cache directive is determined by the Edge Cache TTL setting, which defaults to 2 hours. Any user who hits the same skill endpoint within that window receives another user's private data.
The correct fix depends on the endpoint type. For authenticated endpoints that return user-specific data, use Cache-Control: no-store — this instructs every intermediate cache (CDN, proxy, browser) not to store the response at all. For public endpoints that benefit from CDN caching, use Cache-Control: public, max-age=N explicitly. The dangerous middle ground is using Cache-Control: private alone on a CDN-fronted API: private tells CDNs not to cache, but it only takes a misconfigured CDN rule or a cache override to strip the directive and start caching again. no-store is the strongest directive and the safest choice for authenticated data.
// VULNERABLE — res.json() with no cache headers on authenticated endpoint
// CDN will cache this response and serve it to any subsequent requester
import express from 'express';
import { db } from './db.js';
import { verifyToken } from './auth.js';
const app = express();
// Authenticated endpoint: returns audit results for the current user
// No Cache-Control header = CDN defaults apply = response may be cached
app.get('/api/audits', async (req, res) => {
const token = req.headers.authorization?.slice(7);
if (!token) return res.status(401).json({ error: 'Unauthorized' });
let userId: string;
try {
const payload = verifyToken(token);
userId = payload.userId;
} catch {
return res.status(401).json({ error: 'Invalid token' });
}
// Fetch this user's audit results — PRIVATE data
const audits = await db.query(
'SELECT id, skill_name, findings, created_at FROM audits WHERE owner_id = $1 ORDER BY created_at DESC',
[userId]
);
// VULNERABLE: no Cache-Control header
// CDN caches this response keyed on /api/audits
// User B requests /api/audits → CDN serves user A's audit results
// The Authorization header is NOT part of the cache key by default on most CDNs
res.json({ audits: audits.rows });
// ↑ equivalent to res.status(200).json(...) — no cache directive set
});
// Also vulnerable: using res.send() or res.render() without cache headers
app.get('/api/skill-config', async (req, res) => {
const { userId } = verifyToken(req.headers.authorization!.slice(7));
const config = await db.query('SELECT * FROM skill_configs WHERE owner_id = $1', [userId]);
// No Cache-Control — CDN may cache API key configuration for other users to read
res.send(JSON.stringify(config.rows[0]));
});
// FIXED — Cache-Control: no-store on all authenticated endpoints
import express from 'express';
import { db } from './db.js';
import { verifyToken } from './auth.js';
const app = express();
// Middleware: apply no-store to all /api/* routes
// Apply this BEFORE route handlers so it cannot be accidentally omitted
app.use('/api', (_req, res, next) => {
// no-store: do not cache under any circumstances — not in CDN, not in browser
// no-cache: additionally included so HTTP/1.0 proxies also skip caching
// must-revalidate: belt-and-suspenders for any cache that ignores no-store
res.set('Cache-Control', 'no-store, no-cache, must-revalidate');
next();
});
// Now route handlers can call res.json() safely — cache header already set
app.get('/api/audits', async (req, res) => {
const token = req.headers.authorization?.slice(7);
if (!token) return res.status(401).json({ error: 'Unauthorized' });
let userId: string;
try {
const payload = verifyToken(token);
userId = payload.userId;
} catch {
return res.status(401).json({ error: 'Invalid token' });
}
const audits = await db.query(
'SELECT id, skill_name, findings, created_at FROM audits WHERE owner_id = $1 ORDER BY created_at DESC',
[userId]
);
// FIXED: Cache-Control: no-store already set by middleware above
res.json({ audits: audits.rows });
});
// Alternative: set no-store per-route for fine-grained control
app.get('/api/skill-config', async (req, res) => {
res.set('Cache-Control', 'no-store'); // Per-route cache directive
const { userId } = verifyToken(req.headers.authorization!.slice(7));
const config = await db.query('SELECT * FROM skill_configs WHERE owner_id = $1', [userId]);
res.json(config.rows[0]);
});
// Public endpoints CAN be cached — set an explicit public directive
// Never use the absence of a header to mean "public" — always be explicit
app.get('/api/health', (_req, res) => {
res.set('Cache-Control', 'public, max-age=30, stale-while-revalidate=60');
res.json({ status: 'ok' });
});
res.json() without setting Cache-Control: no-store or Cache-Control: private, allowing a CDN to cache the user-specific response and serve it to subsequent requesters regardless of their identity — the Authorization header is not part of the CDN cache key by default, so user A's private audit results are served to user B; fix by applying res.set('Cache-Control', 'no-store') to all endpoints that return user-specific data, preferably via an app.use('/api', ...) middleware that sets the header before any route handler executes. Detection: SkillAudit flags authenticated route handlers (those that call a token-verification function or access req.headers.authorization) that do not set a Cache-Control directive on their response.CACHING2-002 — Missing Vary: Origin causes CDN to serve wrong CORS headers across origins
When an Express endpoint supports CORS by setting Access-Control-Allow-Origin dynamically — returning the requesting origin when it is in an allowlist — the CDN must be told that the response varies by the value of the Origin request header. Without a Vary: Origin response header, the CDN caches the first response with Access-Control-Allow-Origin: https://app.skillaudit.dev and then serves that cached response — with the wrong Access-Control-Allow-Origin value — to requests from any other origin. A request from https://evil.example.com would receive a response with Access-Control-Allow-Origin: https://app.skillaudit.dev, which the browser would block — but a request from https://partner.example.com (a legitimately allowed second origin) would also receive the wrong header and fail unexpectedly.
The reverse is more dangerous: if the first request comes from a less-trusted origin that the server allows (e.g., a staging environment), subsequent requests from the production origin receive the staging-origin header, potentially creating a confused state in browser security checks. Custom CORS implementations are especially prone to this because cors() middleware from the cors npm package sets Vary: Origin automatically — but developers who hand-roll CORS headers in middleware or route handlers typically forget it.
// VULNERABLE — custom CORS implementation missing Vary: Origin
import express from 'express';
const ALLOWED_ORIGINS = new Set([
'https://app.skillaudit.dev',
'https://staging.skillaudit.dev',
'https://partner.example.com',
]);
const app = express();
// VULNERABLE: sets Access-Control-Allow-Origin dynamically but forgets Vary: Origin
// CDN caches the first response with its ACAO value and serves it to all origins
app.use((req, res, next) => {
const origin = req.headers.origin;
if (origin && ALLOWED_ORIGINS.has(origin)) {
res.set('Access-Control-Allow-Origin', origin);
res.set('Access-Control-Allow-Credentials', 'true');
res.set('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
res.set('Access-Control-Allow-Headers', 'Content-Type, Authorization');
// MISSING: res.set('Vary', 'Origin');
// Without this, the CDN caches the first response as if Origin doesn't matter.
// First request from https://app.skillaudit.dev →
// CDN stores: ACAO: https://app.skillaudit.dev (no Vary key on Origin)
// Second request from https://staging.skillaudit.dev →
// CDN returns cached: ACAO: https://app.skillaudit.dev (wrong origin!)
// Browser blocks it — staging environment breaks mysteriously
}
if (req.method === 'OPTIONS') {
return res.sendStatus(204);
}
next();
});
app.get('/api/audits', (_req, res) => {
res.json({ audits: [] });
});
// FIXED — Option A: use the cors() npm package (sets Vary: Origin automatically)
import express from 'express';
import cors from 'cors';
const ALLOWED_ORIGINS = [
'https://app.skillaudit.dev',
'https://staging.skillaudit.dev',
'https://partner.example.com',
];
const app = express();
// cors() middleware automatically sets Vary: Origin when origin is a function or array
// This is the recommended approach — it handles all edge cases correctly
app.use(cors({
origin: (requestOrigin, callback) => {
// Allow requests with no origin (server-to-server, curl, etc.)
if (!requestOrigin) return callback(null, true);
if (ALLOWED_ORIGINS.includes(requestOrigin)) {
callback(null, requestOrigin); // Return the specific origin, not '*'
} else {
callback(new Error(`CORS: origin '${requestOrigin}' is not permitted`));
}
},
credentials: true,
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
allowedHeaders: ['Content-Type', 'Authorization'],
}));
// Fixed — Option B: manual CORS with Vary: Origin set explicitly
app.use((req, res, next) => {
const origin = req.headers.origin;
// FIXED: set Vary: Origin so CDN keys the cache on the Origin header value
// Must be set on EVERY response, even when the origin is not in the allowlist,
// so that the CDN does not cache a "no ACAO" response and serve it to allowed origins
res.set('Vary', 'Origin');
if (origin && ALLOWED_ORIGINS.includes(origin)) {
res.set('Access-Control-Allow-Origin', origin);
res.set('Access-Control-Allow-Credentials', 'true');
res.set('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
res.set('Access-Control-Allow-Headers', 'Content-Type, Authorization');
}
if (req.method === 'OPTIONS') {
return res.sendStatus(204);
}
next();
});
app.get('/api/audits', (_req, res) => {
res.set('Cache-Control', 'no-store');
res.json({ audits: [] });
});
Access-Control-Allow-Origin dynamically from an allowlist but omits Vary: Origin, allowing a CDN to cache the response with one origin's ACAO value and return it to all subsequent requesters regardless of their origin — legitimate second origins break silently, and staging-origin headers may be served to production requests; fix by either using the cors() npm package (which sets Vary: Origin automatically) or explicitly calling res.set('Vary', 'Origin') on every response in the CORS middleware, including responses to requests from non-allowed origins. Detection: SkillAudit flags route handlers and middleware that set Access-Control-Allow-Origin without also setting Vary: Origin on the same response object.CACHING2-003 — ETag computed from response body exposes private resource existence via 304 Not Modified
ETags are cache validators: a client that received a resource with ETag "abc123" can send a subsequent GET request with If-None-Match: "abc123", and the server responds with 304 Not Modified (no body) if the resource has not changed, saving bandwidth. The vulnerability arises when an Express endpoint computes an ETag from the response body alone (e.g., using etag npm package or Express's built-in ETag generation with app.set('etag', 'strong')) and then checks the If-None-Match header before performing authorization.
An attacker who previously had access to a resource (or who guesses the ETag via brute force) can probe whether the resource still exists for another user by sending a request with the ETag in If-None-Match. If the resource exists and has not changed, the server returns 304 — which reveals that the resource exists — even if the current requester is unauthenticated or unauthorized. The fix is to include the authenticated user's ID in the ETag computation so that an ETag from one user's session never matches a lookup from another user's session, and to perform the authorization check before the ETag comparison so that unauthorized requests always receive a 401 or 403 response rather than a 304.
// VULNERABLE — ETag computed from body alone; authorization checked after ETag response
import express from 'express';
import { createHash } from 'crypto';
import { db } from './db.js';
import { verifyToken } from './auth.js';
const app = express();
// Express built-in ETag: enabled by default, computed from response body only
// app.set('etag', 'strong'); ← this is the default
app.get('/api/audits/:auditId', async (req, res) => {
// VULNERABLE pattern 1: ETag comparison happens implicitly via Express before auth
// Express checks If-None-Match against the ETag of the last cached response
// body. If the audit exists and hasn't changed, Express sends 304 before the
// auth check below even runs (depending on middleware order).
const audit = await db.query(
'SELECT id, owner_id, findings FROM audits WHERE id = $1',
[req.params.auditId]
);
if (!audit.rows[0]) return res.status(404).json({ error: 'Not found' });
// VULNERABLE pattern 2: ETag set manually from body hash — no userId in hash
// attacker obtains ETag for their own audit: "d4e5f6..."
// later, attacker sends GET /api/audits/OTHER_USERS_AUDIT_ID
// with If-None-Match: "d4e5f6..."
// If the other user's audit has the same content (common for identical scan results),
// the ETag matches → 304 Not Modified → attacker learns the resource exists
const etag = `"${createHash('sha256').update(JSON.stringify(audit.rows[0].findings)).digest('hex').slice(0, 16)}"`;
res.set('ETag', etag);
if (req.headers['if-none-match'] === etag) {
// 304 is returned here — BEFORE the ownership check below
// An attacker learns the audit exists even without valid auth
return res.sendStatus(304);
}
// Authorization check happens AFTER the 304 response — too late
const token = req.headers.authorization?.slice(7);
if (!token) return res.status(401).json({ error: 'Unauthorized' });
const { userId } = verifyToken(token);
if (audit.rows[0].owner_id !== userId) {
return res.status(403).json({ error: 'Forbidden' });
}
res.json(audit.rows[0]);
});
// FIXED — authorization first; ETag includes userId; 404 on unauthorized (not 403)
import express from 'express';
import { createHash } from 'crypto';
import { db } from './db.js';
import { verifyToken } from './auth.js';
const app = express();
// Disable Express built-in ETag — we compute our own user-scoped ETags
app.set('etag', false);
app.get('/api/audits/:auditId', async (req, res) => {
res.set('Cache-Control', 'no-store'); // Authenticated endpoint — no CDN caching
// FIXED step 1: authenticate and authorize BEFORE any ETag or cache check
// An unauthenticated or unauthorized requester must never receive 304
const token = req.headers.authorization?.slice(7);
if (!token) return res.status(401).json({ error: 'Unauthorized' });
let userId: string;
try {
({ userId } = verifyToken(token));
} catch {
return res.status(401).json({ error: 'Invalid token' });
}
const audit = await db.query(
'SELECT id, owner_id, findings, updated_at FROM audits WHERE id = $1',
[req.params.auditId]
);
// Return 404 for both "not found" and "not owned" — do not leak existence
// Returning 403 for a resource the user doesn't own reveals it exists
if (!audit.rows[0] || audit.rows[0].owner_id !== userId) {
return res.status(404).json({ error: 'Not found' });
}
// FIXED step 2: include userId in ETag hash
// An ETag from user A's session will never match user B's session
// even if the audit content is identical — different userIds produce different hashes
const etagInput = `${userId}:${audit.rows[0].id}:${audit.rows[0].updated_at.toISOString()}`;
const etag = `"${createHash('sha256').update(etagInput).digest('hex').slice(0, 16)}"`;
res.set('ETag', etag);
// FIXED step 3: ETag check happens AFTER auth — only reaches here if authorized
if (req.headers['if-none-match'] === etag) {
// Safe to return 304 here: requester is authenticated AND owns the resource
return res.sendStatus(304);
}
res.json(audit.rows[0]);
});
If-None-Match before performing authorization — an attacker can send a previously seen ETag for a private resource in a subsequent unauthenticated request and receive 304 Not Modified, revealing that the resource exists even though the requester is unauthorized; fix by including userId in the ETag hash (hash(userId + ':' + content)), performing authorization before any ETag comparison, and returning 404 (not 403) for resources the requester does not own to avoid leaking existence. Detection: SkillAudit flags route handlers that set or check ETag / If-None-Match in a path that precedes the authorization check in the control flow.CACHING2-004 — MCP skill proxy forwards user-supplied cache headers to upstream enabling cache poisoning probe
MCP skills frequently act as proxies: they receive a request from Claude, add authentication headers, and forward the request to an upstream API. If the skill copies all incoming request headers (or the Cache-Control, Pragma, If-None-Match, and If-Modified-Since headers specifically) to the upstream request, an attacker who controls the input to the MCP skill tool can inject cache-directive payloads. The most common attack is a cache poisoning probe: by sending Cache-Control: no-cache in the upstream request, the attacker forces the CDN to revalidate its cache for that URL, then observes whether the CDN's cached response changes. By iterating over different URLs and cache directives, the attacker can map which responses are cached and infer cache TTLs, poisoning opportunities, and the presence of private data at specific URLs.
Beyond probing, forwarding If-None-Match or If-Modified-Since user-supplied values to upstream can trigger the same ETag-based existence disclosure described in CACHING2-003 on the upstream service, even if the upstream service itself is otherwise correct. The fix is straightforward: strip all user-supplied cache-control and conditional headers at the proxy layer and enforce cache policy at the origin. The proxy should construct its upstream request headers explicitly from a known-safe set rather than spreading the incoming headers.
// VULNERABLE — MCP skill proxy forwards all incoming headers to upstream
// including user-controlled cache directives
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { z } from 'zod';
import fetch from 'node-fetch';
const server = new Server({ name: 'skillaudit-proxy', version: '1.0.0' }, {
capabilities: { tools: {} }
});
server.tool(
'fetch_audit_report',
'Fetch a SkillAudit report from the upstream API',
{
reportId: z.string().uuid(),
// VULNERABLE: tool accepts arbitrary headers from Claude/user input
// User controls these values and they are forwarded to upstream
requestHeaders: z.record(z.string()).optional(),
},
async ({ reportId, requestHeaders }) => {
const upstreamUrl = `https://internal-api.skillaudit.dev/reports/${reportId}`;
// VULNERABLE: spreads user-supplied headers into upstream request
// User can inject:
// Cache-Control: no-cache → forces CDN revalidation (cache probe)
// Cache-Control: no-store → poisons cache TTL assumptions
// If-None-Match: "arbitrary" → probes ETag existence
// If-Modified-Since: Thu, 01 Jan 1970 00:00:00 GMT → bypasses conditional caching
// Pragma: no-cache → HTTP/1.0 cache bypass
const response = await fetch(upstreamUrl, {
headers: {
'Authorization': `Bearer ${process.env.INTERNAL_API_KEY}`,
// VULNERABLE: user-supplied headers overwrite or extend safe headers
...requestHeaders,
// Even without explicit requestHeaders param, spreading req object is dangerous:
// 'Cache-Control': req.headers['cache-control'], // ← also vulnerable
},
});
const data = await response.json();
return { content: [{ type: 'text', text: JSON.stringify(data) }] };
}
);
// FIXED — explicit upstream header construction; user-supplied cache headers stripped
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { z } from 'zod';
import fetch from 'node-fetch';
const server = new Server({ name: 'skillaudit-proxy', version: '1.0.0' }, {
capabilities: { tools: {} }
});
// Exhaustive list of headers that must be stripped from any user-influenced source
// before forwarding to upstream. Any conditional or cache-control header belongs here.
const BLOCKED_UPSTREAM_HEADERS = new Set([
'cache-control',
'pragma',
'if-none-match',
'if-modified-since',
'if-match',
'if-unmodified-since',
'if-range',
'age',
'expires',
// Also strip hop-by-hop headers
'connection',
'keep-alive',
'proxy-authenticate',
'proxy-authorization',
'te',
'trailers',
'transfer-encoding',
'upgrade',
]);
server.tool(
'fetch_audit_report',
'Fetch a SkillAudit report from the upstream API',
{
reportId: z.string().uuid(),
// FIXED: removed requestHeaders parameter — users cannot inject headers
// If pass-through headers are needed for legitimate use cases, whitelist them
// explicitly rather than accepting arbitrary header maps
},
async ({ reportId }) => {
const upstreamUrl = `https://internal-api.skillaudit.dev/reports/${reportId}`;
// FIXED: construct upstream headers explicitly — no user input touches these
// The proxy enforces its own cache policy regardless of what Claude or the user sends
const upstreamHeaders: Record<string, string> = {
'Authorization': `Bearer ${process.env.INTERNAL_API_KEY!}`,
'Accept': 'application/json',
'User-Agent': 'SkillAudit-MCP-Proxy/1.0',
// Explicitly set cache directive for upstream — do not rely on absence
// For authenticated proxy requests, no-store is correct at the origin too
'Cache-Control': 'no-store',
};
const response = await fetch(upstreamUrl, {
method: 'GET',
headers: upstreamHeaders,
// FIXED: no spread of any external input into headers
});
if (!response.ok) {
const status = response.status;
// Do not forward raw upstream error details to Claude — they may leak cache state
return {
content: [{
type: 'text',
text: JSON.stringify({ error: 'Upstream request failed', status })
}]
};
}
const data = await response.json();
return { content: [{ type: 'text', text: JSON.stringify(data) }] };
}
);
// If a legitimate use case requires passing some headers from the calling context
// (e.g., Accept-Language for localisation), use an explicit allowlist:
function sanitizePassthroughHeaders(raw: Record<string, string>): Record<string, string> {
const ALLOWED_PASSTHROUGH = new Set(['accept-language', 'x-request-id']);
return Object.fromEntries(
Object.entries(raw)
.filter(([key]) => ALLOWED_PASSTHROUGH.has(key.toLowerCase()))
.map(([k, v]) => [k.toLowerCase(), String(v).slice(0, 256)]) // Bound value length
);
}
Cache-Control, Pragma, If-None-Match, and If-Modified-Since) into upstream fetch requests, allowing an attacker to inject cache directives that force CDN revalidation (cache poisoning probe), bypass origin cache TTLs, or trigger conditional-request responses that leak resource existence on the upstream service; fix by constructing upstream request headers explicitly from a known-safe allowlist, never spreading incoming header objects, and setting Cache-Control: no-store on the outbound proxy request to enforce origin cache policy. Detection: SkillAudit flags MCP skill tool handlers that call fetch() or axios() with a headers object derived from a tool input parameter or from ...req.headers spread.Detection summary
| ID | Severity | Pattern | Fix |
|---|---|---|---|
| CACHING2-001 | HIGH | Authenticated Express endpoint calls res.json() without Cache-Control: no-store — CDN caches user-specific response and serves it to other users |
res.set('Cache-Control', 'no-store') via app.use('/api', ...) middleware before all route handlers |
| CACHING2-002 | MEDIUM | Dynamic Access-Control-Allow-Origin without Vary: Origin — CDN serves wrong CORS header to different origins; custom CORS implementation omits Vary |
Use cors() npm package (sets Vary: Origin automatically) or explicitly call res.set('Vary', 'Origin') on every CORS response |
| CACHING2-003 | MEDIUM | ETag computed from response body without user ID — 304 Not Modified reveals private resource existence to unauthenticated requests; auth check placed after ETag response |
hash(userId + ':' + content) for ETag; authorize before ETag check; return 404 (not 403) for unauthorized resources |
| CACHING2-004 | MEDIUM | MCP skill proxy forwards user-supplied Cache-Control, Pragma, If-None-Match, If-Modified-Since to upstream — enables cache poisoning probe and conditional-request existence disclosure |
Construct upstream headers explicitly; strip all cache and conditional headers; enforce Cache-Control: no-store at proxy layer |
Related patterns: MCP server cache poisoning covers request-smuggling and host-header injection vectors that can be used to poison CDN caches at the reverse-proxy layer — complementary to the application-level CACHING2 patterns here. SA-SKL-CORS9 covers CORS origin validation using regex with subdomain wildcards — a vulnerability closely related to CACHING2-002, where an overly permissive origin validator combined with a missing Vary: Origin header allows a CDN to serve responses cross-origin.