Vulnerabilities in pkg:npm/datatables.net

PACKAGE
Advisory Identifier: GHSA-h73q-5wmj-q8pj
Advisory Summary

CVE-2021-23445 is a MODERATE (CVSS 6.1) cross site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Datatables.net libraries in the npm ecosystem. The issue involves cross site scripting in datatables.net. Remediation is available by upgrading affected packages to version 1.11.3.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/datatables.net

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/datatables.net. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-h73q-5wmj-q8pj CVE-2021-23445 MODERATE Cross site scripting in datatables.net
GHSA-m7j4-fhg6-xf5v CVE-2020-28458 HIGH datatables.net vulnerable to Prototype Pollution due to incomplete fix

CVE-2021-23445 at a Glance

CVE Identifier CVE-2021-23445
GHSA Identifier GHSA-h73q-5wmj-q8pj
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Datatables.net
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2021-23445

To remediate this vulnerability, upgrade all affected Datatables.net dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

datatables.net fixed: 1.11.3
npm install datatables.net@1.11.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls datatables.net

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-23445, inspect your project dependencies using npm:

npm ls datatables.net

Analyze the terminal output to locate any version of Datatables.net in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.11.3), your application is affected.

Note: The npm ls datatables.net 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Datatables.net, 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

This affects the package datatables.net before 1.11.3. If an array is passed to the HTML escape entities function it would not have its contents escaped.

CVE-2021-23445 Affected Datatables.net Versions

1 component(s)
Fixed Versions:
1.11.3
Product / Package Ecosystem Affected Versions Fixed Version
datatables.net
npm
< 1.11.3
1.11.3

References

Frequently Asked Questions

What is CVE-2021-23445?
CVE-2021-23445 is a security vulnerability in Datatables.net involving Cross site scripting in datatables.net under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Datatables.net versions are affected?
Affected versions include releases prior to 1.11.3 across affected packages: datatables.net.
What version fixes CVE-2021-23445?
Upgrading to 1.11.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is datatables.net affected?
Yes, datatables.net is affected in releases prior to 1.11.3. Upgrade your dependency to 1.11.3 or later.
What is the CVSS score of CVE-2021-23445?
CVE-2021-23445 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2021-23445?
CVE-2021-23445 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2021-23445?
Run the dependency tree command: 'npm ls datatables.net'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h73q-5wmj-q8pj",
  "modified" : "2024-06-21T22:11:09Z",
  "published" : "2021-09-29T17:11:28Z",
  "aliases" : [ "CVE-2021-23445" ],
  "summary" : "Cross site scripting in datatables.net ",
  "details" : "This affects the package datatables.net before 1.11.3. If an array is passed to the HTML escape entities function it would not have its contents escaped.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "datatables.net"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.11.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23445"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/DataTables/Dist-DataTables/commit/59a8d3f8a3c1138ab08704e783bc52bfe88d7c9b"
  }, {
    "type" : "WEB",
    "url" : "https://cdn.datatables.net/1.11.3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/DataTables/Dist-DataTables"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2023/08/msg00018.html"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240621-0006"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWER-1715371"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1715376"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-DATATABLESNET-1540544"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-09-28T18:53:31Z",
    "nvd_published_at" : "2021-09-27T17:15:00Z"
  }
}