CVE-2025-50864: elysia-cors Origin Validation Error
(updated )
An Origin Validation Error in the elysia-cors library thru 1.3.0 allows attackers to bypass Cross-Origin Resource Sharing (CORS) restrictions. The library incorrectly validates the supplied origin by checking if it is a substring of any domain in the site’s CORS policy, rather than performing an exact match. For example, a malicious origin like “notexample.com”, “example.common.net” is whitelisted when the site’s CORS policy specifies “example.com.” This vulnerability enables unauthorized access to user data on sites using the elysia-cors library for CORS validation.
References
- github.com/advisories/GHSA-f9qj-4c5x-cpcw
- github.com/elysiajs/elysia-cors
- github.com/elysiajs/elysia-cors/blob/main/src/index.ts
- github.com/elysiajs/elysia-cors/commit/9b9eb92e32a7a4b43b6d5108668941701c33e221
- github.com/elysiajs/elysia-cors/tree/main
- medium.com/@raghavagrawal_23036/cors-bypass-in-popular-opensource-library-ad27fb41e16a
- nvd.nist.gov/vuln/detail/CVE-2025-50864
Code Behaviors & Features
Detect and mitigate CVE-2025-50864 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →