Next.js v9.5.4 Release Notes

Release Date: 2020-10-07 // over 3 years ago
  • โฌ†๏ธ This upgrade is completely backwards compatible and recommended for all users on versions below 9.5.4. For future security related communications of our OSS projects, please join this mailing list.

    ๐Ÿ”’ A security team from one of our partners noticed an issue in Next.js that allowed for open redirects to occur.

    Specially encoded paths could be used with the trailing slash redirect to allow an open redirect to occur to an external site.

    In general, this redirect does not directly harm users although can allow for phishing attacks by redirecting to an attackers domain from a trusted domain.

    ๐Ÿ”’ We recommend upgrading to the latest version of Next.js to improve the overall security of your application.

    โฌ†๏ธ How to Upgrade

    • ๐Ÿš€ We have released patch versions for both the stable and canary channels of Next.js.
    • โฌ†๏ธ To upgrade run npm install next@latest --save

    Impact

    • Affected : Users of Next.js between 9.5.0 and 9.5.3
    • Not affected : Deployments on Vercel (https://vercel.com) are not affected
    • Not affected : Deployments using next export

    โฌ†๏ธ We recommend everyone to upgrade regardless of whether you can reproduce the issue or not.

    How to Assess Impact

    ๐Ÿ”Š If you think users could have been affected, you can filter logs of affected sites by %2F with a 308 response.

    What is Being Done

    ๐Ÿ”’ As Next.js has grown in popularity, it has received the attention of security teams and auditors. We are thankful to those that reached out for their investigation and discovery of the original bug and subsequent responsible disclosure.

    We've landed a patch that ensures encoding is handled properly for these types of redirects so the open redirect can no longer occur.

    ๐Ÿ”’ Regression tests for this attack were added to the security integration test suite.

    • We have notified known Next.js users in advance of this publication.
    • ๐Ÿš€ A public CVE was released.
    • ๐Ÿ”’ If you want to stay on top of our security related news impacting Next.js or other Vercel projects, please join this mailing list.
    • ๐Ÿ”’ We encourage responsible disclosure of future issues. Please email us at [email protected]. We are actively monitoring this mailbox.

    Core Changes

    • ๐Ÿ‘‰ Make the image post-processor ignore SVG images: #16732
    • โšก๏ธ Only update lookups for dev overlay if mounted: #16776
    • Ensure interpolating dynamic href values works correctly: #16774
    • โž• Add automatic reloading when editing GS(S)P methods: #16744
    • โšก๏ธ Update to show build indicator while re-fetching GS(S)P data in dev: #16789
    • ๐Ÿ“œ make parseRelativeUrl return a UrlObject: #16809
    • โž• Add tests for searchParams dev warning: #16798
    • ๐Ÿ›  Fix invalid config export errors: #16834
    • Correct client rewrite resolving with query: #16860
    • ๐Ÿ›  Fix href resolving with trailing slash enabled: #16873
    • ๐Ÿ— Divide export build output into 4 segments instead of showing it one by one: #16815
    • Include additional query values when interpolating href: #16878
    • Correct page path for GS(S)P data refreshing: #16939
    • ๐Ÿ›  Fix align documentation with the code: #16843
    • โœ‚ Remove next-head-count: #16758
    • โž• Add Support for CSS Module Value Imports: #16973
    • ๐Ÿ›  Fix resolving href with a rewrite: #16975
    • Correct query behavior for falsey values to pre 9.5.1 behavior: #16608
    • Importing CSS from Third Party React Components: #16993
    • โž• Add error when href interpolation fails: #16946
    • ๐Ÿ”’ Security upgrade node-fetch: #17009
    • โฌ†๏ธ Upgrade sass loader: #16970
    • Prefer builtin optional chaining and nullish coalescing: #16780
    • โฌ†๏ธ Upgrade cacache of terser-webpack-plugin: #17022
    • โฌ†๏ธ Upgrade web-vitals: #17028
    • โœ‚ Remove false positive in circular structure detection: #16380
    • ๐Ÿ›  Fix Webpack 5 configuration for v5.0.0-beta.30: #17038
    • ๐Ÿ‘Œ Improve custom document error message: #17048
    • ๐Ÿ‘‰ Use babel 7 jsx syntax: #17043
    • ๐Ÿ”ง [Fix] [email protected]: Invalid configuration: #17045
    • Normalize asPath for GS(S)P pages: #17081
    • ๐Ÿ’ป Polyfill missing std lib fns for module browsers: #17083
    • Provide resolvedUrl to getServerSideProps: #17082
    • ๐Ÿ›  Fix API page check during SSG page collecting: #17092
    • โšก๏ธ Update webpack 5 resolving: #17095
    • Separate resolved asPath from resolved URL for GSSP: #17121
    • ๐Ÿ›  Fix export-cli progress label default value: #17106
    • ๐Ÿ‘Œ Improve server performance by skipping decode/re-encode: #17323
    • โœ‚ Remove extra check in config loading: #17336
    • ๐Ÿ”ฆ Expose dotenv loading under separate package: #17152
    • ๐Ÿ›  Fix empty title in head: #17430
    • Ensure optional-chaining/nullish coalescing is included: #17429
    • โœ‚ Remove left-over api-utils method: #17595
    • โž• Add warning when exporting with custom routes: #17538
    • Normalize optional catch-all fallback: true page params: #17551
    • โšก๏ธ Update to use hasNextSupport for custom-routes in next export check: #17630

    ๐Ÿ“š Documentation Changes

    • โž• Add Fast Refresh Demo: #16576
    • โšก๏ธ Update dynamic-import docs: #16803
    • โšก๏ธ Update link docs to reflect changes on dynamic routing (#16634)
    • โž• Add handling for redirects from getStaticProps/getServerSideProps (#16642)
    • ๐Ÿ‘ Document CSS Grid Better: #16996
    • ๐Ÿ‘Œ Improve Asset Prefix Docs: #16998
    • โšก๏ธ Update build time env variable link in the runtime config section: #17017
    • ๐Ÿ›  fix gtag syntax in measuring docs: #16933
    • ๐Ÿ“„ docs(babelrc): precise usage without configuring plugins: #16779
    • ๐Ÿ‘Œ Improve Document Component Error: #17047
    • โž• Add missing comma in docs example: #17129
    • โž• Adds note about public directory: #17203
    • ๐Ÿ›  Fix invalid href error message: #17183
    • โšก๏ธ Update trailingSlash parameter name: #17228
    • โšก๏ธ Update cdn-support-with-asset-prefix.md: #17237
    • ๐Ÿ“„ Docs(api-middlewares): use typings for serialize options from @types/cookie: #17285
    • โœ‚ Remove reference to now env example: #17341
    • Mention required version for global CSS imports in node_modules: #17506
    • ๐Ÿ“„ Mention favicon.ico in static file serving docs.: #17540
    • โž• Add note about priority to rewrites docs: #17535
    • ๐Ÿ“„ [docs] Fix typo Next.js -> TypeScript: #17561
    • โž• Add missing introductory exportPathMap purpose description: #17444
    • โž• Add docs on how to migrate from Gatsby.: #17491
    • โšก๏ธ Update migrating from Gatsby docs.: #17636
    • ๐Ÿ”„ change anonymous functions to named in docs examples: #17510

    Example Changes

    • ๐Ÿ‘ฎ force persistor persist again after persistStore bootstrap done: #16085
    • Create _document.js to include current language in HTML tag: #16360
    • [Example] Fix relay network request: #16525
    • Minor spelling fix in zones example's readme: #16822
    • โšก๏ธ Update with-stitches example: #16827
    • Undo unrequired readme changes done to examples: #16831
    • chore(examples): fix missing document components error messages: #16802
    • ๐Ÿ“ˆ Use useRouter over Router for with-google-analytics example: #16846
    • โšก๏ธ chore: update example names to match their folders: #16268
    • [EXAMPLE] with-cssed: #16735
    • โšก๏ธ update nextjs-auth0 versionfor auth0 example: #16871
    • โœ‚ Remove path specific switch statement from http2 example: #16558
    • ๐Ÿ›  Fix Three.js example's BoxesPage variable name: #16900
    • ๐Ÿ›  Fix extension name for example app (#16916)
    • ๐Ÿ›  Fix typo in Pet mongoose model: #16943
    • Ignore .next also in subfolders: #16962
    • โšก๏ธ Update with-slate example: #16959
    • โž• Adding globalStyled with styled components: #16783
    • โšก๏ธ Updates "msw" package to version 0.21.0: #17012
    • ๐Ÿ”Š Examples blogs: fix spelling: #17049
    • Include all files in Prettier: #17050
    • feat(examples/with-react-intl): add locale negotation to client side: #16806
    • โšก๏ธ Update PatternFly example to v4: #17241
    • ๐Ÿ›  Fix for missing babel dependencies in with-rebass example: #16839
    • ๐Ÿ‘• [Example] With TS Eslint Jest - unnecessary package: #17170
    • [Example] with-react-intl: fix getInitialProps props ordering: #17174
    • [Example] with-react-intl: fix doubling messages: #17175
    • โšก๏ธ [Examples] Optimize with-docker: #17116
    • โž• Add with-chakra-ui-typescript example: #16561
    • โœ‚ Delete vercel.json from "yarn workspaces" example: #17263
    • โž• Add project name to examples/with-three-js create command: #17256
    • โšก๏ธ Example: with-next-auth updated to v3: #17266
    • ๐Ÿ›  fix(examples/with-redux-wrapper): wrong initial state (close #17299): #17335
    • โšก๏ธ Update README.md: #17347
    • ๐Ÿ›  Fix a small typo in index.css: #17399
    • ๐Ÿ›  Fixed minor typo: #17456
    • ๐Ÿ“ˆ with-google-analytics-amp needs in Document component: #17462
    • โšก๏ธ update README for vercel.app, stream.new: #17539
    • ๐Ÿ‘Œ Improve formatting in examples: #17571
    • ๐Ÿ›  Fixes #16431: #17610
    • ๐Ÿ›  fix typo: #17653

    Misc Changes

    • โšก๏ธ Update to check for overlay in client nav tests: #17002
    • โšก๏ธ Update workflow to use latest webpack 5 beta
    • ๐Ÿ›  fix(eslint-plugin-next): support src/pages folder in no-html-link-for-pages rule: #16743
    • โšก๏ธ Update no-document-viewport-meta.md
    • ๐Ÿ“„ Rename exportTrailingSlash to trailingSlash in docs: #17268
    • โœ‚ Remove duplicate should in test name: #17303
    • โœ‚ Remove Random Blank Line in create-next-app: #17328
    • ๐Ÿš€ Update release stats workflow: #17533
    • ๐Ÿš€ Update release stats workflow: #17580
    • โœ… test(create-next-app): increase coverage: #17507
    • ๐Ÿš€ Update release stats workflow step to restore cache: #17656

    Credits

    Huge thanks to @YichiZ, @weichienhung, @atcastle, @ijjk, @seosmmbusiness, @HsuTing, @gsimone, @peduarte, @Janpot, @ztanner, @lfades, @neighborhood999, @chibicode, @merceyz, @opudalo, @lunchboxav, @mohsen1, @akd-io, @justman00, @helloworld, @devknoll, @borekb, @HaNdTriX, @ArthurMaverick, @sakito21, @TrySound, @omBratteng, @svenheden, @hallaji, @kettanaito, @vvo, @m-lautenbach, @jensmeindertsma, @Zeko369, @Timer, @longlho, @stefanprobst, @laugharn, @sdornan, @daneroo, @mohd-akram, @austingmhuang, @sphilee, @devinekadeni, @Bacher, @nghiepit, @tomasdisk, @leader22, @paulogdm, @284km, @belgattitude, @geritol, @stigkj, @sampoder, @samrobbins85, @Pitasi, @digitalPlayer1125, @timfee, @plug-n-play, @philihp, @leerob, @dylanjha, @Kerumen, @rdimaio, @jorisw, @zerbinidamata, @jamesgeorge007, @Jashnm, and @futantan for helping!