← Security advisories

Claude MCP skill CORS misconfiguration — skill organization member invitation and onboarding endpoints — SA-SKL-CORS51

SA-SKL-CORS51 documents four CORS misconfiguration patterns in MCP skill registry organization member invitation and onboarding endpoints. These endpoints control member enumeration, invitation dispatch, invite campaign analytics, and member removal — all surfaces with direct organizational trust and access implications. Credential-bearing CORS on the member list endpoint exposes the full roster of org members including email addresses, role assignments, and pending invites to any origin visiting with the victim's session. Wildcard ACAO on the invite endpoint lets any page dispatch invitations to attacker-controlled email addresses, consuming the organization's invite quota and creating unauthorized membership requests that appear as legitimate admin-issued invites. A timing oracle on the invites endpoint identifies organizations with active invite campaigns, targeting the richest CORS51-001 victims for email harvesting. And credential-bearing CORS on member removal allows any origin to silently remove any member from any organization — including CI service accounts — using the victim admin's session, disrupting active collaborators and breaking automated pipeline integrations.

SA-SKL-CORS51 findings at a glance
CRITICALCORS51-001 — cors({origin:true,credentials:true}) on GET /api/orgs/:id/members; any origin reads full member list including pending invites, role assignments, and email addresses using victim session; fix: allowlist; requireSession; validate org membership; return only public member metadata for public callers
HIGHCORS51-002 — ACAO: * on POST /api/orgs/:id/invites; any page sends member invitations to attacker-controlled email addresses consuming invite quota and creating unauthorized org membership; fix: remove wildcard; require session; requireRole('admin'); CSRF token; Zod InviteSchema; validate invitee domain against org allowlist
MEDIUMCORS51-003 — ACAO origin reflection on GET /api/orgs/:id/invites emitted before membership check; timing oracle reveals invite existence across all orgs, enumerating orgs with active invite campaigns as CORS51-001 targets for email harvest; fix: auth before CORS emission; unified WHERE clause; normalize 403/404 latency
CRITICALCORS51-004 — cors({origin:true,credentials:true}) on DELETE /api/orgs/:id/members/:userId; any origin removes any member from any organization using victim admin session, disrupting active collaborators and breaking CI service accounts; fix: allowlist + requireRole('admin') + ownership check + audit log + member removal notification

CORS51-001 — Credential-bearing CORS on member list exposes email addresses, role assignments, 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. Cross-origin JavaScript can read the full organization member roster using the victim's session cookie.

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 that have not yet been accepted — these represent email addresses of people who have been invited but are not yet members, often including contractors, external collaborators, and partner organization contacts. An attacker who harvests this list gains a targeted phishing list for the organization, with role information that makes social engineering highly convincing. For example, knowing that a specific email is the organization owner enables credential phishing attacks that impersonate the registry with specific role context. Pending invites are especially valuable because the invitees are expecting communication from the registry and may be less suspicious of follow-up messages.

Vulnerable
// GET /api/orgs/:id/members — cors({origin:true,credentials:true}) inherited from router
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 addresses
});
Fixed
// GET /api/orgs/:id/members — per-route allowlist cors + org membership gate
router.get('/:id/members', memberCors, requireSession, async (req, res) => {
  // Caller must be a member of this org to see the member list
  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

  // Email visible only to admins and owners
  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 } : {}),
  })));
});

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 endpoint processes invite dispatch requests without validating that the caller is an org admin or that the invitee's email domain is permitted by the organization's domain allowlist policy. Any web page that induces the victim admin's browser to issue a cross-origin POST can dispatch invitations to arbitrary email addresses.

The practical impact has two dimensions. First, consuming the organization's invite quota prevents legitimate admin onboarding until the queue is cleared. Second, the dispatched invitations arrive from the registry's own email domain and appear as legitimate admin-issued invites — they 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. The fix removes the wildcard, requires session authentication independently, 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.

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 and CSRF validation independently of the CORS policy, and validate that the caller has the authority to grant the requested role 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, letting an attacker rank organizations by onboarding activity and prioritize them for CORS51-001 email harvesting.

Organizations in active onboarding phases are particularly valuable targets: their pending invite list includes external email addresses that are not yet members, and those invitees are expecting registry communication. Harvesting pending invite email addresses through CORS51-001 and then impersonating onboarding confirmation emails is a high-conversion phishing vector because the recipient has an open mental model for the registry at the moment the phishing email arrives.

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.

CORS51-004 — Credential-bearing CORS on member removal disrupts collaborators and breaks 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. The impacted organization discovers the removal by investigating CI failures, not by receiving a membership change alert, since service account removal does not always trigger the same notification flow as human member removal.

Vulnerable
// DELETE /api/orgs/:id/members/:userId
// No ownership check, no confirmation gate, 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();
});
Fixed
// DELETE /api/orgs/:id/members/:userId
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' });

  // Owners can only be removed by other owners
  const target = await OrgMember.findOne({
    orgId: req.params.id,
    userId: req.params.userId,
  });
  if (!target) return res.status(404).json({ error: 'Not found' });
  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();
});

Remediation summary

FindingSeverityPrimary remediationSecondary hardening
CORS51-001CriticalReplace origin:true with allowlist; gate member list on org membership; omit email from public responseAdmin-only email field; role-scoped member metadata
CORS51-002HighRemove ACAO: *; require session, CSRF token; validate invite via Zod InviteSchemaDomain allowlist validation; invite quota enforcement per org
CORS51-003MediumAuth before CORS header emission; unified WHERE clause with membership subqueryConstant-time 403/404 latency floor
CORS51-004CriticalReplace origin:true with allowlist; requireRole('admin'); org ownership checkAudit log; member removal notification; owner-only owner removal path

Find CORS misconfigurations like these before attackers do. SkillAudit scans your MCP skill registry organization endpoints for all four SA-SKL-CORS51 patterns plus the broader CORS advisory series. See the SA-SKL-CORS50 billing subscription advisory and the SA-SKL-CORS49 marketplace listing advisory for related findings. Connect your repository at skillaudit.dev.