← Blog

CORS Misconfigurations in MCP Skill Registry Skill Analytics and Usage Metrics Endpoints

Analytics endpoints are where the most competitively sensitive operational data in an MCP skill registry lives: daily active user counts, geographic market breakdowns, install-to-active-use conversion funnels, session duration percentiles, and cohort retention curves. For a skill publisher, this data represents months of growth work distilled into a dashboard. For a competitor, it represents the same thing — a roadmap of what is working and what to copy. The four SA-SKL-CORS41 patterns expose how CORS misconfigurations on analytics endpoints chain into a full competitive intelligence exfiltration attack that leaves no trace, then destroys the evidence.

By SkillAudit  |  16 Nov 2026  |  17 min read

In this post

  1. Why analytics endpoints are a CORS blind spot
  2. CORS41-001 — Credential-bearing CORS on analytics dashboard exposes DAU and conversion funnels
  3. CORS41-002 — Wildcard ACAO on export endpoint exhausts analytics quota
  4. CORS41-003 — Timing oracle on funnel endpoint reveals competitive conversion state
  5. CORS41-004 — Credential-bearing CORS on analytics purge destroys billing baseline and forensic evidence
  6. Compound competitive intelligence exfiltration chain
  7. Detection with SkillAudit AST queries
  8. Summary and remediation checklist

Why analytics endpoints are a CORS blind spot

When registry developers think about CORS security, they typically focus on the endpoints that handle write operations: skill publication, permission grants, billing changes. Analytics endpoints look read-only and low-risk. They serve aggregated data about your own skills to your own dashboard. What could go wrong with a CORS misconfiguration on a GET endpoint that shows you your own numbers?

The miscalculation is threefold. First, analytics data is strategically sensitive in ways that feel different from application secrets but are commercially equivalent. Knowing a competitor's DAU trend, geographic distribution, and funnel drop-off points is worth real money — often more than a leaked API key because it informs product strategy rather than just granting access to a single system. Second, analytics endpoints that support export operations have side effects: they consume quota, trigger background jobs, and may send notification emails — none of which are "read-only" in any meaningful operational sense. Third, analytics history is frequently irreversible: time-series data in append-only stores cannot be recovered once deleted, so a CORS-enabled purge leaves a permanent operational wound even if the attacker is discovered immediately after.

CORS misconfigurations on analytics endpoints arise because analytics routers are often built as a secondary feature after the core registry API, using the same broadly-configured cors() middleware that the main router uses, but without the ownership-enforcement middleware that the core API applies consistently. The result is a router that reflects every origin with credentials on every endpoint, including the ones that return competitively sensitive aggregated data or execute irreversible operations.

SA-SKL-CORS41 findings at a glance
CRITICALCORS41-001 — cors({origin:true,credentials:true}) on GET /api/skills/:id/analytics; any origin reads the full analytics dashboard including DAU, geographic breakdown, and conversion funnel using victim session
HIGHCORS41-002 — ACAO: * on POST /api/skills/:id/analytics/export; any page initiates a data export consuming victim org analytics quota; no CSRF or rate-limit protection
MEDIUMCORS41-003 — ACAO origin reflection on GET /api/skills/:id/analytics/funnel emitted before ownership check; timing oracle reveals funnel data existence system-wide
CRITICALCORS41-004 — cors({origin:true,credentials:true}) on DELETE /api/skills/:id/analytics/data; any origin purges full analytics history for any skill using victim admin session

CORS41-001 — Credential-bearing CORS on analytics dashboard exposes DAU and conversion funnels

The analytics dashboard endpoint at GET /api/skills/:id/analytics returns the full operational picture of a published skill: daily and monthly active users broken down by install cohort, geographic region distribution, install-to-first-tool-call conversion rate, session duration percentiles, and the funnel from registry browse to active use. When this endpoint is configured with cors({origin:true,credentials:true}), any origin that can run JavaScript in a browser — a malicious ad, a compromised third-party widget, an attacker's page the victim visits once — can read this data using the victim's session cookie.

The attack does not require any persistent compromise. The attacker creates a page with a simple fetch call to the analytics endpoint using credentials: 'include'. The victim visits the page. The browser sends the victim's session cookie. The server reflects the Origin back as Access-Control-Allow-Origin and sets Access-Control-Allow-Credentials: true. The browser releases the response body to the attacker's JavaScript. The analytics data is exfiltrated to the attacker's server in the same request flow. The victim sees nothing — no prompt, no consent dialog, no network error. Their analytics dashboard continues to show normal numbers.

What makes this particularly damaging for skill publishers operating in a competitive market is that analytics data answers the questions that competitive intelligence analysts ask: Is this skill growing or declining? Which geographic markets are they investing in? Where does their onboarding drop off? How long does the average user spend in an active session? For an enterprise skill publisher whose product roadmap is driven by these numbers, their analytics dashboard is their strategic planning document. Cross-origin read access to it via a session-cookie-bearing CORS misconfiguration is equivalent to handing that document to any attacker who can get the victim to visit a URL.

CORS41-001 fix: Replace cors({origin:true,credentials:true}) with an explicit allowlist limited to your own frontend origins. Add requireSession middleware before CORS middleware in the middleware chain. For public callers, return only the total install count — never DAU, geographic breakdown, conversion funnel, session durations, or cohort data.

WRONG
// Analytics dashboard to any origin via session credential forwarding
router.get('/skills/:id/analytics',
  cors({ origin: true, credentials: true }),  // reflects any origin
  async (req, res) => {
    const data = await analytics.getDashboard(req.params.id);
    // includes: DAU, monthly actives, geo breakdown, funnel, cohorts, session durations
    res.json(data);
  }
);
RIGHT
const ALLOWED_ORIGINS = new Set([
  'https://skillaudit.dev',
  'https://app.skillaudit.dev'
]);

function strictCors(req, res, next) {
  const origin = req.headers.origin;
  if (origin && ALLOWED_ORIGINS.has(origin)) {
    res.setHeader('Access-Control-Allow-Origin', origin);
    res.setHeader('Access-Control-Allow-Credentials', 'true');
    res.setHeader('Vary', 'Origin');
  }
  next();
}

router.get('/skills/:id/analytics',
  requireSession,          // auth before CORS headers are emitted
  strictCors,
  async (req, res) => {
    const isOwner = await db.isSkillOwner(req.params.id, req.session.orgId);
    if (!isOwner) {
      // public callers: install count only, no analytics intelligence
      const installs = await analytics.getPublicInstallCount(req.params.id);
      return res.json({ installs });
    }
    const data = await analytics.getDashboard(req.params.id);
    res.json(data);
  }
);

CORS41-002 — Wildcard ACAO on export endpoint exhausts analytics quota

The analytics export endpoint POST /api/skills/:id/analytics/export initiates an asynchronous background job that bundles the full analytics dataset — raw event logs, aggregated timeseries, cohort tables — into a CSV or JSON archive and queues it for download. Each export job consumes a quota allocation from the requesting organization's monthly export budget, which registries typically cap to prevent abuse of the storage pipeline and data warehouse sync costs. When this endpoint is configured with ACAO: *, any page can submit export requests using any user's Bearer token obtained via XSS, any page they are currently authenticated on, or any storage-access API that leaks the token.

Export quota exhaustion has a concrete operational impact that organizations discover only when their legitimate workflows fail. Many skill registries are integrated with data warehouse pipelines: a nightly Airflow DAG pulls analytics exports to Snowflake or BigQuery, a compliance reporting workflow exports usage data monthly for SOC 2 audit evidence, a billing reconciliation system exports active-seat counts for invoice generation. When the export quota is consumed by an attacker at the start of the month, all of these workflows fail until the quota resets. For organizations under compliance obligations, missing the monthly analytics export is a documentation gap. For organizations with usage-based billing tiers, missing the active-seat export is a billing calculation failure.

The absence of a CSRF token compounds the exposure. A ACAO: * response means Access-Control-Allow-Credentials is never true (the two cannot coexist per the CORS specification), so the attack does not use cookie credentials — it uses Bearer tokens. Any XSS vulnerability in the registry's frontend, or any third-party page that can read the token from localStorage, can submit export requests that deplete quota silently. No session cookie is required; no cross-site cookie protection applies.

CORS41-002 fix: Remove the wildcard ACAO: * entirely. Require session authentication. Add a CSRF token for mutation operations. Implement per-org export rate limiting that refuses new jobs when the monthly quota ceiling is approached. Export jobs initiated by CI/CD pipelines should use scoped API keys, not user session credentials, and should be authenticated against the API key's org, not the requesting user's session.

// WRONG — wildcard ACAO on export; anyone with a Bearer token can exhaust quota
router.post('/skills/:id/analytics/export',
  cors({ origin: '*' }),    // ACAO: * — credentials:true impossible but Bearer still usable via XSS
  async (req, res) => {
    const job = await exportQueue.enqueue({ skillId: req.params.id, format: req.body.format });
    res.json({ jobId: job.id });
  }
);

// RIGHT — allowlist + session + CSRF + per-org rate limit
router.post('/skills/:id/analytics/export',
  requireSession,
  strictCors,
  verifyCsrfToken,
  async (req, res) => {
    const orgId = req.session.orgId;
    const isOwner = await db.isSkillOwner(req.params.id, orgId);
    if (!isOwner) return res.status(403).json({ error: 'forbidden' });

    const quota = await exportQuota.check(orgId);
    if (!quota.remaining) return res.status(429).json({ error: 'monthly export quota exhausted', resetsAt: quota.resetsAt });

    const job = await exportQueue.enqueue({ skillId: req.params.id, format: req.body.format, orgId });
    await exportQuota.consume(orgId);
    res.json({ jobId: job.id });
  }
);

CORS41-003 — Timing oracle on funnel endpoint reveals competitive conversion state

The funnel analytics endpoint GET /api/skills/:id/analytics/funnel exhibits an ordering problem: the CORS middleware that reflects the Origin header runs before the ownership check that verifies whether the requesting user is authorized to see funnel data for the specified skill. This ordering produces a timing oracle with a measurable two-class signal.

When a skill has funnel data and the requesting user is not its owner, the server executes CORS header emission, then queries the funnel_events table (a potentially large time-series join across install, active_use, and tool_call event types), discovers the ownership mismatch, and returns 403. When no funnel data exists or the skill ID is not found, the server emits CORS headers and returns 404 immediately without the database join. The difference in response latency is on the order of tens to hundreds of milliseconds — well within the measurement precision of performance.now() in modern browsers, which is accessible from JavaScript on any cross-origin page that receives the preflight response.

An attacker uses this oracle to enumerate which skills across the entire registry have active conversion funnels. Because the funnel data only accumulates for skills with active users, a positive oracle signal (403 latency rather than 404 latency) indicates the skill has real user engagement. Combined with the public install count available even without credentials, this gives a cross-org picture of which skills are growing versus stagnant — market reconnaissance that requires no credentials and leaves no log entries pointing to the attacker's true intent (every request looks like a failed ownership check).

The practical value of this oracle for a competitor depends on the registry's total skill count. In a registry with hundreds or thousands of published skills, manually identifying which ones have active funnels is infeasible. The timing oracle automates this into a scan that runs in a few minutes, produces a ranked list of "skills with real users," and feeds directly into a competitive intelligence workflow that uses CORS41-001 to then read the full funnel data for each identified target.

CORS41-003 fix: Move CORS middleware after authentication and ownership enforcement. Unify the WHERE clause to include both skillId and orgId in a single query so the database execution time is consistent regardless of whether funnel data exists. Apply a minimum-latency strategy (a small fixed sleep before response) to normalize timing across the 403 and 404 paths. Never emit the Access-Control-Allow-Origin header for requests that fail authorization.

// WRONG — CORS emitted before ownership check; timing oracle leaks funnel existence
router.get('/skills/:id/analytics/funnel',
  cors({ origin: true, credentials: true }),  // CORS before auth
  async (req, res) => {
    const isOwner = await db.isSkillOwner(req.params.id, req.session?.userId);
    if (!isOwner) return res.status(403).json({ error: 'forbidden' }); // 403 path is slower
    const funnel = await analytics.getFunnel(req.params.id);
    res.json(funnel);
  }
);

// RIGHT — auth and ownership before CORS; unified query; timing normalization
router.get('/skills/:id/analytics/funnel',
  requireSession,
  async (req, res) => {
    const start = Date.now();
    // Single query enforces both skillId and orgId — no timing difference between
    // "no funnel data" and "funnel data exists but wrong owner"
    const funnel = await db.query(
      'SELECT * FROM funnel_events WHERE skill_id = ? AND org_id = ? ORDER BY recorded_at DESC',
      [req.params.id, req.session.orgId]
    );
    // Apply CORS only after auth/ownership is confirmed
    const origin = req.headers.origin;
    if (origin && ALLOWED_ORIGINS.has(origin)) {
      res.setHeader('Access-Control-Allow-Origin', origin);
      res.setHeader('Access-Control-Allow-Credentials', 'true');
    }
    if (!funnel.length) {
      await minLatency(start, 50); // normalize to ≥50ms regardless of query speed
      return res.status(404).json({ error: 'not found' });
    }
    res.json(funnel);
  }
);

CORS41-004 — Credential-bearing CORS on analytics purge destroys billing baseline and forensic evidence

The analytics data purge endpoint DELETE /api/skills/:id/analytics/data uses cors({origin:true,credentials:true}). An attacker who tricks an org admin into visiting a malicious page — a phishing email, a compromised analytics tool embed, a poisoned npm package documentation page — can silently delete the entire analytics history for any skill in the organization. The victim admin sees nothing at the time of attack. The discovery typically comes days or weeks later when analytics dashboards show no historical data, billing calculations produce unexpected results, or a compliance audit requests usage records that no longer exist.

The CORS41-004 impact is categorically different from the exfiltration patterns in CORS41-001 through CORS41-003 because it is irreversible. Analytics event data in production registries is typically stored in append-only time-series databases (ClickHouse, TimescaleDB, BigQuery streaming inserts) or data warehouses where a DELETE operation permanently removes rows with no recovery path short of restoring from a backup — if a backup was taken, if it has not aged out, and if the registry operator notices the deletion before the backup rotation window closes.

Three specific impacts compound beyond the obvious loss of business intelligence. First, billing baseline destruction: registries that charge on active-seat or usage-based metrics rely on historical analytics to dispute billing anomalies and to audit invoice accuracy. When the analytics history is purged, the billing period cannot be reconstructed, and usage disputes default to the registry's own records. Second, forensic evidence loss: when a security incident occurs (a compromised skill, an injected tool call, an unauthorized permission grant), the analytics event log is the first place investigators look for indicators of compromise — anomalous tool call patterns, geographic anomalies, session duration outliers. Purging this log before the incident is discovered eliminates the investigation trail. Third, compliance obligation violation: organizations under SOC 2, ISO 27001, or sector-specific frameworks with logging retention requirements face an audit finding when usage records they are required to retain are deleted.

CORS41-004 fix: Replace credential-bearing CORS with an explicit allowlist. Add requireRole('admin') and skill ownership verification. Implement soft-delete with a mandatory 90-day retention window before physical deletion. Emit an append-only audit log entry before the soft-delete is applied. Require a secondary confirmation token sent via email to the account owner before the purge can execute — this breaks the single-visit cross-origin attack since the attacker cannot intercept the email confirmation. Never hard-delete analytics data in response to a single HTTP request.

WRONG
// Hard analytics purge with credential-bearing CORS — single cross-origin DELETE destroys months of data
router.delete('/skills/:id/analytics/data',
  cors({ origin: true, credentials: true }),
  async (req, res) => {
    await db.query('DELETE FROM analytics_events WHERE skill_id = ?', [req.params.id]);
    res.json({ ok: true });
  }
);
RIGHT
router.delete('/skills/:id/analytics/data',
  requireSession,
  requireRole('admin'),     // must be org admin
  strictCors,               // allowlist only
  async (req, res) => {
    const skill = await db.getSkill(req.params.id);
    if (!skill || skill.orgId !== req.session.orgId) {
      return res.status(403).json({ error: 'forbidden' });
    }

    // Require a time-bound confirmation token sent to the account owner's email
    const { confirmToken } = req.body;
    const valid = await tokens.verifyPurgeToken(req.session.userId, req.params.id, confirmToken);
    if (!valid) return res.status(403).json({ error: 'invalid or expired confirmation token' });

    // Soft-delete: schedule for physical deletion after 90-day retention window
    await db.query(
      `UPDATE analytics_events
       SET deletion_scheduled_at = NOW(),
           deletion_scheduled_by = ?
       WHERE skill_id = ?
         AND deletion_scheduled_at IS NULL`,
      [req.session.userId, req.params.id]
    );

    // Append-only audit log — cannot be modified or deleted by application-level calls
    await audit.log('analytics_purge_scheduled', {
      skillId: req.params.id,
      orgId: req.session.orgId,
      scheduledBy: req.session.userId,
      retentionWindowDays: 90,
      physicalDeletionAfter: new Date(Date.now() + 90 * 86400 * 1000).toISOString()
    });

    res.json({
      ok: true,
      message: 'Analytics history scheduled for deletion after 90-day retention window',
      physicalDeletionAfter: new Date(Date.now() + 90 * 86400 * 1000).toISOString()
    });
  }
);

Compound competitive intelligence exfiltration chain

Each of the four CORS41 patterns is dangerous in isolation, but they are designed to chain into a compound attack that an attacker with a competitor's motivation executes in a single browser session. The victim needs to visit only one malicious page. All four stages complete before the victim closes the tab.

Stage 1 — Market reconnaissance via funnel oracle (CORS41-003, no credentials needed). The attacker's page iterates through known or guessed skill IDs in the registry, sending requests to the funnel endpoint and measuring response latency. Skills with active conversion funnels produce measurably slower 403 responses. After 30 seconds of enumeration, the attacker has a ranked list of skills with real user engagement — the competitive targets worth exfiltrating intelligence from.

Stage 2 — Competitive intelligence exfiltration (CORS41-001, requires victim session). For each skill identified in Stage 1, the attacker uses the credential-bearing CORS on the analytics dashboard endpoint to read the full analytics package: DAU trend over the past 90 days, geographic distribution, install-to-active conversion rate, session duration percentiles, funnel drop-off stages. This data is sent to the attacker's collection server via a background fetch. For a competitor doing product planning, this is 90 days of validated market intelligence delivered in seconds.

Stage 3 — Export quota exhaustion (CORS41-002, requires Bearer token or XSS). If the attacker has a Bearer token (harvested via XSS on a previous visit to the registry frontend), they submit export jobs for all of the victim's skills simultaneously. When the victim's analytics team attempts their monthly compliance export or data warehouse sync the following morning, the quota is exhausted. The legitimate export fails. The compliance audit is missing data. The billing reconciliation cannot run. This stage converts the intelligence-gathering attack into an operational disruption that occupies the victim's attention while the attacker uses the exfiltrated intelligence.

Stage 4 — Forensic evidence destruction (CORS41-004, requires victim admin session). If the victim is an org admin (which is likely for a skill publisher visiting the registry's admin interface), the attacker uses the credential-bearing CORS on the purge endpoint to submit a deletion request. If the endpoint lacks a confirmation token requirement, the deletion executes immediately. The analytics history that would reveal the intelligence exfiltration in Stage 2 — anomalous cross-origin read patterns, sudden spike in funnel queries from unusual origins — is now gone. The victim has no log to investigate. The attacker's reconnaissance is complete and covered.

The elegance of this chain is that each stage serves both the attacker's immediate goal and sets up the next stage. The funnel oracle (Stage 1) identifies valuable targets without requiring credentials, so the attacker knows which skills are worth targeting before triggering the credential-dependent exfiltration. The quota exhaustion (Stage 3) creates operational disruption that serves as cover and noise. The purge (Stage 4) closes the evidence loop. A defender who discovers the attack through billing anomalies or a user complaint will find that the analytics history needed to understand what happened was deleted as the final step of the attack.

Detection with SkillAudit AST queries

SkillAudit's static analysis engine detects all four CORS41 patterns through three classes of AST query applied across your skill registry codebase.

Class 1: Credential-bearing CORS on sensitive endpoints. SkillAudit identifies middleware chains where cors({origin:true}) or cors({origin: (origin, cb) => cb(null, true)}) appears before an endpoint handler on routes matching analytics read or mutation patterns. The query flags any CORS configuration that reflects the Origin unconditionally, regardless of whether credentials:true is explicit (some frameworks apply credential forwarding by default when Origin is reflected).

Class 2: Wildcard ACAO on mutation endpoints. SkillAudit scans for cors({ origin: '*' }) on router.post, router.put, router.patch, and router.delete handler registrations. This catches CORS41-002's pattern of using a wildcard on an export-triggering POST endpoint, as well as analogous patterns on other mutation routes across the analytics, billing, and permissions sub-routers.

Class 3: Middleware ordering oracle pattern. SkillAudit detects when CORS middleware appears before requireSession, requireAuth, or any middleware matching common authentication guard naming patterns in Express, Fastify, Koa, and Hapi router registration chains. This catches CORS41-003's ordering problem across all route types, not just analytics funnel endpoints — the same ordering anti-pattern appears in version, changelog, billing, and permission sub-routers that were built quickly without consistent middleware ordering discipline.

Detect SA-SKL-CORS41 in your registry

SkillAudit scans for credential-bearing CORS reflection on analytics endpoints, wildcard ACAO on export operations, and middleware ordering that emits CORS headers before auth checks — across all sub-routers in your MCP skill registry codebase. Paste your GitHub URL for a graded report in 60 seconds.

Scan your registry

Summary and remediation checklist

FindingSeverityRoot causeKey fix
CORS41-001CRITICALcors({origin:true,credentials:true}) on analytics dashboardAllowlist + requireSession before CORS; public callers get install count only
CORS41-002HIGHACAO: * on analytics export POST endpointRemove wildcard; session + CSRF + per-org quota enforcement
CORS41-003MEDIUMCORS emitted before ownership check creates timing oracleAuth before CORS; unified WHERE clause; minimum-latency normalization
CORS41-004CRITICALcors({origin:true,credentials:true}) on analytics purge DELETEAllowlist + requireRole('admin') + email confirm token + 90-day soft-delete

The common thread across all four findings is a failure to treat analytics endpoints with the same CORS discipline applied to the core registry API. Analytics routers inherit broadly-configured CORS middleware and add less-consistent ownership enforcement, producing the conditions for credential-bearing reads, quota exhaustion, timing oracles, and irreversible destruction via a single cross-origin request.

See also: SA-SKL-CORS41 advisory page for the technical findings summary, SA-SKL-CORS42 for the companion CORS patterns in permission and ACL endpoints, and SA-SKL-CORS39 blog post for the compound pre-disclosure chain that credential-bearing CORS enables across version and changelog endpoints.