Skip to content
Heist/ feed
Back to feed
High

@koa/cors has overly permissive origin policy

Type: advisorySources: OSV

@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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2023-49803
Confirmed fixed CVEs
Not specified
Updated in this feed
7 Nov 2026, 12:04 UTC · Revision 1

Source evidence

@koa/cors has overly permissive origin policy

core-osv · Original source

Published 11 Dec 2023, 22:42 UTC

@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.

osv:CVE-2023-49803
Complete source record
{
  "id": "91e0aff5f7f29a883699d2f541c863287043619800edf9c2acc6e31bf3d3583f",
  "url": "https://osv.dev/vulnerability/CVE-2023-49803",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "@koa/cors has overly permissive origin policy",
    "summary": "@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.",
    "evidence": "osv:CVE-2023-49803",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2023-49803",
      "aliases": [
        "CVE-2023-49803",
        "GHSA-qxrj-hx23-xp82"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/koajs/cors",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "c33bd6913fe93e2a2b6902985e257a0e472199c4"
                },
                {
                  "fixed": "f31dac99f5355c41e7d4dd3c4a80c5f154941a11"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:koajs:cross-origin_resource_sharing_for_koa:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "5.0.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "f31dac99f5355c41e7d4dd3c4a80c5f154941a11"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "4.0.0",
            "3.4.3",
            "3.4.2",
            "3.4.1",
            "3.4.0",
            "3.3.0",
            "3.2.0",
            "3.1.0",
            "3.0.0",
            "2.2.3",
            "2.2.2",
            "2.2.1",
            "2.2.0",
            "2.1.1",
            "2.1.0",
            "2.0.0",
            "1.0.1",
            "1.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-49803.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:50.626930990Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/49xxx/CVE-2023-49803.json",
        "https://github.com/koajs/cors/security/advisories/GHSA-qxrj-hx23-xp82",
        "https://nvd.nist.gov/vuln/detail/CVE-2023-49803",
        "https://github.com/koajs/cors/commit/f31dac99f5355c41e7d4dd3c4a80c5f154941a11"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-346"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/49xxx/CVE-2023-49803.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2023-49803",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 519224,
  "published_at": "2023-12-11T22:42:17.547+00:00"
}