CORS Misconfigurations in MCP Skill Registry Search and Discovery Feed Endpoints
Search and discovery feed endpoints are the primary entry point through which both human users and automated agents locate skills in a registry. When CORS is misconfigured on these routes, an attacker can read private and unlisted skills visible only in a victim's personalized search results, inject attacker-controlled entries into the victim's persistent discovery feed via saved-search creation, identify active and growing private skills before their authors make them public using a trending velocity timing oracle, and erase the forensic search history that would otherwise record the reconnaissance. Advisory SA-SKL-CORS53 details four distinct vulnerabilities across these endpoints that compose naturally into a compound private skill enumeration and discovery feed poisoning chain executable from a single malicious web page visited by any registry participant.
In this post
- Why search and discovery feed endpoints are high-value CORS targets
- CORS53-001 — Credential-bearing CORS on personalized search exposes private skills and ranking signals
- CORS53-002 — Wildcard ACAO on saved-search creation injects attacker-controlled discovery feed entries
- CORS53-003 — Timing oracle on trending endpoint reveals skill velocity tiers
- CORS53-004 — Credential-bearing CORS on history deletion erases forensic reconnaissance records
- Compound private skill enumeration and discovery feed poisoning chain
- Detection with SkillAudit AST queries
- Summary and remediation checklist
GET /api/skills/search allows any origin with credentials to read personalized search results including private and unlisted skills visible only to the authenticated user and session-dependent ranking signals that reveal competitive intelligence
POST /api/skills/search/save returns Access-Control-Allow-Origin: *, letting any page inject attacker-controlled saved searches into the victim's discovery feed that persist until manually deleted and consume saved-search quota
GET /api/skills/trending reflects Origin before rate-limit check, creating a timing oracle that reveals skill popularity velocity tiers with sub-millisecond precision before public trending boards update
DELETE /api/skills/search/history allows any origin with credentials to clear the victim's full search history, removing the forensic record of attacker reconnaissance from the registry's audit trail
Why search and discovery feed endpoints are high-value CORS targets
Search and discovery feed endpoints occupy an unusual position in the attack surface of a skill registry: they are simultaneously high-read-volume public-facing APIs and deeply personalized data surfaces. The same endpoint that serves anonymous visitors browsing public skills also serves authenticated users navigating private organizational skills, teams exploring skills shared with specific workspaces, and authors reviewing the discoverability of their own unpublished drafts. This dual-use design creates a systematic CORS vulnerability surface because developers write a single route handler that handles both public and authenticated paths — and misconfigure CORS to accommodate the public use case without realizing that credentialed browsers will silently include session cookies on every cross-origin request to the same endpoint.
Search results encode organizational structure. The personalized search results for an authenticated user reveal not just which public skills exist, but which private and unlisted skills that user has access to — meaning a CORS read of the search endpoint is equivalent to a CORS read of the organization's private skill inventory. This is structurally different from a simple data leak: the attacker does not need to know the IDs of private skills ahead of time; they can query the search endpoint with broad terms and retrieve the full set of skills the victim can see, including skills shared with teams the victim belongs to that the attacker had no prior knowledge of.
Ranking signals are competitive intelligence. Session-dependent ranking incorporates factors like the user's historical install behavior, their team's adoption patterns, and signals derived from their organization's skill evaluation history. These ranking signals reveal which skills a team is actively evaluating, which competitors are in consideration, and what internal adoption priorities look like — none of which is intended to be accessible cross-origin. A CORS read of the personalized search endpoint harvests both the inventory and the metadata that reveals organizational intent.
Discovery feed injection has persistent reach. Unlike a one-time data leak, injection into a saved-search discovery feed persists indefinitely. The attacker-controlled discovery feed entry appears in the victim's personalized recommendation stream every time they visit the registry homepage or browse their saved searches — not just at the moment of the initial attack. This persistence transforms a point-in-time CORS exploit into an ongoing influence campaign that can redirect the victim's skill adoption decisions toward attacker-controlled or malicious skills over an extended period.
Forensic erasure prevents detection. The history deletion capability makes CORS53 a self-covering attack class. The attacker who reads private skills via CORS53-001, injects discovery feed entries via CORS53-002, and identifies emerging private skills via CORS53-003 can then erase the search history that would otherwise record the reconnaissance via CORS53-004. The registry's audit trail becomes unreliable the moment the deletion executes, making incident response dependent on external logs that may not capture cross-origin browser activity.
CORS53-001 — Credential-bearing CORS on personalized search exposes private skills and ranking signals
Severity: CRITICAL
The GET /api/skills/search endpoint is configured with cors({origin:true,credentials:true}), reflecting every requesting origin back as Access-Control-Allow-Origin and setting Access-Control-Allow-Credentials: true. This combination allows cross-origin JavaScript executing in any page the authenticated user visits to call the endpoint with credentials: 'include' and read the full personalized search response — including results filtered to the user's access level, private and unlisted skills shared with their teams and organizations, and session-dependent ranking signals derived from the user's historical behavior and their organization's skill adoption patterns.
The session-dependent ranking signals are the most commercially sensitive component. A skill registry that surfaces personalized results based on team adoption history, evaluation scores, or usage patterns is effectively encoding the organization's internal technology evaluation process into the search response. An attacker who reads these signals cross-origin can infer which competing skills are under active evaluation, which new skills the team is onboarding, and what the organization's overall direction looks like before any of it becomes externally visible. This is not a data leak in the traditional sense — the user's personal data is not necessarily exposed — but it is a business intelligence leak that may be more valuable than raw PII.
// search-router.js — cors({origin:true,credentials:true}) reflects every origin
const router = express.Router();
router.use(cors({ origin: true, credentials: true }));
router.get('/search', optionalSession, async (req, res) => {
const { q, page = 1, limit = 20 } = req.query;
const userId = req.session?.userId;
// Returns private skills when authenticated — CORS policy allows any origin to read these
const results = await SkillIndex.search(q, {
userId, // activates private + unlisted skill access
personalized: !!userId, // activates session-dependent ranking
includeOrgSkills: true, // includes skills from all user's orgs
page: Number(page),
limit: Number(limit),
});
return res.json(results); // includes private skills + ranking metadata
});
// search-router.js — split public and authenticated paths with per-route CORS
const publicSearchCors = cors({
origin: process.env.ALLOWED_ORIGINS.split(','),
credentials: false, // public path: no credentials needed
});
const privateCors = cors({
origin: process.env.ALLOWED_ORIGINS.split(','),
credentials: true,
});
// Public search: no session, no private results, no ranking signals
router.get('/search', publicSearchCors, async (req, res) => {
const { q, page = 1, limit = 20 } = req.query;
const results = await SkillIndex.search(q, {
publicOnly: true, // only published, discoverable skills
personalized: false, // no session-dependent ranking
page: Number(page),
limit: Number(limit),
});
return res.json(results.map(r => ({
id: r.id, name: r.name, description: r.description,
author: r.author, stars: r.stars, // no ranking metadata
})));
});
// Authenticated search: requires session, allowlisted origins only
router.get('/search/me', privateCors, requireSession, async (req, res) => {
const { q, page = 1, limit = 20 } = req.query;
const results = await SkillIndex.search(q, {
userId: req.session.userId,
personalized: true,
includeOrgSkills: true,
page: Number(page),
limit: Number(limit),
});
return res.json(results); // only served to allowlisted origins with valid session
});
The fix splits the search route into a public path that serves only published skills with no session-dependent signals and an authenticated path that requires both a valid session and an allowlisted origin. The public path uses a non-credentialed CORS policy because it has no session dependency; the authenticated path uses a credentialed allowlist policy because it accesses private data. This architecture matches CORS policy to the actual access level of the route rather than applying a permissive policy at the router level that covers both paths.
CORS53-002 — Wildcard ACAO on saved-search creation injects attacker-controlled discovery feed entries
Severity: HIGH
The POST /api/skills/search/save endpoint returns Access-Control-Allow-Origin: *. The wildcard ACAO header allows any web page — including those served from attacker-controlled domains — to send saved-search creation requests cross-origin using the victim's credentials. Because the endpoint processes the saved search without validating that the caller is an authenticated user and without requiring a CSRF token, any page that induces the victim's browser to issue a POST can create saved searches with attacker-controlled query parameters, labels, and filter configurations.
The impact of this vulnerability is persistence. A saved search is not a one-time data access — it becomes a recurring entry in the victim's personalized discovery feed that surfaces skill recommendations every time the victim browses the registry. If the attacker injects a saved search targeting a specific skill category or author name, the victim's discovery feed will persistently surface attacker-selected skills alongside legitimate recommendations. The victim has no indication that any of these results were injected via CORS — the feed looks exactly like their own saved searches.
Saved searches are discovery feed injection vectors, not just query shortcuts. A registry that surfaces saved searches in its recommendation feed gives any CORS-writable endpoint the power to persistently influence what the victim sees every session. Wildcard ACAO on saved-search creation is not just a data integrity issue — it is a persistent influence channel that bypasses every recommendation algorithm the registry implements. Always require session authentication and CSRF validation independently of the CORS policy.
The quota exhaustion impact is secondary but operationally relevant. Most registries enforce per-user limits on saved searches to manage index storage and recommendation computation costs. Flooding the quota with attacker-controlled entries blocks the victim from creating legitimate saved searches until they manually identify and delete the injected ones — a friction that may be particularly disruptive for teams using saved searches as part of an automated skill evaluation workflow.
The fix removes the wildcard header, adds requireSession middleware to verify the caller has an active authenticated session, adds CSRF token validation to prevent cross-site request forgery, enforces a Zod SavedSearchSchema that restricts the query body to known field types (string query, array filters, enum sort order), and validates the query against the allowed field set before persisting the record.
CORS53-003 — Timing oracle on trending endpoint reveals skill velocity tiers
Severity: MEDIUM
The GET /api/skills/trending endpoint reflects the Origin header before performing the rate-limit check. Skills in the trending index are sorted into velocity tiers based on install and star acceleration signals that are computed on a rolling short window — typically 1–6 hours. Skills in higher velocity tiers are stored in a hot cache with sub-millisecond access times; skills in lower tiers require a full index scan that takes measurably longer. The difference — typically 8–25 ms between velocity tiers — is cross-origin-detectable using the performance.now() timing API available in all modern browsers.
The timing oracle is valuable to competitive actors because it reveals trending velocity before public boards update. The public trending board is typically refreshed on a 24-hour or 6-hour cycle; the underlying velocity signals are computed continuously. An attacker probing the trending endpoint with controlled query parameters that trigger lookups for specific skills can determine whether a skill is in the highest velocity tier — indicating it is growing rapidly among private or early-access users — before this growth becomes visible in the public trending list. For skill authors, this intelligence reveals which competitors are gaining traction in the market before they become publicly prominent. For private skill authors, it may reveal that their unpublished skill is being adopted via direct share links at a velocity they did not intend.
The fix performs the rate-limit check and authentication verification before emitting any CORS header, normalizes response latency across all velocity tiers with a constant-time floor, and uses a single query path that does not short-circuit on cache hits in a way that leaks tier information. The critical architectural detail is that CORS headers must not be emitted — not even for preflight — until after the rate-limit check succeeds; emitting them before creates the timing signal even if the response body is empty or generic.
CORS53-004 — Credential-bearing CORS on history deletion erases forensic reconnaissance records
Severity: HIGH
The DELETE /api/skills/search/history endpoint shares the same cors({origin:true,credentials:true}) policy as CORS53-001. Any web page can instruct the victim user's browser to delete their entire search history — there is no confirmation gate, no selective deletion constraint (only full history clear is supported), and no audit log entry created on deletion. The deletion takes effect immediately and is irreversible through any user-facing interface.
The forensic erasure impact compounds every other finding in this advisory. When an attacker uses CORS53-001 to enumerate private skills and CORS53-002 to inject discovery feed entries, the victim may eventually notice the injected entries and begin investigating. The search history would normally provide a first-order forensic artifact: timestamps of the searches that exposed private skill names, query terms that reveal what the attacker was looking for, and session fingerprints that could help correlate the attack with other access logs. CORS53-004 removes this artifact atomically, forcing incident responders to rely entirely on server-side access logs that may not capture the specific query parameters used in cross-origin browser requests.
// history-router.js — cors({origin:true,credentials:true}) + no audit log
router.use(cors({ origin: true, credentials: true }));
router.delete('/search/history', requireSession, async (req, res) => {
await SearchHistory.deleteMany({ userId: req.session.userId });
return res.status(204).end(); // silent deletion, no audit record
});
// history-router.js — allowlist cors + audit log on history deletion
const historyCors = cors({
origin: process.env.ALLOWED_ORIGINS.split(','),
credentials: true,
});
router.delete('/search/history', historyCors, requireSession, async (req, res) => {
const count = await SearchHistory.countDocuments({ userId: req.session.userId });
await SearchHistory.deleteMany({ userId: req.session.userId });
// Audit log: preserve forensic record even though user data is deleted
await AuditLog.create({
action: 'search.history.cleared',
userId: req.session.userId,
recordsDeleted: count,
requestOrigin: req.headers.origin,
userAgent: req.headers['user-agent'],
timestamp: new Date(),
});
return res.status(204).end();
});
The fix applies a per-route allowlist CORS policy that restricts history deletion to the registry's own domain set, eliminating cross-origin deletion entirely. It also creates an audit log entry on every deletion that captures the number of records deleted, the request origin, and the user agent — preserving the forensic context even though the history records themselves are removed. This means that an incident responder who checks the audit log after an attack will find evidence of the deletion event and can correlate it with the cross-origin request origin to attribute the attack.
Compound private skill enumeration and discovery feed poisoning chain
These four vulnerabilities compose naturally into a four-stage attack executed entirely from a single malicious web page visited by any registry participant. The chain requires no prior knowledge of the target's private skill inventory and leaves no persistent traces in the victim's search history after CORS53-004 executes.
Attacker iterates over target skill IDs or category parameters, measuring trending endpoint response latency. Skills in the highest velocity tier (8–25 ms faster than lower tiers) are flagged as actively growing — these are the private or early-access skills gaining traction before public launch that the attacker wants to enumerate or redirect adoption away from.
Attacker queries the authenticated search endpoint with terms derived from trending oracle output. Because the personalized search response includes private and unlisted skills visible only to the victim, the attacker now has the full names, descriptions, and metadata for skills that were never intended to be publicly accessible — along with the ranking signals that reveal which ones the victim's team is actively evaluating.
Attacker creates saved searches targeting attacker-controlled skill categories or specific author names. These saved searches appear in the victim's discovery feed on every subsequent registry visit — persistently surfacing attacker-selected recommendations that compete with or displace the legitimate private skills identified in step 2. The injection persists until the victim identifies and manually deletes the attacker-created saved searches.
Attacker deletes the victim's full search history, removing the forensic record of the CORS53-001 reconnaissance queries. Without the history records, the registry's internal audit trail cannot directly show what private skills were accessed, what query terms revealed the private skill inventory, or when the cross-origin access occurred. Incident response must rely entirely on server-side access logs and external WAF records.
CORS53 is the first SA-SKL advisory class where the attack leaves the system in a worse state than before. Prior CORS advisories primarily covered data exfiltration: the attacker learns something the registry did not intend to disclose. CORS53-002 and CORS53-004 go further — CORS53-002 injects persistent attacker-controlled data into a live discovery feed, and CORS53-004 destroys forensic evidence. This distinction matters for incident response: detecting a CORS53 attack after the fact requires external log sources (WAF, CDN access logs, browser history) rather than registry-internal audit data alone.
Detection with SkillAudit AST queries
SkillAudit's static analysis engine scans skill registry codebases for three classes of AST patterns that together cover all four CORS53 findings.
Class 1 — Wildcard or origin-reflect CORS on search and discovery endpoints. Matches any cors({origin:true}) or cors({origin:'*'}) call on routes whose path contains search, trending, discovery, or feed. Covers CORS53-001, CORS53-002, and CORS53-004. The query also matches router-level CORS middleware that applies to all routes under a search or discovery prefix, which is the most common deployment pattern for this finding.
Class 2 — CORS header emission before rate-limit or auth check. Matches route handler chains where a CORS middleware call appears before an express-rate-limit, rateLimit, or authentication middleware call in the same route registration statement. Covers CORS53-003. The query uses AST-level argument position analysis to detect ordering issues that are invisible to surface-level grep searches — a common false-negative source for this finding class.
Class 3 — DELETE history/clear routes without audit log creation. Matches router.delete or app.delete calls on routes containing history, clear, or reset that do not include an AuditLog.create, auditLog.write, or equivalent call in the same handler body. Covers CORS53-004 specifically and the broader class of forensically silent destructive operations. Includes pattern matching for common audit log library APIs: Winston, Bunyan, Pino, Datadog, and Splunk SDK calls that write structured deletion events.
Summary and remediation checklist
CORS53 identifies four misconfigurations across the search and discovery feed surface of MCP skill registries. Each finding is independently exploitable, and together they form a chain that takes an attacker from zero knowledge of a target's private skill inventory to persistent discovery feed influence with forensic trail erasure.
| Finding | Severity | Root cause | Fix summary |
|---|---|---|---|
| CORS53-001 | Critical | Router-level cors({origin:true,credentials:true}) on combined public/private search route |
Split into public and authenticated routes; apply allowlist CORS only to authenticated path |
| CORS53-002 | High | Wildcard ACAO on saved-search creation; no session check; no CSRF validation | Remove wildcard; add requireSession; add CSRF token; Zod schema validation |
| CORS53-003 | Medium | CORS header emitted before rate-limit check; cache hot path leaks velocity tier timing | Rate-limit before CORS emission; normalize response latency across all tiers |
| CORS53-004 | High | Router-level cors({origin:true,credentials:true}) on history deletion; no audit log |
Per-route allowlist CORS; create audit log entry on every deletion capturing origin and record count |
Run SkillAudit on your registry codebase. Paste the GitHub URL of your MCP skill registry implementation at skillaudit.dev to get a graded report covering CORS misconfiguration, SSRF, deserialization, injection, and privilege escalation patterns across all six audit axes. The free tier covers three public repository audits per month.
Related advisories: SA-SKL-CORS53 (advisory page) · SA-SKL-CORS52 · SA-SKL-CORS51 blog · SA-SKL-CORS54