Update dependency js-cookie to v3.0.7 [SECURITY]#3886
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
Coverage Report for CI Build 26257182573Coverage remained the same at 42.322%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.0.5→3.0.7JavaScript Cookie: Per-instance prototype hijack in assign() enables cookie-attribute injection
CVE-2026-46625 / GHSA-qjx8-664m-686j
More information
Details
Summary
js-cookie's internalassign()helper copies properties withfor...in+ plain assignment. When the source object is produced byJSON.parse, the JSON object's"__proto__"member is an own enumerable property, so thefor…inenumerates it and thetarget[key] = source[key]write triggers theObject.prototype.__proto__setter on the freshtarget({}). The result is a per-instance prototype hijack:Object.prototypeitself is untouched, but the mergedattributesobject now inherits attacker-controlled keys.Because the consuming
set()function then enumerates the merged object with anotherfor...in, every key the attacker placed on the polluted prototype lands in the resultingSet-Cookiestring as an attribute pair. The attacker can setdomain=,secure=,samesite=,expires=, andpath=on cookies whose attributes the developer thought were locked down.Impact
Any application that forwards a JSON-derived object as the
attributesargument toCookies.set,Cookies.remove,Cookies.withAttributes, orCookies.withConverteris vulnerable. This is the standard pattern when cookie configuration comes from a backend:A payload of
{"__proto__":{"domain":"evil.example","secure":"false","samesite":"None"}}causes js-cookie to emit:Affected code
Proof of concept
Node 22.11.0, no third-party deps:
Environment setup
PoC
Execution:

Suggested patch
Equivalent one-liner alternative - iterate own names only and filter:
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
js-cookie/js-cookie (js-cookie)
v3.0.7Compare Source
eb3c40e)Partitionedattribute to readme (b994768)4dc71be)get('name')+get()(1953d30)v3.0.6Compare Source
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.