CVE-2023-49803
JavaScript vulnerability analysis and mitigation

Overview

The vulnerability (CVE-2023-49803) affects @koa/cors npm package, a Cross-Origin Resource Sharing (CORS) middleware for the Koa web framework in Node.js. Prior to version 5.0.0, the middleware's default behavior would return an Access-Control-Allow-Origin header with the value of the origin from the request when no allowed origin was provided, effectively disabling the Same Origin Policy (SOP). This vulnerability was discovered and disclosed on December 11, 2023 (GitHub Advisory).

Technical details

The vulnerability stems from the middleware's default configuration where, if no origin is specified, it automatically returns the requesting origin in the Access-Control-Allow-Origin header. This behavior effectively bypasses the Same Origin Policy, a crucial security mechanism in web browsers. The vulnerability has been assigned a CVSS v3.1 base score of 7.5 (HIGH) by NVD and 8.6 (HIGH) by GitHub, with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N (NVD).

Impact

The vulnerability's impact is significant as it completely disables one of the most crucial security elements of browsers - the Same Origin Policy (SOP). This could lead to serious security threats by allowing any origin to make requests to the server, potentially enabling cross-site request forgery (CSRF) attacks and unauthorized data access (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been fixed in version 5.0.0 of @koa/cors. The fix changes the default behavior to return '*' as the Access-Control-Allow-Origin value instead of mirroring the request's origin. For users who need to maintain the previous behavior, they can explicitly set the origin handler to return the request's origin: app.use(cors({ origin(ctx) { return ctx.get('Origin') || '*'; } })) (GitHub Patch).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-23947CRITICAL9.3
  • JavaScriptJavaScript
  • @orval/core
NoYesJan 20, 2026
CVE-2026-23950HIGH8.8
  • JavaScriptJavaScript
  • grafana-graphite
NoYesJan 20, 2026
CVE-2026-22037HIGH8.4
  • JavaScriptJavaScript
  • @fastify/express
NoYesJan 19, 2026
CVE-2026-23522LOW3.7
  • JavaScriptJavaScript
  • @lobehub/chat
NoNoJan 19, 2026
CVE-2025-66803LOW1.7
  • JavaScriptJavaScript
  • @hotwired/turbo
NoYesJan 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management