decentraland / decentraland/events

CORS allowlist regex is unanchored (vercel preview pattern)

Open
#950 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
7
Forks
11
Avg merge
18h 48m
Merged PRs (30d)
4

Description

## Summary
`src/server.ts:53` — the CORS origin regex `/https:\/\/([a-zA-Z0-9\-_])+-decentraland1\.vercel\.app/` lacks an end anchor (`$`). Verified: `Origin: https://example-decentraland1.vercel.app.attacker.com` matches, so an attacker-controlled origin is treated as allowed.

## Impact
Cross-origin reads of the events API from attacker origins. Limited today because the events API does not use cookie-based auth (signed-fetch headers are not auto-attached cross-origin), so it mainly exposes public data — but the allowlist is unsound.

## Fix
Anchor the regex (`^...$`).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.