CORS Misconfigurations in MCP Skill Registry Organization Member Invitation and Onboarding Endpoints
Organization member management endpoints sit at the trust boundary of every MCP skill registry organization — they control who is a member, who can be invited to become one, and who can be removed. When CORS is misconfigured on these routes, an attacker can harvest the full member roster including email addresses and pending invites, dispatch invitations to attacker-controlled addresses that arrive as legitimate admin-issued onboarding emails, identify organizations in active hiring or partner onboarding campaigns via a timing oracle, and silently remove any member — including CI service accounts — using a victim admin's session. Advisory SA-SKL-CORS51 details four distinct vulnerabilities that together form a compound four-stage organizational access disruption chain executable from a single malicious web page visited by any registry participant.
In this post
- Why organization member endpoints are a high-value CORS target
- CORS51-001 — Credential-bearing CORS on member list exposes email addresses and pending invites
- CORS51-002 — Wildcard ACAO on invite endpoint dispatches invitations to attacker-controlled addresses
- CORS51-003 — Timing oracle on invites endpoint enumerates organizations with active invite campaigns
- CORS51-004 — Credential-bearing CORS on member removal disrupts collaborators and CI service accounts
- Compound organizational access disruption chain
- Detection with SkillAudit AST queries
- Summary and remediation checklist
GET /api/orgs/:id/members allows any origin with credentials to read the full member list including email addresses, role assignments, and pending invites that have not yet been accepted
POST /api/orgs/:id/invites returns Access-Control-Allow-Origin: *, letting any page dispatch member invitations to attacker-controlled email addresses, consuming invite quota and creating unauthorized org membership
GET /api/orgs/:id/invites reflects Origin before membership check, creating a timing oracle that reveals invite campaign activity and identifies the richest CORS51-001 targets
DELETE /api/orgs/:id/members/:userId allows any origin with credentials to remove any member from any organization using a victim admin session, disrupting active collaborators and breaking CI service accounts
Why organization member endpoints are a high-value CORS target
Organization member management endpoints are uniquely valuable CORS targets for three reasons that set them apart from most other registry API surfaces.
They expose data that enables subsequent attacks. A member list with email addresses is not just PII — it is a targeted phishing list enriched with role context. Knowing that a specific email is an organization owner makes social engineering highly convincing. Pending invites are even more valuable: the invitees are expecting communication from the registry, their guard is lowered, and their email addresses are often not yet publicly associated with the organization. Harvesting pending invites turns a broad CORS read into a high-conversion phishing campaign.
They control organizational trust grants, not just data access. The invite endpoint does not just transmit information — it creates membership records that grant access to skills, audit reports, and billing data. A CORS misconfiguration on an invite endpoint is not a data leak; it is an access grant factory. Every unauthorized invitation dispatched through CORS52-002 creates a membership that persists until an admin notices and revokes it, which may be weeks or months after the initial injection.
They cause operational impact that is invisible in monitoring. Member removal via CORS51-004 is particularly difficult to detect because the impact manifests as CI failures, not as a security alert. When a CI service account is removed from an organization, the resulting pipeline authentication errors look like configuration drift or infrastructure instability — not like a security incident. Organizations discover the attack by investigating build failures, not by reviewing membership change logs, because service account removals do not always trigger the same notification flow as human member removals.
The combination of these properties — high-value data, trust escalation capability, and low observability — makes organization member endpoints among the most consequential CORS misconfiguration targets in a skill registry deployment.
CORS51-001 — Credential-bearing CORS on member list exposes email addresses and pending invites
Severity: CRITICAL
The GET /api/orgs/:id/members endpoint is configured with cors({origin:true,credentials:true}), reflecting every origin back as Access-Control-Allow-Origin and setting Access-Control-Allow-Credentials: true. This configuration is functionally equivalent to allowing all origins to make credentialed cross-origin requests — the security model of a credentialed response depends entirely on the browser's same-origin policy enforcement, which is bypassed when the server reflects the requesting origin back unconditionally.
Cross-origin JavaScript executing in any page the victim admin visits can call this endpoint with credentials: 'include' and read the response in full. The member list document includes each member's email address, display name, assigned role (owner, admin, maintainer, member, viewer), membership status, and join timestamp. It also includes pending invites — these represent email addresses of people who have been invited but are not yet members, often including contractors, external collaborators, and partner organization contacts.
The pending invite list is particularly sensitive because it has a temporal dimension that the member list lacks. At the moment of exfiltration, the invitees are actively expecting communication from the registry. An attacker who harvests this list and immediately sends a convincing follow-up email can achieve a phishing conversion rate far higher than a cold campaign. The invite metadata also reveals organizational strategy: a sudden burst of pending invites to a specific domain suggests a partnership negotiation or an acquisition integration effort — commercial intelligence that has value independent of its phishing utility.
// org-member-router.js — cors({origin:true,credentials:true}) on router
const router = express.Router();
router.use(cors({ origin: true, credentials: true })); // reflects every origin
router.get('/:id/members', requireSession, async (req, res) => {
const members = await OrgMember.find({ orgId: req.params.id })
.populate('user', 'email displayName role')
.populate('pendingInvites');
return res.json(members); // full roster including email and pending invites
});
// org-member-router.js — per-route allowlist cors + org membership gate
const memberCors = cors({
origin: process.env.ALLOWED_ORIGINS.split(','),
credentials: true,
});
router.get('/:id/members', memberCors, requireSession, async (req, res) => {
// Caller must be a member of this org
const callerMembership = await OrgMember.findOne({
orgId: req.params.id,
userId: req.session.userId,
status: 'active',
});
if (!callerMembership) return res.status(403).json({ error: 'Forbidden' });
const members = await OrgMember.find({
orgId: req.params.id, status: 'active',
}).populate('user', 'displayName avatarUrl'); // no email in public response
const isAdmin = ['owner', 'admin'].includes(callerMembership.role);
return res.json(members.map(m => ({
userId: m.userId,
displayName: m.user.displayName,
avatarUrl: m.user.avatarUrl,
role: m.role,
joinedAt: m.joinedAt,
...(isAdmin ? { email: m.user.email } : {}), // email visible only to admins
})));
});
The fix applies a per-route allowlist CORS policy that restricts cross-origin access to the registry's own domain set. It also adds an org membership gate: only members of the organization can read the member list, and email addresses are included only in responses to org admins and owners. Public callers receive only display names and avatar URLs — not the email addresses needed to target phishing campaigns.
CORS51-002 — Wildcard ACAO on invite endpoint dispatches invitations to attacker-controlled addresses
Severity: HIGH
The POST /api/orgs/:id/invites endpoint returns Access-Control-Allow-Origin: *. The wildcard ACAO header allows any web page — including those served from attacker-controlled domains — to send invite requests cross-origin. Because the endpoint processes invite dispatch without validating that the caller is an org admin and without requiring a CSRF token, any page that induces the victim admin's browser to issue a POST can dispatch invitations to arbitrary email addresses.
The attack has two distinct impacts. The first is quota exhaustion: most registries enforce a per-organization invite quota to prevent spam. Flooding the quota with attacker-controlled invites blocks legitimate admin onboarding until the queue is cleared, which may require manual intervention and cause friction during active hiring or partner onboarding periods. The second is unauthorized membership creation: invitations dispatched through CORS51-002 arrive from the registry's own email domain and pass SPF and DKIM checks because the registry mail system sends them. Recipients who accept these invitations become members of the organization with the role specified in the attacker-controlled request body.
Invite endpoints are trust escalation surfaces, not just communication endpoints. An accepted invite grants organizational membership — it is equivalent to an access grant. Wildcard ACAO on any invite endpoint allows any attacker-controlled page to issue invitations that carry the full authority of the legitimate admin's session. Always require session authentication, CSRF validation, and domain allowlist enforcement independently of the CORS policy, and validate that the caller has the authority to grant the requested role before dispatching.
The fix removes the wildcard, requires independent session authentication, adds CSRF token validation, enforces Zod InviteSchema against the submitted invite parameters to restrict to known role identifiers, and validates the invitee's email domain against the organization's configured domain allowlist before dispatching.
CORS51-003 — Timing oracle on invites endpoint enumerates organizations with active invite campaigns
Severity: MEDIUM
The GET /api/orgs/:id/invites endpoint reflects the Origin header before performing the org membership check. The invite query joins invite records with user and role data, and organizations with many pending invites (active onboarding campaigns) take measurably longer to respond than organizations with no active invites. The latency difference — typically 15–45 ms for high-invite-volume organizations — is cross-origin-detectable using the performance.now() timing API available in all modern browsers.
An attacker uses this timing oracle to rank organizations by onboarding activity before executing CORS51-001. By concentrating the email harvest on organizations that are currently running invite campaigns, the attacker targets the moment when harvested email addresses are most likely to result in successful phishing conversions — when the invitees are actively expecting registry communication and their mental model for the registry is open and accepting.
The fix performs authentication and org membership checks before emitting any CORS header, uses a single WHERE orgId = ? AND orgId IN (SELECT orgId FROM org_members WHERE userId = ?) clause so the membership check and invite query share the same query path, and normalizes 403/404 response latency with a constant-time floor to eliminate the timing signal. The critical ordering detail is that CORS headers must not be emitted until after authentication succeeds — emitting them before auth creates a timing signal even if the response body is empty.
CORS51-004 — Credential-bearing CORS on member removal disrupts collaborators and CI service accounts
Severity: CRITICAL
The DELETE /api/orgs/:id/members/:userId endpoint shares the same cors({origin:true,credentials:true}) policy as CORS51-001. Any web page can instruct the victim admin's browser to remove any member from any organization — there is no ownership check on the organization record and no confirmation gate. Removal takes effect immediately, revoking the removed member's access to all skills, audit reports, and billing information associated with the organization.
The most operationally damaging target is a CI service account. CI service accounts are typically members of the organization with a machine-user role, and their removal immediately breaks all automated workflows that depend on the organization's skills: CI pipelines attempting to install skills fail with 403, automated audit runs fail to authenticate, and scheduled monitoring integrations lose access. These failures often manifest as pipeline errors that appear unrelated to membership changes, delaying incident detection.
// No ownership check, no audit log
router.delete('/:id/members/:userId', requireSession, async (req, res) => {
const membership = await OrgMember.findOne({
orgId: req.params.id,
userId: req.params.userId,
});
if (!membership) return res.status(404).json({ error: 'Not found' });
await membership.deleteOne();
return res.status(204).end();
});
router.delete('/:id/members/:userId', memberCors, requireSession, requireRole('admin'),
async (req, res) => {
// Caller must be admin or owner of THIS org
const callerMembership = await OrgMember.findOne({
orgId: req.params.id, userId: req.session.userId,
status: 'active', role: { $in: ['owner', 'admin'] },
});
if (!callerMembership) return res.status(403).json({ error: 'Forbidden' });
const target = await OrgMember.findOne({
orgId: req.params.id, userId: req.params.userId,
});
if (!target) return res.status(404).json({ error: 'Not found' });
// Owners can only be removed by other owners
if (target.role === 'owner' && callerMembership.role !== 'owner') {
return res.status(403).json({ error: 'Only owners can remove other owners' });
}
await target.deleteOne();
await AuditLog.create({
action: 'org.member.removed', orgId: req.params.id,
removedUserId: req.params.userId, actorId: req.session.userId,
timestamp: new Date(),
});
await sendMemberRemovalNotification(req.params.userId, {
orgId: req.params.id, removedBy: req.session.userId, removedAt: new Date(),
});
return res.status(204).end();
}
);
The fix replaces the global router-level CORS policy with per-route allowlist CORS, adds an explicit org admin or owner check on the caller, adds an owner-only-can-remove-owners rule to prevent non-owner admins from performing destructive lockout, creates an audit log entry, and sends a removal notification that provides the removed member with visibility into what happened. The notification is important specifically for CI service account owners who may not be watching the org membership UI.
Compound organizational access disruption chain
These four vulnerabilities compose naturally into a four-stage attack executed entirely from a single malicious web page visited by any registry participant with admin access to any organization.
Attacker iterates over target org IDs, measuring response latency on the invites endpoint. Organizations with active invite campaigns (15–45 ms slower) are flagged as high-value targets — their pending invite lists contain email addresses that are currently expecting registry communication.
For the flagged organizations, attacker reads the full member list including email addresses and pending invites. The combined list covers current members (with role context enabling targeted impersonation) and pending invitees (who are primed to receive onboarding communications).
Attacker dispatches invitations to their own email addresses (to gain org membership) and to harvested pending invitees (flooding the queue with look-alike onboarding emails that compete with legitimate invites). Legitimate invites get lost in the spam; attacker-controlled addresses gain membership.
With the email harvest complete and unauthorized membership established, attacker removes the organization's CI service account. Build pipelines begin failing with authentication errors. The organization's incident response team investigates infrastructure instability while the attacker's unauthorized membership persists undetected.
The critical property of this chain is that it requires no server-side data persistence by the attacker. Each step executes directly in the victim admin's browser, using the admin's own session credentials. The malicious page is a static HTML file that can be delivered via any vector that induces the target to visit it: a link in a Slack message, a phishing email, a compromised third-party resource loaded on a page the admin regularly visits, or a cross-site scripting vulnerability in an adjacent application.
Detection with SkillAudit AST queries
SkillAudit's static analysis engine scans skill registries for the CORS patterns that enable SA-SKL-CORS51. Three query classes cover the full advisory surface.
Query class 1 — Wildcard or origin-reflect CORS on member management routes. This query identifies routes under /orgs, /organizations, or /members path segments that use cors({origin: true}), cors({origin: '*'}), or the string '*' as the CORS origin. It flags both router-level middleware application and per-route middleware that covers member or invite endpoints.
// AST query class 1 — CORS wildcard or origin-reflect on org/member routes
// Matches: router.use(cors({origin: true})), cors('*'), cors({origin: '*'})
// Scope: routes containing 'orgs', 'organizations', 'members', 'invites' path segment
(call_expression
function: (member_expression
object: (identifier) @router
property: (property_identifier) @method
(#match? @method "^(use|get|post|delete|patch|put)$"))
arguments: (arguments
(call_expression
function: (identifier) @cors_fn
(#eq? @cors_fn "cors")
arguments: (arguments
(object
(pair
key: (property_identifier) @key
(#eq? @key "origin")
value: [(true)(string (string_fragment) @val (#eq? @val "*"))]
)
)
)
)
)
)
Query class 2 — CORS header emission before authentication middleware. This query finds route handler chains where a CORS middleware call appears as a parameter before the authentication middleware (requireSession, authenticate, verifyToken, etc.). CORS headers emitted before auth create timing oracles even when authentication ultimately blocks the request — the latency difference between fast auth rejection and slow auth success is cross-origin-visible.
// AST query class 2 — CORS header before auth middleware in route chain
// Detects cors() appearing before requireSession/authenticate in route args
(call_expression
function: (member_expression
property: (property_identifier) @method
(#match? @method "^(get|post|delete|patch|put)$"))
arguments: (arguments
(string) @path
(call_expression
function: (identifier) @cors_first
(#eq? @cors_first "cors") ; cors() appears before auth
) @cors_arg
(identifier) @auth_after
(#match? @auth_after "^(requireSession|authenticate|verifyToken|isAuthenticated)$")
)
)
Query class 3 — DELETE member or invite routes without ownership check. This query identifies route handlers for DELETE on paths containing /members/ or /invites/ that do not contain an ownership verification pattern — specifically, the absence of a comparison between req.session.userId (or req.user.id) and a field on the fetched record. Routes that pass this query pattern are candidates for missing authorization checks of the type exploited in CORS51-004.
// AST query class 3 — DELETE member/invite route without ownership check
// Flags delete handlers on member/invite paths that contain no ownership comparison
(call_expression
function: (member_expression
property: (property_identifier) @method
(#eq? @method "delete"))
arguments: (arguments
(string) @path
(#match? @path "members|invites")
; Handler function body
(arrow_function
body: (statement_block) @body
(#not-match? @body "session\\.userId|user\\.id|ownerId")
)
)
)
Summary and remediation checklist
| Finding | Severity | Primary remediation | Secondary hardening |
|---|---|---|---|
| CORS51-001 | Critical | Replace origin:true with allowlist; gate member list on org membership check; omit email from public response |
Admin-only email field; role-scoped member metadata; pending invite list restricted to admins |
| CORS51-002 | High | Remove ACAO: *; require session, CSRF token; validate invite via Zod InviteSchema |
Domain allowlist validation for invitee email; invite quota enforcement per org; role boundary check on invited role |
| CORS51-003 | Medium | Auth before CORS header emission; unified WHERE clause with membership subquery | Constant-time 403/404 latency floor; structured logging of timing anomalies |
| CORS51-004 | Critical | Replace origin:true with allowlist; requireRole('admin'); org ownership check on caller |
Audit log; member removal notification; owner-only owner removal path; CI service account removal alert |
Related advisories in this series. For payment and billing endpoint CORS patterns see SA-SKL-CORS50. For the marketplace listing and storefront CORS analysis see the SA-SKL-CORS49 blog post. For API key and token management CORS patterns see the SA-SKL-CORS52 advisory.
Find CORS misconfigurations like these before attackers do. SkillAudit scans your MCP skill registry organization endpoints for all four SA-SKL-CORS51 patterns using the AST query classes described above, plus the full CORS advisory series spanning CORS1 through CORS52. Paste your GitHub URL at skillaudit.dev to get a graded report in 60 seconds.