Update dependency iron-session to v9 - #122
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate
Bot
force-pushed
the
renovate/iron-session-9.x
branch
from
September 2, 2026 22:51
5959832 to
454b2fa
Compare
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:
^8.0.4→^9.0.0Release Notes
vvo/iron-session (iron-session)
v9.0.1Compare Source
No code changes.
dist/index.jsanddist/index.d.tsare byte-for-byteidentical to
9.0.0; only the version number differs.9.0.0was published from a laptop because CI could not authenticate with npm,so its tarball carries no provenance attestation and cannot be verified against a
commit. That is not fixable after the fact: npm versions are immutable.
9.0.1is the same code published from CI with
provenance, so you can
check it was built from this repository at a known commit:
If you are on
9.0.0and do not care about provenance, there is no reason toupgrade.
v9.0.0Compare Source
Install
pnpm add iron-session pnpm add iron-session@8 # if you are still on Node 20 or need CommonJSHow to upgrade
Requires Node 22.13+, and the package is ESM-only (
require()works on Node22.13+). Two code changes cover most apps:
Nothing else is required.
getIronSession(req, res, options)andgetIronSession(await cookies(), options)both still work, and v9 reads v8cookies while v8 reads v9 cookies, so a deploy rolls back without signing
everyone out. Delete any
as anyyou had onawait cookies().Full guide, including removed APIs: MIGRATION.md.
⚠ BREAKING CHANGES
require()still works on Node 22.13+, whichsupports
require()of an ES module.Datevalues can no longer be stored in a session. v8 turned them into anISO string when sealing and returned a string when reading, so the type you
wrote was not the type you got back. Store
Date.now()instead.IronSession<T>properties are optional on read. A session that does notexist yet is an empty object, so the old type let
session.user.idcompileand then throw (#661).
destroy()and then saving throws. A baresave()afterdestroy()is ignored, so logout handlers that call both keepworking. Before, that save re-sealed the session and the browser kept the last
Set-Cookie, so the logout silently did not happen.updateConfig()validates and applies a new password. Passing one used tobe ignored: it kept sealing with the old password and skipped the 32-character
check.
cookieOptions.expiresin the past is rejected when saving. ADatebuiltonce at module scope drifts into the past, and the browser then discards every
cookie. Reading a session never sets a cookie, so reads are unaffected.
format was chosen by a version marker outside the seal's signature, which made
it attacker-controlled.
createSealData,createUnsealDataandcreateGetIronSessionare removed.They existed to inject a
cryptoimplementation. ImportsealData,unsealDataandgetIronSessiondirectly.uncryptois no longer a dependency.Features
nodeCookies,webCookiesandnextProxyCookies. The lastone makes sessions work in Next.js
proxy.ts/middleware.ts, includingrotation visible to the same request
(#887,
#938,
#709,
#684)
chunk: truesplits a session that does not fit in one cookie across several,capped at 4 because the
Cookierequest header is the real limit. Based on theapproach in #937 by
@sefasenturk95
onUnsealError(reason, error)reports why a cookie was rejected, as"expired","invalid"or"unknown-password". A broken password rotationused to be completely silent
previously impossible for us to reproduce
SECURITY.mdBug Fixes
getIronSession(await cookies(), options)typechecks without a cast. OurCookieStore.setwas an overload pair while Next declares a single signatureover a tuple union, so
as anyon the session that guards yourapp was the only thing that worked (#840)
ttlshorter than the 60s clock skew keeps its fullMax-Age. It used toproduce
Max-Age=0or a negative value, so the browser dropped the cookie onarrival while
save()reported success(session.user.lastSeen is a Date), instead of leaving you to find itiron-webcrypto messages,
Wrong mac prefixandInvalid expiration, escapedthe old error allowlist and threw a 500 on every request from a browser
holding that cookie, which is
HttpOnlyso the app could not clear itgetRandomValues is not a functionunder Turbopack. The runtime always hadWebCrypto, the bundler resolved the wrong
uncryptoexport condition(#898)
ttlbetween 1 and 60 producedMax-Age=0or a negative value, so thebrowser dropped the cookie on arrival while
save()reported successon the real
Set-Cookieheader. One of them used to add upname.length + seal.length + JSON.stringify(options).length~2to~1on a genuine cookie used to reshape the session without the passwordto do, instead of an opaque error from the crypto layer
Internal
CookieJar, replacing two copies of theread/save/destroy logic that had drifted apart
seconds to ~0.2s and 12 devDependencies are removed
permissions: contents: read, actions pinned by commit SHA,--frozen-lockfile, and renovate no longer automergestype-tests/typechecks against the realnext/headersandnext/servertypes, so a Next release breaks our CI instead of a user's build
core.tsis 97.4%, up from 85.9%. The cookie-store path had notests at all
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, 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.