CORS Misconfigurations in MCP Skill Registry Skill Analytics and Usage Metrics Dashboard Endpoints
Analytics dashboard endpoints are the intelligence nerve center of an MCP skill registry: they aggregate every meaningful signal about a skill’s commercial performance into a single document that publishers and administrators consult to make pricing, marketing, and product decisions. The SA-SKL-CORS85 vulnerability class arises when these endpoints are configured with permissive CORS to support multi-origin analytics integrations and embedded dashboard widgets, exposing not only the publisher’s own revenue figures and conversion funnels but also admin-only competitive benchmarking rows that reveal rival skills’ metrics side by side. The compound four-stage attack chain is uniquely targeted in one specific way: the realtime analytics stream timing oracle in step one tells the attacker which publishers are actively watching their dashboards right now, so the attacker knows with high confidence that the victim is online and monitoring during the attack window, maximizing the psychological impact of the resulting data exfiltration, export lockout, and irreversible historical data destruction that follow in steps two, three, and four.
In this post
- Why analytics endpoints are uniquely dangerous CORS targets
- CORS85-003 — Timing oracle via Origin reflection on realtime analytics stream
- CORS85-001 — Credential-bearing CORS on analytics dashboard leaks revenue and competitor benchmarking
- CORS85-002 — Wildcard ACAO on analytics export exhausts quota and triggers lockout
- CORS85-004 — Credential-bearing CORS permanently destroys historical analytics reports
- Compound four-stage analytics dashboard attack chain
- Detection with AST queries
- Summary and 12-point remediation checklist
GET /api/skills/:id/analytics/realtime reflects Origin before auth check; response-time oracle (stream-active warm cache ~2 ms vs cold ~180 ms) reveals which skills have publishers actively watching their analytics dashboards right now — precision targeting that tells the attacker the victim is online and monitoring during the attack windowGET /api/skills/:id/analytics uses cors({origin:true,credentials:true}); any origin reads the full analytics dashboard including daily/monthly active users, revenue metrics, conversion funnels, A/B test results, and admin-only competitive benchmarking rows naming rival skills and comparing their metrics using the victim admin’s session cookiePOST /api/skills/:id/analytics/export has ACAO:*; any page triggers analytics exports under victim admin identity flooding the export queue, exhausting per-skill export quota, and triggering rate-limit lockouts that prevent the legitimate publisher from accessing their own analytics during the attack windowDELETE /api/skills/:id/analytics/:reportId uses cors({origin:true,credentials:true}); any origin permanently deletes the historical analytics reports that publishers rely on for investor due diligence, board presentations, and enterprise SLA compliance verificationWhy analytics endpoints are uniquely dangerous CORS targets
When security engineers audit the CORS configuration of an MCP skill registry, analytical instinct tends to direct attention toward the endpoints with the most obvious security sensitivity: payment processing routes, authentication flows, administrative user management, and content moderation controls. Analytics endpoints occupy a subtly different conceptual category in most reviewers’ mental models. They are associated with read-only observability data — usage counts, geographic distributions, session durations, feature adoption rates — that feels inherently less dangerous than a payment endpoint or a credential store. This mental categorization is a systematic bias that consistently leads to under-protection of analytics infrastructure, and it is precisely the bias that SA-SKL-CORS85 exploits.
The reality of analytics data in a commercial MCP skill registry is that it concentrates four categories of sensitive information whose value to an attacker equals or exceeds the value of most payment or credential data. First, revenue metrics in an analytics dashboard are unredacted commercial intelligence. The daily and monthly revenue figures, conversion rates from free to paid plans, average revenue per user across different publisher tiers, and churn rates are the data that skill publishers use to set their own pricing, evaluate their market position, and decide how aggressively to invest in a skill’s continued development. This data is not disclosed in any public forum; publishers guard it carefully as it represents their competitive intelligence. When an analytics endpoint is configured with credential-bearing CORS, an attacker obtains this data about every skill whose admin they can reach with a cross-origin page, in a single unauthenticated-from-the-attacker’s-perspective request.
Second, admin-only competitive benchmarking rows represent a category of analytics data that most publishers do not even know exists. When a registry operator adds a benchmarking feature to their analytics dashboard, they typically populate it with aggregated metrics from peer skills in the same category to give publishers context about how their skill compares to the market. These benchmarking rows are gated behind admin role checks in the response handler, never displayed to the skill’s own publisher, and intended only for registry administrators conducting market analysis. If the CORS middleware runs before the role check, a credential-bearing cross-origin read of the analytics endpoint returns these admin-only benchmarking rows in the same response as the publisher’s own metrics. The attacker therefore obtains not only the target skill’s revenue figures but also the revenue figures, usage counts, and conversion rates of every rival skill that the registry has included in the benchmarking dataset — data that none of those rivals has consented to disclose to the attacker.
Third, the analytics export system is a shared infrastructure resource that lacks elasticity in the direction that matters. Unlike a read endpoint that can be horizontally scaled to handle traffic spikes, the export system is bounded by an intentional per-skill per-day quota. This quota exists because analytics exports are expensive operations that read across the full historical time-series data, and unbounded export traffic would saturate the analytics database. When the export endpoint uses wildcard ACAO, an attacker can trigger exports under an admin’s identity from any cross-origin page, exhausting the per-skill quota in seconds and triggering rate-limit lockouts that prevent the legitimate publisher from exporting their own analytics for the remainder of the lockout period. The timing of this lockout can be coordinated with the credential-bearing read in step two, so that the publisher discovers the data exfiltration at the same moment they discover they cannot export any data to investigate it.
Fourth, historical analytics reports represent a form of irreplaceable institutional record. Skills that have been operating for months or years accumulate analytics reports that document the history of their user growth, revenue trajectory, and feature adoption. These reports are submitted as evidence in investor due diligence processes, included in board presentations, referenced in enterprise SLA contracts as proof of historical uptime and usage, and used as the benchmark against which any future performance regression is measured. If the analytics report deletion endpoint uses credential-bearing CORS, an attacker can permanently delete every historical report across every skill that an admin has access to in a single page visit. Unless the registry has a soft-delete path with recovery capability, this deletion is irreversible. The destruction is catastrophic not because it immediately harms the skill’s operation but because it eliminates the publisher’s ability to prove their own commercial history.
CORS85-003 — Timing oracle via Origin reflection on realtime analytics stream
The realtime analytics stream endpoint GET /api/skills/:id/analytics/realtime was added to allow publishers to see live usage counts update on their dashboard without polling. The endpoint checks whether the realtime stream worker for a specific skill is currently active — a state that becomes true when a publisher opens their analytics dashboard and the frontend subscribes to the realtime data feed. When a publisher has their dashboard open and the realtime stream is active, the endpoint returns the current stream state from an in-memory cache with a key of the form rt-stream:SKILL_ID:active that is populated at subscription time and expires fifteen minutes after the last subscription heartbeat. The cache hit path returns in approximately 2 milliseconds. When the realtime stream cache is cold — either because no publisher is currently viewing the dashboard, or because the heartbeat has expired — the endpoint performs a cross-service check against the stream worker cluster, which takes approximately 180 milliseconds.
The CORS middleware was placed before the authentication check on this endpoint because the endpoint was initially designed as a client-side health check that would be called from embedded analytics widgets deployed on third-party domains. The authentication check was added later when the team realized the endpoint exposed stream state, but it was inserted after the CORS middleware in the middleware chain rather than before it. This placement means the CORS headers are reflected with Access-Control-Allow-Origin: [requesting origin] and Access-Control-Allow-Credentials: true before the authentication check runs, so the round-trip time for a cross-origin request to this endpoint is fully observable from JavaScript using performance.now() regardless of whether the requesting page is authorized to read the response body.
The timing signal has a 90× ratio between warm (2 ms) and cold (180 ms) paths. This ratio is sufficiently large that it remains detectable even with moderate network jitter: an attacker sampling four requests per skill and taking the minimum round-trip time can distinguish warm from cold with high reliability across any reasonably low-latency network path. The practical implication is that an attacker can enumerate skill IDs and produce a list of all skills whose publishers are currently viewing their analytics dashboards — a targeting signal that is qualitatively different from any other reconnaissance signal available from the CORS85 vulnerability class. The certification timing oracle in SA-SKL-CORS83 reveals which skills are under active review by a reviewer, but reviewers are not the publishers who will discover the attack. The realtime stream timing oracle in CORS85-003 reveals which publishers are currently looking at the data the attacker is about to exfiltrate and destroy, so the attacker can select targets where the discovery is most likely to cause maximum psychological impact during a ransom or manipulation scenario.
// CORS85-003 — VULNERABLE
// CORS reflection runs before authentication check — creates realtime stream timing oracle.
// Attacker page cannot read the response body, but can observe the response time:
// stream-active warm cache: ~2 ms → publisher is currently watching their dashboard
// cold path (stream worker check): ~180 ms → publisher is not currently on the dashboard
// skills/analytics/router.js
const express = require('express');
const cors = require('cors');
const { streamWorkerClient } = require('../services/stream-worker');
const router = express.Router({ mergeParams: true });
// VULNERABLE: cors() runs first — reflects Origin with credentials before any auth
router.get('/:id/analytics/realtime',
cors({ origin: true, credentials: true }),
async (req, res) => {
// requireSession runs AFTER the CORS reflection has already committed the response headers
if (!req.session || !req.session.userId) {
return res.status(401).json({ error: 'Not authenticated' });
// ^ 401 response — but CORS headers already sent; timing oracle already observable
}
const skillId = req.params.id;
// HOT PATH: populated when publisher opens analytics dashboard and
// frontend subscribes to realtime feed. TTL: 15 minutes from last heartbeat.
const streamActive = appCache.get(`rt-stream:${skillId}:active`);
if (streamActive) {
// WARM PATH: ~2 ms — publisher is currently watching their dashboard right now
return res.json({ skillId, streamActive: true, subscriberCount: streamActive.subscriberCount });
}
// COLD PATH: check stream worker cluster — ~180 ms
const workerState = await streamWorkerClient.getStreamState(skillId);
res.json({
skillId,
streamActive: workerState.isActive,
subscriberCount: workerState.subscriberCount ?? 0
});
}
);
// Attacker JavaScript — reveals which publishers are currently watching their dashboards:
// async function probeRealtimeStream(skillId) {
// const TIMING_THRESHOLD_MS = 20;
// const SAMPLES = 4;
// let minRtt = Infinity;
// for (let i = 0; i < SAMPLES; i++) {
// const t0 = performance.now();
// try {
// await fetch(`https://skillaudit.dev/api/skills/${skillId}/analytics/realtime`,
// { credentials: 'include', mode: 'cors' });
// } catch (_) {}
// minRtt = Math.min(minRtt, performance.now() - t0);
// }
// return minRtt < TIMING_THRESHOLD_MS;
// // true → publisher is currently on their dashboard (stream-active cache warm)
// // false → publisher is not currently watching (cold path, stream worker check)
// }
The unique danger of this timing oracle is not that it reveals stream state — it is that it reveals publisher presence. An attacker who knows a publisher is currently watching their dashboard knows the exfiltration and destruction that follow will be discovered in real time, maximizing the opportunity for immediate extortion, psychological pressure, and ransom scenarios. Authentication must run before CORS reflection on any endpoint that exposes a cache state correlated with user presence.
// CORS85-003 — FIXED: auth before CORS; constant-time floor eliminates timing signal
const express = require('express');
const { requireSession } = require('../middleware/auth');
const { applyCorsAllowlist } = require('../middleware/cors');
const { streamWorkerClient } = require('../services/stream-worker');
const router = express.Router({ mergeParams: true });
const REALTIME_RESPONSE_FLOOR_MS = 50;
router.get('/:id/analytics/realtime',
requireSession, // auth BEFORE cors
applyCorsAllowlist, // only allowed origins after auth passes
async (req, res) => {
const start = Date.now();
const skillId = req.params.id;
// requireOwnerOrAdmin check here...
const streamActive = appCache.get(`rt-stream:${skillId}:active`);
const result = streamActive
? { skillId, streamActive: true, subscriberCount: streamActive.subscriberCount }
: await streamWorkerClient.getStreamState(skillId).then(s => ({
skillId, streamActive: s.isActive, subscriberCount: s.subscriberCount ?? 0
}));
// Constant-time floor eliminates warm/cold timing distinction
const elapsed = Date.now() - start;
if (elapsed < REALTIME_RESPONSE_FLOOR_MS) {
await new Promise(r => setTimeout(r, REALTIME_RESPONSE_FLOOR_MS - elapsed));
}
res.json(result);
}
);
CORS85-001 — Credential-bearing CORS on analytics dashboard leaks revenue and competitor benchmarking
The analytics dashboard endpoint GET /api/skills/:id/analytics returns the full analytics document for a skill. For authenticated publishers this document includes their own skill’s daily and monthly active users, session duration distributions, geographic breakdowns, feature adoption rates, conversion funnel metrics showing what percentage of free-tier users upgrade to paid plans, A/B test results showing which variants of the skill’s description and pricing page converted at what rate, and revenue metrics including gross and net revenue per time period. For authenticated administrators the document additionally includes admin-only competitive benchmarking rows that compare the skill’s metrics against aggregated data from peer skills in the same category — data that is sourced from the registry’s internal analytics database and that the peer skills’ publishers have not consented to disclose.
The endpoint uses cors({origin:true,credentials:true}) applied before requireSession in the middleware chain. The rationale, as documented in the original commit message, was to “support embedded analytics widgets on third-party publisher dashboards.” The correct architectural decision for this use case was to issue publisher-scoped API tokens that could be used without a browser session context, and to configure CORS on a separate widget endpoint that returned only the publisher’s own public metrics without admin-only competitive benchmarking. Instead, the full admin analytics endpoint was exposed to credential-bearing cross-origin reads, meaning that any page a logged-in admin visits can read the same analytics data the admin sees when they open their registry dashboard directly.
The admin-only competitive benchmarking rows are the most commercially damaging component of this leak. Each benchmarking row contains the peer skill’s ID, its category, its daily active user count, its monthly revenue in the registry’s currency, its conversion rate from free to paid, and its churn rate over the last 90 days. This data is derived from the same analytics collection that powers each skill’s own dashboard. An attacker who obtains these rows in a single cross-origin request has effectively obtained the revenue and usage intelligence of every skill in the competitive set — intelligence that would take months of competitive research to approximate otherwise, and that in many cases cannot be approximated because the underlying metrics are not disclosed in any public venue.
// CORS85-001 — VULNERABLE
// cors({origin:true,credentials:true}) before requireSession exposes the full
// analytics document including admin-only competitive benchmarking rows to any
// cross-origin page that an authenticated admin visits.
// skills/analytics/handler.js
const express = require('express');
const cors = require('cors');
const { db } = require('../db');
const { requireSession } = require('../middleware/auth');
const router = express.Router();
router.get('/skills/:id/analytics',
cors({ origin: true, credentials: true }), // VULNERABLE: runs before auth
requireSession,
async (req, res) => {
const skillId = req.params.id;
const isAdmin = req.session.roles.includes('registry_admin');
const analytics = await db.getSkillAnalytics(skillId, {
includeRevenueMetrics: true,
includeConversionFunnels: true,
includeABTestResults: true,
includeCompetitorBenchmarking: isAdmin, // admin-only rows — but CORS already reflected
includeAdminOnlyMetrics: isAdmin
});
res.json(analytics);
}
);
module.exports = router;
Admin-only competitive benchmarking rows contain the revenue and usage metrics of every rival skill in the category. None of those skills’ publishers consented to disclose their data to the attacker. When CORS is configured with origin:true,credentials:true before the auth check, a single page visit by one admin hands this dataset to any attacker who can get that admin to load a malicious page. Admin-only fields must be served from a separately authenticated endpoint that is never reachable from the same CORS configuration as the publisher-facing analytics read.
// CORS85-001 — FIXED
// 1. Auth before CORS; CORS restricted to explicit allowlist.
// 2. Admin-only competitive benchmarking moved to separate endpoint with admin role gate.
// 3. Publisher endpoint returns only the requesting skill's own metrics.
const express = require('express');
const { db } = require('../db');
const { requireSession, requireSkillOwnerOrAdmin, requireAdminRole } = require('../middleware/auth');
const { applyCorsAllowlist } = require('../middleware/cors');
const router = express.Router();
// Publisher endpoint — own metrics only, no competitor benchmarking
router.get('/skills/:id/analytics',
requireSession, // auth BEFORE cors
requireSkillOwnerOrAdmin,
applyCorsAllowlist, // allowlist only after auth
async (req, res) => {
const analytics = await db.getSkillAnalytics(req.params.id, {
includeRevenueMetrics: true,
includeConversionFunnels: true,
includeABTestResults: true,
includeCompetitorBenchmarking: false, // never on publisher endpoint
includeAdminOnlyMetrics: false
});
res.json(analytics);
}
);
// Admin-only endpoint — requires explicit admin role, not reachable via publisher CORS config
router.get('/admin/skills/:id/analytics/benchmarking',
requireSession,
requireAdminRole, // hard admin gate — not just an isAdmin flag checked after CORS
async (req, res) => {
const benchmarking = await db.getSkillCompetitorBenchmarking(req.params.id);
res.json(benchmarking);
}
);
module.exports = router;
CORS85-002 — Wildcard ACAO on analytics export exhausts quota and triggers lockout
The analytics export endpoint POST /api/skills/:id/analytics/export was added to allow publishers to download their full analytics history as a CSV or JSON file for offline analysis. Because the export is an expensive operation that reads across the entire historical time-series analytics database for a skill, the endpoint is protected by a rate-limiting layer that enforces a quota of two export requests per skill per 24-hour window. When this quota is exhausted, the endpoint returns a 429 response with a Retry-After header indicating when the quota resets, and no further exports can be triggered until the reset.
The export endpoint uses Access-Control-Allow-Origin: * without a Access-Control-Allow-Credentials header. At first glance this appears safer than credential-bearing CORS because the browser will not attach the victim admin’s session cookies to a cross-origin request to an endpoint that returns ACAO: *. The critical implementation detail that makes this configuration exploitable is that the registry’s analytics export system uses a persistent background session that is initiated by the authenticated user when they first land on the analytics dashboard, and the background session token is stored in a readable first-party cookie that the export endpoint accepts as an alternative to the main session cookie. When an admin opens their analytics dashboard, the frontend creates this background session token and stores it. When a cross-origin request is made to the export endpoint with ACAO: *, the browser does not attach the main session cookie, but the first-party background session cookie is attached because the export endpoint is on the same origin as the cookie, and the browser only blocks third-party cookie attachment when ACAO: * is in use — first-party cookies on the registry domain are still attached as the request is to that same domain.
An attacker who loads a malicious page that an admin visits can therefore trigger analytics exports under the admin’s background session identity even with ACAO: *. Because the quota window is 24 hours, two export requests are sufficient to exhaust the quota for a skill and prevent any legitimate export for the following 24 hours. If the attacker targets multiple skills simultaneously, they can trigger the lockout across the entire portfolio of skills that the admin has access to in a single page visit. The lockout is particularly damaging when it is synchronized with the credential-bearing CORS analytics read in CORS85-001: the attacker reads the publisher’s revenue data and competitor benchmarking, then immediately exhausts the export quota so the publisher cannot download the same data to investigate what was read.
// CORS85-002 — VULNERABLE
// ACAO:* does not prevent cross-origin exploitation when the endpoint accepts
// a background session cookie that is a same-origin first-party cookie.
// Attacker can exhaust the 2/day export quota per skill from any page the admin visits.
// skills/analytics/export.js
const express = require('express');
const { db } = require('../db');
const { rateLimit } = require('../middleware/rate-limit');
const { requireBackgroundSession } = require('../middleware/auth');
const router = express.Router();
router.post('/skills/:id/analytics/export',
(req, res, next) => {
// VULNERABLE: wildcard ACAO — appears safe but background session cookie is still sent
res.setHeader('Access-Control-Allow-Origin', '*');
next();
},
requireBackgroundSession, // accepts the background analytics session cookie
rateLimit({ max: 2, windowMs: 24 * 60 * 60 * 1000, keyFn: req => req.params.id }),
async (req, res) => {
const { format = 'csv', startDate, endDate } = req.body;
const exportJob = await db.queueAnalyticsExport(req.params.id, { format, startDate, endDate });
res.json({ jobId: exportJob.id, estimatedCompletionMs: exportJob.estimatedMs });
}
);
module.exports = router;
Wildcard ACAO does not prevent cross-origin attacks when the endpoint accepts session tokens from same-origin cookies. First-party cookies on the registry domain are attached by the browser to same-origin requests regardless of the CORS configuration. The correct fix is to require an explicit CSRF token on all state-mutating endpoints, to restrict CORS to an explicit allowlist of publisher dashboard domains, and to never accept background session tokens that bypass CSRF protection.
// CORS85-002 — FIXED
// 1. CORS restricted to explicit allowlist — no wildcard.
// 2. CSRF double-submit cookie required on all state-mutating endpoints.
// 3. Export quota per-skill per-owner, not just per-skill, preventing attacker exhaustion.
// 4. requireSkillOwner ensures only the skill's publisher can trigger an export.
const express = require('express');
const { db } = require('../db');
const { rateLimit } = require('../middleware/rate-limit');
const { requireSession, requireSkillOwner } = require('../middleware/auth');
const { applyCorsAllowlist } = require('../middleware/cors');
const { requireCsrfToken } = require('../middleware/csrf');
const router = express.Router();
router.post('/skills/:id/analytics/export',
requireSession,
requireSkillOwner, // only skill owner can export their own analytics
applyCorsAllowlist, // explicit allowlist — no wildcard
requireCsrfToken, // CSRF double-submit cookie — blocks cross-origin POST
rateLimit({
max: 2,
windowMs: 24 * 60 * 60 * 1000,
// Key includes both skillId AND ownerId — attacker cannot exhaust publisher's quota
keyFn: req => `${req.params.id}:${req.session.userId}`
}),
async (req, res) => {
const { format = 'csv', startDate, endDate } = req.body;
const exportJob = await db.queueAnalyticsExport(req.params.id, {
format, startDate, endDate, requestedBy: req.session.userId
});
res.json({ jobId: exportJob.id, estimatedCompletionMs: exportJob.estimatedMs });
}
);
CORS85-004 — Credential-bearing CORS permanently destroys historical analytics reports
Historical analytics reports are distinct from the realtime analytics data stream: they are periodic aggregations generated daily, weekly, and monthly by a background job that reads the full analytics time series, computes summary statistics, and stores them as immutable report documents. These reports are the official record of a skill’s performance over time. Publishers attach them to investor data rooms as evidence of user growth and revenue trajectory. Enterprise customers reference specific report dates in SLA contracts as the baseline against which performance commitments are measured. Board presentations cite specific quarterly report figures. The reports constitute institutional memory that cannot be reconstructed after deletion because the underlying time-series analytics data is retained for only 90 days while reports are retained indefinitely.
The analytics report deletion endpoint DELETE /api/skills/:id/analytics/:reportId was designed as an administrative cleanup tool to remove accidentally generated duplicate reports. It uses cors({origin:true,credentials:true}) applied before authentication, following the same pattern as the analytics dashboard read endpoint. Because the deletion is designed as a rare, deliberate administrative act, no soft-delete path was implemented: the DELETE endpoint immediately removes the report record from the database and from the archive storage bucket. There is no recycle bin, no recovery window, and no audit log that could be used to reconstruct what was deleted.
An attacker who obtains a victim admin’s session via a cross-origin read of the analytics dashboard endpoint (CORS85-001) can enumerate all report IDs from the dashboard response, then trigger deletion requests for each report ID in a tight loop. The deletions execute synchronously, complete in milliseconds, and produce no observable side effect to the publisher until they attempt to open a historical report and find it missing. By the time the publisher discovers the deletion, the attacker has long since closed the malicious page, and the registry has no audit log entry that would identify which origin triggered the deletions. The destruction is permanent unless the registry has a separate backup of the archive storage bucket that predates the deletion, which most implementations do not have for analytics reports specifically.
// CORS85-004 — VULNERABLE
// cors({origin:true,credentials:true}) before requireSession allows any page an
// authenticated admin visits to permanently delete all historical analytics reports
// for every skill in the admin's access scope.
// skills/analytics/reports.js
const express = require('express');
const cors = require('cors');
const { db } = require('../db');
const { storage } = require('../services/storage');
const { requireSession } = require('../middleware/auth');
const router = express.Router();
router.delete('/skills/:id/analytics/:reportId',
cors({ origin: true, credentials: true }), // VULNERABLE: credential-bearing CORS before auth
requireSession,
async (req, res) => {
const { id: skillId, reportId } = req.params;
// Hard delete — no soft-delete path, no recycle bin, no audit log
await db.analyticsReports.delete({ skillId, reportId });
await storage.archiveBucket.deleteObject(`analytics/${skillId}/reports/${reportId}`);
res.json({ deleted: true, reportId });
}
);
module.exports = router;
Permanent deletion of irreplaceable institutional records via CORS is the highest-impact single request in the CORS85 vulnerability class. A publisher who loses their historical analytics reports cannot reconstruct them after the 90-day raw data retention window, and the downstream consequences for investor due diligence, enterprise SLA compliance, and board reporting are severe. Soft-delete with a 90-day retention window must be implemented before any deletion endpoint is exposed, and credential-bearing CORS must never be applied to delete endpoints.
// CORS85-004 — FIXED
// 1. Auth before CORS; CORS restricted to allowlist.
// 2. Re-authentication required for destructive operations on analytics reports.
// 3. Soft-delete with 90-day recovery window replaces hard delete.
// 4. Audit log records deletion event with requesting origin, session, and timestamp.
// 5. requireSkillOwnerOrAdmin enforces ownership before delete is permitted.
const express = require('express');
const { db } = require('../db');
const { storage } = require('../services/storage');
const { requireSession, requireSkillOwnerOrAdmin, requireReAuth } = require('../middleware/auth');
const { applyCorsAllowlist } = require('../middleware/cors');
const { auditLog } = require('../services/audit');
const router = express.Router();
router.delete('/skills/:id/analytics/:reportId',
requireSession, // auth BEFORE cors
requireSkillOwnerOrAdmin, // ownership check
applyCorsAllowlist, // allowlist after auth
requireReAuth({ maxAgeSeconds: 300 }), // re-auth for destructive operations
async (req, res) => {
const { id: skillId, reportId } = req.params;
// Soft-delete: mark deleted_at, retain for 90 days, storage object preserved
await db.analyticsReports.softDelete({
skillId,
reportId,
deletedBy: req.session.userId,
deletedAt: new Date(),
recoveryWindowDays: 90
});
await auditLog.write({
event: 'analytics_report_soft_deleted',
skillId, reportId,
actor: req.session.userId,
requestOrigin: req.get('Origin'),
sessionId: req.session.id,
timestamp: new Date()
});
res.json({ deleted: true, reportId, recoveryWindowDays: 90 });
}
);
Compound four-stage analytics dashboard attack chain
The four findings in SA-SKL-CORS85 compose into a targeted attack chain that is qualitatively different from the individual findings in isolation. The targeting precision of the timing oracle in step one changes the character of the entire chain: whereas most CORS-based attacks must accept a degree of uncertainty about the victim’s state at the time of execution, the CORS85 compound chain knows with high confidence that the targeted publisher is currently monitoring their own analytics dashboard before the exfiltration and destruction begin. This knowledge is not merely a tactical convenience. It enables a ransom or manipulation scenario where the attacker demonstrates in real time that they have read and destroyed data that the publisher is visibly monitoring, maximizing the psychological impact of the attack and the publisher’s sense of immediate urgency.
| # | Finding | What the attacker obtains | Irreversible? |
|---|---|---|---|
| 1 | CORS85-003 timing oracle | List of skills whose publishers are currently watching their dashboards (targeting precision, publisher is online) | No — reconnaissance only |
| 2 | CORS85-001 credential-bearing read | Full analytics dashboard: revenue metrics, conversion funnels, A/B test results, admin-only competitor benchmarking rows | No — data copied, not destroyed |
| 3 | CORS85-002 wildcard ACAO export flood | Exhausts per-skill export quota; publisher cannot export their own analytics to investigate the breach during the lockout window | No — resets after 24 hours |
| 4 | CORS85-004 credential-bearing delete | Permanent deletion of all historical analytics reports; investor data room, board presentations, and enterprise SLA evidence destroyed | Yes — no recovery path |
The compound chain executes fully within the lifecycle of a single page visit from one admin. The attacker hosts a page that fires four distinct cross-origin request sequences in tight succession. The timing oracle probes are fire-and-forget requests that require no response body access. The credential-bearing analytics read requires body access and therefore must be on a same-origin iframe or fetch with mode: 'cors' from an origin that the CORS misconfiguration will reflect. The export flood can be executed as a series of parallel fetch calls that each exhaust one slot of the per-skill quota. The deletion sequence iterates the report IDs obtained from the analytics read and fires one DELETE request per report ID. The entire sequence from first probe to last deletion takes under two seconds in a typical implementation.
GET /api/skills/:id/analytics with credentials: 'include' from a reflected-origin page. Response includes revenue figures, conversion rates, A/B test results, and admin-only competitor benchmarking rows naming rival skills with their own revenue and usage metrics. Exfiltrate full analytics documents to attacker-controlled storage./api/skills/:id/analytics/export. Because the export quota is per-skill-per-day and not per-skill-per-owner, two requests exhaust the quota immediately regardless of whether the legitimate publisher has already used any quota today. Publisher cannot export their analytics for investigation during the 24-hour lockout window./api/skills/:id/analytics/:reportId with credentials. Reports are hard-deleted immediately with no recovery path. By the time the publisher refreshes their dashboard (they are currently watching), all historical reports are permanently gone.The sequence is designed so that the irreversible operation (step 4) executes last, after the reversible intelligence-gathering operations have completed. This ordering ensures that if the attacker is interrupted after step 2 or step 3, the exfiltration has already succeeded even if the destruction has not. If all four steps complete, the attacker holds the publisher’s revenue data and competitor benchmarking, the publisher cannot export their data to investigate the breach, and the historical reports that would have been the evidence base for investor due diligence and enterprise SLA compliance are permanently gone. The publisher discovers all of this in real time because step 1 confirmed they are currently watching their dashboard.
Detection with AST queries
All four CORS85 patterns are detectable at the AST level using static analysis queries that look for specific structural signatures in the Express middleware chain. SkillAudit’s security scanner runs these queries against every version of every registered skill’s server-side code and flags any match for immediate remediation review.
Query class A — Credential-bearing CORS before authentication (CORS85-001, CORS85-004): Find any router.get() or router.delete() call where the argument list contains a cors({origin:true,credentials:true}) call expression at an earlier position than any middleware call whose callee name matches /requireSession|requireAuth|authenticate/i. Any match is a CRITICAL finding. The credential-bearing CORS pattern is unambiguous at the AST level because it requires both origin: true and credentials: true simultaneously.
Query class B — Wildcard ACAO on state-mutating endpoints (CORS85-002): Find any router.post(), router.put(), router.patch(), or router.delete() call where any middleware in the argument list calls res.setHeader('Access-Control-Allow-Origin', '*') or where a cors() call with no arguments or with {origin: '*'} appears in the argument list. Flag as HIGH. Cross-reference with the endpoint’s authentication middleware to confirm the endpoint accepts a session token of any kind.
Query class C — CORS reflection before auth on GET endpoints (CORS85-003): Find any router.get() call where cors({origin:true}) or cors({origin:true,credentials:true}) appears before any middleware whose callee name matches /requireSession|requireAuth|authenticate/i. Cross-reference with the route handler body to identify any in-memory cache read with a cache key that encodes user presence or activity state. Any match is a MEDIUM finding that may compose with credential-bearing reads upstream to form a targeted compound chain.
Summary and 12-point remediation checklist
SA-SKL-CORS85 demonstrates that analytics infrastructure is not an afterthought in the CORS security model of an MCP skill registry — it is one of the most dangerous places a CORS misconfiguration can live, because analytics endpoints aggregate the commercial intelligence, competitive benchmarking, and institutional records that have the highest value to an attacker and the most severe non-recoverable impact on the publisher when destroyed. The compound chain is especially damaging because the realtime stream timing oracle gives the attacker targeting precision that most CORS-based attacks lack: the knowledge that the publisher is currently watching creates an opportunity for immediate extortion and psychological pressure during the attack window.
- Authenticate before reflecting CORS headers on every analytics endpoint —
requireSessionmust come before anycors()middleware call in the Express handler chain. - Restrict CORS to an explicit allowlist of publisher dashboard domains — never use
cors({origin:true})orACAO: *on analytics endpoints. - Move admin-only competitive benchmarking to a separate endpoint with an explicit
requireAdminRolegate that is not reachable from the publisher-facing CORS configuration. - Apply a constant-time response floor (minimum 50 ms) to all analytics endpoints that have in-memory cache paths correlated with user presence or realtime stream state.
- Require CSRF double-submit cookie tokens on all state-mutating analytics endpoints including export and deletion.
- Implement per-skill-per-owner export quota rather than per-skill-only quota to prevent an attacker from exhausting a publisher’s export access on behalf of the publisher’s admin identity.
- Replace all hard-delete paths on analytics report endpoints with soft-delete that retains the report record for a minimum 90-day recovery window before permanent archival.
- Implement a mandatory audit log for all analytics deletion operations, recording the requesting origin, session ID, actor user ID, and timestamp in an append-only log that the deletion operation itself cannot modify.
- Require re-authentication (maximum age 5 minutes) before any destructive analytics operation including report deletion and analytics data export.
- Issue publisher-scoped API tokens for embedded analytics widget use cases rather than relying on session cookies with credential-bearing CORS — tokens can be scoped to specific skills and specific metric subsets.
- Run SkillAudit’s AST-level CORS scanner against every new version of every skill’s server-side code to detect credential-bearing CORS, wildcard ACAO, and CORS-before-auth patterns before they reach production.
- Establish a separate analytics archive storage bucket with write-once object lock configured for a minimum 90-day retention period so that analytics reports remain recoverable even if the application-layer deletion path is exploited.
SkillAudit scans for all three CORS85 AST patterns — credential-bearing CORS before auth, wildcard ACAO on state-mutating endpoints, and CORS reflection before auth on cache-correlated GET endpoints — as part of its automated skill security audit. Skills that pass the CORS audit gate receive a verified CORS-safe badge that registry users can rely on when deciding whether to deploy a skill in a context where their own users will be authenticated to the registry. Get on the waitlist to audit your MCP skill registry.