Vulnerabilities in pkg:npm/@elysiajs/cors
PACKAGECVE-2025-50864 is a MODERATE (CVSS 6.5) elysia-cors origin validation error vulnerability (CWE-346: Origin Validation Error) affecting @elysiajs/cors libraries in the npm ecosystem. The issue involves elysia-cors origin validation error. Remediation is available by upgrading affected packages to version 1.3.1.
pkg:npm/@elysiajs/cors
Vulnerability advisories affecting package pkg:npm/@elysiajs/cors. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-f9qj-4c5x-cpcw | CVE-2025-50864 | MODERATE | elysia-cors Origin Validation Error |
CVE-2025-50864 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N).
How to Fix CVE-2025-50864
To remediate this vulnerability, upgrade all affected @elysiajs/cors dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @elysiajs/cors@1.3.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @elysiajs/cors
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-50864, inspect your project dependencies using npm:
npm ls @elysiajs/cors
Analyze the terminal output to locate any version of @elysiajs/cors in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.1), your application is affected.
Note: The npm ls @elysiajs/cors command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-346: Origin Validation Error, where the product does not properly verify that the source of data or communication is valid. In @elysiajs/cors, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-50864 Affected @elysiajs/cors Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@elysiajs/cors
|
npm |
< 1.3.1
|
1.3.1
|
References
Frequently Asked Questions
What is CVE-2025-50864?
Which @elysiajs/cors versions are affected?
What version fixes CVE-2025-50864?
Is @elysiajs/cors affected?
What is the CVSS score of CVE-2025-50864?
What CWE is associated with CVE-2025-50864?
How can I check npm dependencies for CVE-2025-50864?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f9qj-4c5x-cpcw",
"modified" : "2026-01-29T02:36:18Z",
"published" : "2025-08-20T15:31:42Z",
"aliases" : [ "CVE-2025-50864" ],
"summary" : "elysia-cors Origin Validation Error",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@elysiajs/cors"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.3.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-50864"
}, {
"type" : "WEB",
"url" : "https://github.com/elysiajs/elysia-cors/commit/9b9eb92e32a7a4b43b6d5108668941701c33e221"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/elysiajs/elysia-cors"
}, {
"type" : "WEB",
"url" : "https://github.com/elysiajs/elysia-cors/blob/main/src/index.ts"
}, {
"type" : "WEB",
"url" : "https://github.com/elysiajs/elysia-cors/tree/main"
}, {
"type" : "WEB",
"url" : "https://medium.com/@raghavagrawal_23036/cors-bypass-in-popular-opensource-library-ad27fb41e16a"
}, {
"type" : "WEB",
"url" : "http://elysiajs.com"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-178", "CWE-346" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-08-20T20:50:39Z",
"nvd_published_at" : "2025-08-20T15:15:32Z"
}
}