CVE-2020-28481: Socket.io CORS Misconfiguration Vulnerability
MODERATECVE-2020-28481 is a MODERATE (CVSS 4.3) cors misconfiguration vulnerability (CWE-453: Insecure Default Variable Initialization) affecting Socket.io libraries in the npm ecosystem. The issue involves cors misconfiguration in socket.io. Remediation is available by upgrading affected packages to version 2.4.0.
CVE-2020-28481 at a Glance
Security Impact
CVSS: 4.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N).
How to Fix CVE-2020-28481
To remediate this vulnerability, upgrade all affected Socket.io 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 socket.io@2.4.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls socket.io
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-28481, inspect your project dependencies using npm:
npm ls socket.io
Analyze the terminal output to locate any version of Socket.io in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.4.0), your application is affected.
Note: The npm ls socket.io 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-453: Insecure Default Variable Initialization, where the product, by default, initializes an internal variable with an insecure or less secure value than is possible. In Socket.io, 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-2020-28481 Affected Socket.io Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
socket.io
|
npm |
< 2.4.0
|
2.4.0
|
References
Frequently Asked Questions
What is CVE-2020-28481?
Which Socket.io versions are affected?
What version fixes CVE-2020-28481?
Is socket.io affected?
What is the CVSS score of CVE-2020-28481?
What CWE is associated with CVE-2020-28481?
How can I check npm dependencies for CVE-2020-28481?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fxwf-4rqh-v8g3",
"modified" : "2023-09-11T22:46:42Z",
"published" : "2021-01-20T21:22:37Z",
"aliases" : [ "CVE-2020-28481" ],
"summary" : "CORS misconfiguration in socket.io",
"details" : "The package socket.io before 2.4.0 are vulnerable to Insecure Defaults due to CORS Misconfiguration. All domains are whitelisted by default.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "socket.io"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.4.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-28481"
}, {
"type" : "WEB",
"url" : "https://github.com/socketio/socket.io/issues/3671"
}, {
"type" : "WEB",
"url" : "https://github.com/socketio/socket.io/commit/f78a575f66ab693c3ea96ea88429ddb1a44c86c7"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWER-1056358"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1056357"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-SOCKETIO-1024859"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-346", "CWE-453" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-01-20T05:39:24Z",
"nvd_published_at" : "2021-01-19T15:15:00Z"
}
}