Vulnerabilities in pkg:npm/tough-cookie

PACKAGE
Advisory Identifier: GHSA-72xf-g2v4-qvf3
Advisory Summary

CVE-2023-26136 is a MODERATE (CVSS 6.5) tough-cookie prototype pollution vulnerability vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Tough cookie libraries in the npm ecosystem. The issue involves tough-cookie prototype pollution vulnerability. Remediation is available by upgrading affected packages to version 4.1.3.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/tough-cookie

3 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/tough-cookie. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-72xf-g2v4-qvf3 CVE-2023-26136 MODERATE tough-cookie Prototype Pollution vulnerability
GHSA-qhv9-728r-6jqg CVE-2016-1000232 MODERATE ReDoS via long string of semicolons in tough-cookie
GHSA-g7q5-pjjr-gqvp CVE-2017-15010 HIGH Regular Expression Denial of Service in tough-cookie

CVE-2023-26136 at a Glance

CVE Identifier CVE-2023-26136
GHSA Identifier GHSA-72xf-g2v4-qvf3
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product Tough cookie
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:N/S:U/C:L/I:L/A:N).

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

How to Fix CVE-2023-26136

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

tough-cookie fixed: 4.1.3
npm install tough-cookie@4.1.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 tough-cookie

How to Check if You Are Affected

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

npm ls tough-cookie

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

Note: The npm ls tough-cookie 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-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In Tough cookie, 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

Versions of the package tough-cookie before 4.1.3 are vulnerable to Prototype Pollution due to improper handling of Cookies when using CookieJar in `rejectPublicSuffixes=false` mode. This issue arises from the manner in which the objects are initialized.

CVE-2023-26136 Affected Tough cookie Versions

1 component(s)
Fixed Versions:
4.1.3
Product / Package Ecosystem Affected Versions Fixed Version
tough-cookie
npm
< 4.1.3
4.1.3

References

Frequently Asked Questions

What is CVE-2023-26136?
CVE-2023-26136 is a security vulnerability in Tough cookie involving tough-cookie Prototype Pollution vulnerability under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which Tough cookie versions are affected?
Affected versions include releases prior to 4.1.3 across affected packages: tough-cookie.
What version fixes CVE-2023-26136?
Upgrading to 4.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tough-cookie affected?
Yes, tough-cookie is affected in releases prior to 4.1.3. Upgrade your dependency to 4.1.3 or later.
What is the CVSS score of CVE-2023-26136?
CVE-2023-26136 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2023-26136?
CVE-2023-26136 is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.).
How can I check npm dependencies for CVE-2023-26136?
Run the dependency tree command: 'npm ls tough-cookie'. 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-72xf-g2v4-qvf3",
  "modified" : "2024-06-21T21:33:53Z",
  "published" : "2023-07-01T06:30:16Z",
  "aliases" : [ "CVE-2023-26136" ],
  "summary" : "tough-cookie Prototype Pollution vulnerability",
  "details" : "Versions of the package tough-cookie before 4.1.3 are vulnerable to Prototype Pollution due to improper handling of Cookies when using CookieJar in `rejectPublicSuffixes=false` mode. This issue arises from the manner in which the objects are initialized.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "tough-cookie"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.1.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-26136"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/salesforce/tough-cookie/issues/282"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/salesforce/tough-cookie/commit/12d474791bb856004e858fdb1c47b7608d09cf6e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/salesforce/tough-cookie"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/salesforce/tough-cookie/releases/tag/v4.1.3"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2023/07/msg00010.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3HUE6ZR5SL73KHL7XUPAOEL6SB7HUDT2"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6PVVPNSAGSDS63HQ74PJ7MZ3MU5IYNVZ"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240621-0006"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JS-TOUGHCOOKIE-5672873"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-07T21:39:57Z",
    "nvd_published_at" : "2023-07-01T05:15:16Z"
  }
}