← Security advisories

Claude MCP skill CORS misconfiguration — skill search discovery and indexing endpoints — SA-SKL-CORS48

SA-SKL-CORS48 documents four CORS misconfiguration patterns in MCP skill registry search discovery and indexing endpoints. These endpoints govern how skills are found, surfaced, and ranked: reading the full search index including visibility-restricted skills, triggering reindexation that influences search rankings, querying per-skill search analytics, and removing skills from the index entirely. Credential-bearing CORS on the search endpoint exposes unlisted skills, private org skills, and internal test skills that registry operators have explicitly excluded from public discovery. Wildcard ACAO on the reindex endpoint allows any page to trigger content reindexation using attacker-controlled metadata, poisoning relevance scores and manipulating search rankings across the registry catalog. A timing oracle on the search analytics endpoint enumerates which skills carry high search traffic, identifying the most valuable targets for the search index exfiltration attack. And credential-bearing CORS on index deletion lets any origin silently remove any skill from the search index, making production skills completely undiscoverable without deleting the skill record itself.

SA-SKL-CORS48 findings at a glance
CRITICALCORS48-001 — cors({origin:true,credentials:true}) on GET /api/skills/search; any origin reads full search index including unlisted skills, private org skills, and internal test skills using victim session
HIGHCORS48-002 — ACAO: * on POST /api/skills/search/index; any page triggers reindex of attacker-controlled skill content, manipulating search rankings and poisoning search result relevance scores; fix: remove wildcard; require session; requireRole('admin'); validate skill ownership before reindex
MEDIUMCORS48-003 — ACAO origin reflection on GET /api/skills/search/analytics emitted before ownership check; timing oracle reveals search query analytics existence across all orgs, enumerating high-search-volume skills as CORS48-001 targets
CRITICALCORS48-004 — cors({origin:true,credentials:true}) on DELETE /api/skills/search/index/:skillId; any origin removes any skill from the search index using victim admin session, making skills undiscoverable

CORS48-001 — Credential-bearing CORS on search endpoint exposes unlisted skills, private org skills, and internal test artifacts

The skill search endpoint at GET /api/skills/search returns structured search results drawn from the full skill index. For authenticated admin sessions, those results include every skill in the registry — including skills marked as unlisted (accessible by direct URL but excluded from public discovery), skills belonging to private organizations that have not opted in to cross-org discoverability, and internal test skills created during registry development and QA that are never intended for external consumption. When configured with cors({origin:true,credentials:true}), any page can issue search queries using the victim administrator's session and read these visibility-restricted results.

The practical impact of unlisted skill exfiltration depends on what those skills contain. Many registries use unlisted status as a soft form of access control for skills that are in limited beta, deployed to specific enterprise customers under NDA, or contain integrations with internal infrastructure that must not be publicly documented. Retrieving the full skill record for these unlisted skills typically includes the skill's tool definitions, parameter schemas, and sometimes embedded endpoint URLs for the backing service. For private org skills, the exfiltration reveals the organization's internal tooling catalog — the full set of automation capabilities the org has built on top of the MCP protocol, often including integrations with internal databases, CI systems, and security tooling that are not meant to be known outside the org.

Internal test skills are particularly sensitive because they are often created with relaxed validation, permissive parameter schemas, or hardcoded test credentials that were never reviewed for production security. Discovering these skills through CORS48-001 gives an attacker a map of the registry's internal testing surface — including which services have MCP-accessible test endpoints and what parameter shapes those endpoints accept.

CORS48-001 fix: Replace cors({origin:true,credentials:true}) with an explicit allowlist of known dashboard and partner origins. Add requireSession before the CORS middleware. For public (unauthenticated) callers, execute a filtered search query that includes only skills where visibility = 'public' AND status = 'published' AND orgVisibility = 'public'. For authenticated callers, apply the same visibility filter plus org-scoped results for the caller's own org. Never return unlisted, private-org, or test skills to callers outside the owning org regardless of session scope.

WRONG
router.get('/skills/search',
  cors({ origin: true, credentials: true }),
  async (req, res) => {
    // Returns all skills visible to session, including unlisted + private
    const results = await search.query(req.query.q, req.session);
    res.json(results);
  }
);
RIGHT
router.get('/skills/search',
  requireSession,
  strictCors,
  async (req, res) => {
    const orgId = req.session?.orgId ?? null;
    // Public skills only for callers outside the owning org
    const filter = {
      visibility: 'public',
      status: 'published',
      orgVisibility: 'public',
      // Also include caller's own org skills if authenticated
      ...(orgId ? { ownOrgId: orgId } : {})
    };
    const results = await search.query(req.query.q, filter);
    // Strip internal fields regardless of caller
    res.json(results.map(r => sanitizeSearchResult(r)));
  }
);

CORS48-002 — Wildcard ACAO on search reindex endpoint enables ranking manipulation and relevance score poisoning

The search reindex endpoint at POST /api/skills/search/index triggers re-ingestion of a skill's metadata into the search index, updating the document vectors and relevance signals used to rank search results. With ACAO: *, any page can trigger reindexation without an authenticated session. If the reindex operation reads skill content from a user-controlled source rather than the canonical registry record — for example, by accepting a contentUrl body parameter that specifies where to fetch the skill's indexable content — an attacker can supply a URL pointing to attacker-controlled content, causing the search index to store false metadata for a targeted skill.

Even without a content URL parameter, unauthenticated reindex triggering enables a denial-of-service attack on the search indexing pipeline. Submitting rapid-fire reindex requests for many skills simultaneously saturates the indexing worker queue, causing legitimate reindex operations — such as those triggered by a skill publisher's legitimate content update — to queue behind thousands of attacker-initiated jobs. The search index for the targeted skills becomes stale for hours while the queue drains, degrading search result quality across the registry. Relevance scores that depend on freshness signals are particularly vulnerable: a skill that is actively being updated but whose reindex is perpetually queued behind attacker noise will appear stale and rank lower than less-active skills.

CORS48-002 fix: Remove wildcard ACAO: * and require session authentication. Add requireRole('admin') for registry-wide reindex operations. For skill-scoped reindex requests, validate that skill.orgId === req.session.orgId before accepting the job. Never accept a contentUrl parameter — always read indexable content from the canonical skill record in the database. Apply per-org rate limiting on reindex submissions to prevent queue saturation attacks.

CORS48-003 — Timing oracle on search analytics endpoint enumerates high-search-volume skills across all orgs

The search analytics endpoint at GET /api/skills/search/analytics returns per-skill search query statistics: how often the skill appears in search results, click-through rates, and query term distributions. The endpoint emits the CORS origin reflection header before executing the ownership check that determines whether the requesting session may read analytics for the target skill. This creates a timing oracle identical to the CORS47-003 pattern: requests for skills that have analytics records but belong to a different org take measurably longer than requests for skills with no analytics at all, because the former executes a full analytics aggregation query before hitting the ownership gate while the latter exits early.

High-search-volume skills are the most valuable targets for CORS48-001's search index exfiltration. Skills that appear frequently in search results and receive high click-through rates represent the most-used capabilities in the registry — the integrations that other organizations depend on most heavily. Discovering these high-value skills through the CORS48-003 timing oracle before escalating to CORS48-001 for content exfiltration creates an efficient reconnaissance chain: scan for high-analytics skills first, then use CORS48-001 to exfiltrate their full records including tool definitions, parameter schemas, and backing endpoint configurations.

CORS48-003 fix: Move the ownership check before CORS header emission. Use a unified WHERE orgId = req.session.orgId AND skillId = req.params.skillId clause that returns a consistent empty result set for non-owned skills rather than a permission error after a heavier query. Normalize response latency for 403 and 404 paths by ensuring both complete a database round-trip before returning. Apply the same fix to any search metadata endpoint that emits CORS headers before executing authorization checks.

CORS48-004 — Credential-bearing CORS on index deletion makes skills silently undiscoverable

The search index deletion endpoint at DELETE /api/skills/search/index/:skillId removes the target skill's document from the search index without deleting the skill record from the registry database. Skills removed from the search index via this endpoint continue to exist and function — they can still be accessed by direct URL, invoked by existing integrations, and managed through the registry admin panel — but they become completely undiscoverable through any search query. Users who do not already have the skill's direct URL cannot find it through the registry's search interface, effectively making the skill invisible to new users.

When configured with cors({origin:true,credentials:true}), any origin can trigger this silent visibility removal using the victim admin's authenticated session. The attack is particularly insidious because it does not break any existing functionality: all existing integrations continue to work, error dashboards show no failures, and the skill record remains intact in the database. The only observable effect is that new users searching for the skill's capabilities receive no results and may install a competing (potentially malicious) skill instead. Registry operators may not notice the missing search coverage for days or weeks if they do not actively monitor search result completeness.

An attacker targeting a competitor's high-value skill can combine CORS48-003 to identify which skills have the highest search volume, then use CORS48-004 to remove those skills from the index — redirecting user discovery traffic toward alternative skills that the attacker controls or benefits from. The deleted index entries can be targeted precisely: the attacker removes exactly the skills that compete directly with attacker-controlled alternatives, leaving all other search results intact to avoid detection.

CORS48-004 fix: Replace cors({origin:true,credentials:true}) with an explicit allowlist of known admin dashboard origins. Add requireSession and requireRole('admin'). Add an ownership check that validates skill.orgId === req.session.orgId before accepting the deletion. Write a detailed audit log entry including actor, timestamp, skillId, and skill name. Send an alert to the skill owner's configured notification channel on every index deletion. For skills with high search volume, require a secondary confirmation step and notify registry platform administrators.

WRONG
router.delete('/skills/search/index/:skillId',
  cors({ origin: true, credentials: true }),
  async (req, res) => {
    // No ownership check — any admin session can remove any skill from search
    await searchIndex.remove(req.params.skillId);
    res.json({ removed: true });
  }
);
RIGHT
router.delete('/skills/search/index/:skillId',
  requireSession,
  strictCors,
  requireRole('admin'),
  async (req, res) => {
    const skill = await db.getSkill(req.params.skillId);
    if (!skill || skill.orgId !== req.session.orgId) {
      return res.status(403).json({ error: 'forbidden' });
    }
    await searchIndex.remove(req.params.skillId);
    await auditLog.write({
      event: 'search_index_removed',
      skillId: req.params.skillId,
      skillName: skill.name,
      actor: req.session.userId,
      orgId: req.session.orgId
    });
    await notify.sendIndexRemovalAlert(skill.ownerId, req.params.skillId);
    res.json({ removed: true });
  }
);

SkillAudit scans your registry's search and discovery router for all four CORS48 patterns, plus the eleven other CORS families documented in the SA-SKL-CORS series. Get started free — 3 audits/month on public repos, results in 60 seconds.