CVE-2023-49803: @koa/cors Overly Permissive Origin Policy Vulnerability
HIGHCVE-2023-49803 is a HIGH (CVSS 8.6) overly permissive origin policy vulnerability (CWE-346: Origin Validation Error) affecting @koa/cors libraries in the npm ecosystem. The issue involves overly permissive origin policy. Remediation is available by upgrading affected packages to version 5.0.0.
CVE-2023-49803 at a Glance
Security Impact
CVSS: 8.6
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:N/S:C/C:N/I:H/A:N).
How to Fix CVE-2023-49803
To remediate this vulnerability, upgrade all affected @koa/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 @koa/cors@5.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @koa/cors
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-49803, inspect your project dependencies using npm:
npm ls @koa/cors
Analyze the terminal output to locate any version of @koa/cors in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.0), your application is affected.
Note: The npm ls @koa/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 @koa/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-2023-49803 Affected @koa/cors Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@koa/cors
|
npm |
< 5.0.0
|
5.0.0
|
References
Frequently Asked Questions
What is CVE-2023-49803?
Which @koa/cors versions are affected?
What version fixes CVE-2023-49803?
Is @koa/cors affected?
What is the CVSS score of CVE-2023-49803?
What CWE is associated with CVE-2023-49803?
How can I check npm dependencies for CVE-2023-49803?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qxrj-hx23-xp82",
"modified" : "2023-12-12T00:46:36Z",
"published" : "2023-12-11T21:46:21Z",
"aliases" : [ "CVE-2023-49803" ],
"summary" : "Overly permissive origin policy",
"details" : "Currently, the middleware operates in a way that if an allowed origin is not provided, it will return an `Access-Control-Allow-Origin` header with the value of the origin from the request. This behavior completely disables one of the most crucial elements of browsers - the Same Origin Policy (SOP), this could cause a very serious security threat to the users of this middleware.\n\nIf such behavior is expected, for instance, when middleware is used exclusively for prototypes and not for production applications, it should be heavily emphasized in the documentation along with an indication of the risks associated with such behavior, as many users may not be aware of it.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@koa/cors"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/koajs/cors/security/advisories/GHSA-qxrj-hx23-xp82"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-49803"
}, {
"type" : "WEB",
"url" : "https://github.com/koajs/cors/commit/f31dac99f5355c41e7d4dd3c4a80c5f154941a11"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/koajs/cors"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-346" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-12-11T21:46:21Z",
"nvd_published_at" : "2023-12-11T23:15:07Z"
}
}