Skip to content

fix: bump js-cookie from 3.0.1 to 3.0.7 (CVE-2026-46625)#1368

Open
samjoffe wants to merge 5 commits into
segmentio:masterfrom
samjoffe:fix/bump-js-cookie-3.0.7
Open

fix: bump js-cookie from 3.0.1 to 3.0.7 (CVE-2026-46625)#1368
samjoffe wants to merge 5 commits into
segmentio:masterfrom
samjoffe:fix/bump-js-cookie-3.0.7

Conversation

@samjoffe

Copy link
Copy Markdown

Summary

Bumps the js-cookie dependency from 3.0.1 to 3.0.7 in packages/browser to address CVE-2026-46625 / GHSA-qjx8-664m-686j.

Vulnerability Details

The internal assign() helper in js-cookie copies properties with for...in + plain assignment. When the source object is produced by JSON.parse, a "__proto__" member is enumerable and triggers the Object.prototype.__proto__ setter, resulting in a per-instance prototype hijack. An attacker can inject cookie attributes like domain, secure, samesite, expires, and path into cookies whose attributes the developer thought were locked down.

  • Severity: High (CVSS 7.5)
  • CWE: CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes)
  • Patched in: js-cookie 3.0.7

Changes

  • packages/browser/package.json: js-cookie 3.0.13.0.7
  • yarn.lock: updated accordingly

References

samjoffe added 2 commits May 21, 2026 16:19
Bumps js-cookie from 3.0.1 to 3.0.7 to fix a per-instance prototype
hijack in assign() that enables cookie-attribute injection.

See: GHSA-qjx8-664m-686j
Fixes: segmentio#1367
@changeset-bot

changeset-bot Bot commented May 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5140f2e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@segment/analytics-next Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ruriarte-zaelot

Copy link
Copy Markdown

Is there a reason to fix this dependency to a fixed version rather than just allowing updates within the same major version?
"js-cookie": "^3.0.7",
Other deps here use the caret, so it is easier to update them in case of future CVEs. Also is there any chance to backport this to v1?

samjoffe added 2 commits May 28, 2026 11:00
Per reviewer feedback, use ^3.0.7 instead of exact 3.0.7 to match
the caret convention used by other deps in this package and to
allow automatic pickup of future patch releases.
@samjoffe

Copy link
Copy Markdown
Author

@ruriarte-zaelot Good call on the caret — updated to "js-cookie": "^3.0.7" to match the convention of the other deps. See latest commits.

Regarding backporting to v1: @segment/analytics-next is currently on v1 (latest npm is 1.84.0), so this PR targeting master already covers the v1 release line. If you mean something different by "v1" (e.g., the classic analytics.js library), happy to look into that as well — just let me know!

@LukeBrandon

Copy link
Copy Markdown

@MichaelGHSeg

@OS-teresamarcelino

OS-teresamarcelino commented Jun 15, 2026

Copy link
Copy Markdown

When do we expect to merge this bump?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: Bump js-cookie from 3.0.1 to 3.0.7 (CVE-2026-46625)

6 participants