Skip to content

GHSA-pxg6-pf52-xh8x CVE-2024-47764

cookie accepts cookie name, path, and domain with out of bounds characters

Medium npm
Severity
6.9 / 10
Medium · CVSS 4.0
Exploit chance (EPSS)
0.74%
Chance of exploitation in the next 30 days. Higher than 54.78% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Fix
0.7.0
Upgrade cookie to this version or later

Description

Impact

The cookie name could be used to set other fields of the cookie, resulting in an unexpected cookie value. For example, serialize("userName=<script>alert('XSS3')</script>; Max-Age=2592000; a", value) would result in "userName=<script>alert('XSS3')</script>; Max-Age=2592000; a=test", setting userName cookie to <script> and ignoring value.

A similar escape can be used for path and domain, which could be abused to alter other fields of the cookie.

Patches

Upgrade to 0.7.0, which updates the validation for name, path, and domain.

Workarounds

Avoid passing untrusted or arbitrary values for these fields, ensure they are set by the application instead of user input.

References

Affected versions

npm

PackageVulnerableFixed in
cookie
< 0.7.0
0.7.0

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

cookie npm → 0.7.0

npm
npm install cookie@0.7.0
yarn
yarn add cookie@0.7.0
pnpm
pnpm add cookie@0.7.0

Severity breakdown

CVSS 4.0 6.9

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Attack vector
Network
Attack complexity
Low
Attack requirements
None
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
None
Integrity (vulnerable system)
Low
Availability (vulnerable system)
None
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None
Exploit maturity
Not defined
Scope
X

Weakness

CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.

How to prevent it
  • Requirements: Programming languages and supporting technologies might be chosen which are not subject to these issues.
  • Implementation: Utilize an appropriate mix of allowlist and denylist parsing to filter control-plane syntax from all input.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-j8rh-479h-cp32
Axios: Header Injection via Inherited headers After Minimal Interceptor
Medium Same weakness, CWE-74
GHSA-4hqw-qxg8-jxx2
Axios: Fetch Adapter Header Injection via Inherited FormData getHeaders
Medium Same weakness, CWE-74
GHSA-h58c-xccx-75m3
Coder: Stored HTML injection via unescaped ApplicationName and LogoURL appearance settings
Medium Same weakness, CWE-74
GHSA-5rw4-4665-cvwf
Froxlor DomainZones.add allows DNS zone-file RR injection via record/type fields
Medium Same weakness, CWE-74
GHSA-jm78-9fvv-mhgr
GitPython: git-config OPTION-name injection via =/#/whitespace bypasses name validator, enabling forged core.sshCommand/hooksPath (RCE)
High Same weakness, CWE-74
EEF-CVE-2026-68747
CSS sanitizer allowlist bypass in html_sanitize_ex via non-declaration input
Medium Same weakness, CWE-74
GHSA-9473-5f9j-94wq
Nuxt: Server-Side Remote Code Execution via Runtime Template Injection in Nuxt Server Island Props
High Same weakness, CWE-74
GHSA-v3r7-h72x-cjcm
undici vulnerable to cookie attribute injection via unsanitized domain and unparsed setCookie fields
Medium Same weakness, CWE-74
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor