{"id":"CVE-2023-49803","published":"2023-12-11T22:42:17Z","modified":"2024-08-02T22:01:26Z","title":"@koa/cors has overly permissive origin policy","vendor":"koajs","product":"cors","tier":"tail","description":{"text":"@koa/cors npm provides Cross-Origin Resource Sharing (CORS) for koa, a web framework for Node.js. Prior to version 5.0.0, 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. If 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. Version 5.0.0 fixes this vulnerability.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.6,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00279,"percentile":0.20786,"provenance":"source"},"cwes":[{"id":"CWE-346","name":"Origin Validation Error"}],"references":[{"url":"https://github.com/koajs/cors/security/advisories/GHSA-qxrj-hx23-xp82","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/koajs/cors/commit/f31dac99f5355c41e7d4dd3c4a80c5f154941a11","tags":["x_refsource_MISC"]}],"priority":{"score":10.2,"factors":[{"name":"EPSS percentile","points":4.16},{"name":"CVSS severity","points":6.02}]},"vendorSlug":"koajs","affectedVersions":[{"vendor":"koajs","product":"cors","versions":["< 5.0.0"]}],"affected":[{"ecosystem":"npm","package":"@koa/cors","vulnerableRanges":["<5.0.0"],"patched":["5.0.0"],"from":["GHSA-qxrj-hx23-xp82"],"provenance":"source"}],"summary":{"text":"The @koa/cors npm package, the CORS middleware for the Koa Node.js framework, has an overly permissive origin policy in versions before 5.0.0. When no allowed origin is configured, it reflects the request's origin back in the Access-Control-Allow-Origin header, which disables the browser's Same Origin Policy for that application. An attacker on the network can exploit this without authentication or user interaction by making cross-origin requests to the affected application, and the attack relies only on the application running this middleware with its default origin handling.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:59:16Z"},"euvd":{"id":"EUVD-2023-3277","exploited":false,"provenance":"source"}}