CVE-2023-49803

@koa/cors has overly permissive origin policy

8.6 high EPSS 0.28%

Published 11 Dec 2023 Updated 2 Aug 2024 CNA: GitHub_M

Check your servers for CVE-2023-49803

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2023-49803 affects cors, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

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

Severity (CVSS)

8.6 high CVSS 3.1 from GitHub_M (CNA)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
Attack vector
network: an attacker can reach the vulnerable part over the network, often from the internet
Attack complexity
low: an attack works without special conditions
Privileges required
none: the attacker does not need an account
User interaction
none: nobody has to click or open anything
Scope
changed: the damage reaches other components, such as the host of a container or other users
Impact
confidentiality none, integrity high, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.28%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 21.7% of all scored CVEs. Scores of 1 Dec 2026.

Weakness

Affected products

As the CNA lists them.

ProductVersions
cors
affected < 5.0.0

Is my server affected?

Find the installed version of cors and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i cors
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2023-49803 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2023-49803

RHEL, Rocky, Alma, Fedora

rpm -q cors
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2023-49803

Alpine

apk list --installed | grep -i cors

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2023-49803
trivy image --scanners vuln IMAGE | grep CVE-2023-49803

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Advisories

Other references

Source: the record CVE-2023-49803 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.