Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency @redwoodjs/api to v2 [SECURITY] #86

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Aug 8, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@redwoodjs/api (source) 0.47.1 -> 2.2.5 age adoption passing confidence

GitHub Vulnerability Alerts

GHSA-3qmc-2r76-4rqp

Impact

What kind of vulnerability is it? Who is impacted?

This is an API vulnerability in Redwood's [dbAuth], specifically the dbAuth forgot password feature:

  • only projects with the dbAuth "forgot password" feature are affected
  • this vulnerability was introduced in v0.38.0

User Accounts are Vulnerable to Takeover (Hijacking)

A reset token for any user can be obtained given knowledge of their username or email via the forgot-password API. With the leaked reset token, a malicious user could request to reset a user's password, changing their credentials and gaining access to their account.

How to Determine if Projects have been Attacked

To determine if a project has been attacked, we recommend checking logs for suspicious activity; namely, the volume of requests to the forgot-password API using emails that don't exist. Another indication is if users inform you that they can't access their accounts.

If you have question or concerns, reach out via the "For More Information" section below.

Patch Releases Available

The problem has been patched on the v3 and v2 release lines. Users should upgrade to v3.3.1+ or v2.2.5+ respectively.

Workarounds

Is there a way for users to fix or remediate the vulnerability without upgrading?

We recommend upgrading to the Patch Releases above. If upgrading is not possible, there are several workarounds:

Manually strip out resetToken and resetTokenExpiresAt in the forgotPassword.handler()

Users on all release lines can have their forgotPassword.handler() function strip out the sensitive fields manually before returning

handler: (user) => {
  // your code to notify/email user of the link to reset their password...

  const = { resetToken, resetTokenExpiresAt, ...rest }

  return rest
}

Use yarn patch to manually apply the fix

Users on v3 and v2 can use [yarn patch] to apply the fix if they're using yarn v3. See the dbAuth "forgot-password" Account Takeover Vulnerability high gist for instructions.

Disable the forgot password flow entirely v3 only

Users on v3 can disable the forgot password flow entirely.


Release Notes

redwoodjs/redwood (@​redwoodjs/api)

v2.2.5

Compare Source

v2.2.4

Compare Source

v2.2.3

Compare Source

v2.2.2

Compare Source

v2.2.1

Compare Source

v2.2.0

Compare Source

v2.1.1

Compare Source

v2.1.0

Compare Source

v2.0.0

Compare Source

v1.5.2

Compare Source

v1.5.1

Compare Source

v1.5.0

Compare Source

v1.4.3

Compare Source

v1.4.2

Compare Source

v1.4.1

Compare Source

v1.4.0

Compare Source

v1.3.3

Compare Source

v1.3.2

Compare Source

v1.3.1

Compare Source

v1.3.0

Compare Source

v1.2.1

Compare Source

v1.2.0

Compare Source

v1.1.1

Compare Source

v1.1.0

Compare Source

v1.0.2

Compare Source

v1.0.1

Compare Source

v1.0.0

Compare Source

v0.50.0

Compare Source

⚠️ This release removes prior Deprecations and includes Code Modifications

Changelog

Unique contributors: 19

PRs merged: 76

Features

Fixed

Chore

Package Dependencies
View all Dependency Version Upgrades
  • fix(deps): update dependency msw to v0.39.2 #​4685 by @​renovate
  • Update dependency @​supabase/supabase-js to v1.31.1 #​4690 by @​renovate
  • Update dependency css-loader to v6.7.1 #​4691 by @​renovate
  • Update dependency graphql-helix to v1.12.0 #​4692 by @​renovate
  • Update dependency webpack-manifest-plugin to v5 #​4693 by @​renovate
  • Update dependency fastify to v3.27.4 #​4702 by @​renovate
  • Update dependency pino to v7.8.1 #​4703 by @​renovate
  • Update dependency @​clerk/clerk-js to v2.17.3 #​4706 by @​renovate
  • Update dependency @​clerk/clerk-sdk-node to v2.9.8 #​4707 by @​renovate
  • Update dependency @​clerk/types to v1.28.3 #​4708 by @​renovate
  • Update dependency @​testing-library/react to v12.1.4 #​4709 by @​renovate
  • Update dependency @​types/react to v17.0.40 #​4711 by @​renovate
  • Update graphqlcodegenerator monorepo #​4714 by @​renovate
  • Update dependency systeminformation to v5.11.7 #​4716 by @​renovate
  • Update dependency @​clerk/clerk-js to v2.17.4 #​4719 by @​renovate
  • Update dependency @​clerk/clerk-sdk-node to v2.9.9 #​4720 by @​renovate
  • chore(deps): update dependency @​clerk/types to v1.29.0 #​4721 by @​renovate
  • Update dependency systeminformation to v5.11.8 #​4726 by @​renovate
  • Update dependency eslint to v8.11.0 #​4727 by @​renovate
  • fix(deps): update dependency mime-types to v2.1.35 #​4733 by @​renovate
  • fix(deps): update dependency react-hook-form to v7.28.0 #​4740 by @​renovate
  • fix(deps): update dependency eslint-plugin-react to v7.29.4 #​4745 by @​renovate
  • chore(deps): update dependency @​clerk/clerk-sdk-node to v2.9.10 #​4746 by @​renovate
  • fix(deps): update dependency esbuild to v0.14.26 #​4747 by @​renovate
  • chore(deps): update dependency @​types/lodash to v4.14.180 #​4751 by @​renovate
  • fix(deps): update typescript-eslint monorepo to v5.15.0 #​4752 by @​renovate
  • chore(deps): update dependency cypress to v9.5.2 #​4754 by @​renovate
  • fix(deps): update dependency esbuild to v0.14.27 #​4755 by @​renovate
  • chore(deps): update dependency @​playwright/test to v1.20.0 #​4757 by @​renovate
  • chore(deps): update dependency zx to v5.3.0 #​4758 by @​renovate
  • fix(deps): update prisma monorepo to v3.11.0 #​4763 by @​renovate
  • chore(deps): update dependency zx to v6 #​4768 by @​renovate
  • chore(deps): update dependency zx to v6.0.1 #​4769 by @​renovate
  • fix(deps): update graphql-tools monorepo #​4777 by @​renovate
  • fix(deps): update dependency @​graphql-codegen/typescript-resolvers to v2.6.0 #​4779 by @​renovate
  • chore(deps): update dependency @​clerk/clerk-js to v2.17.6 #​4783 by @​renovate
  • chore(deps): update dependency @​clerk/types to v1.29.2 #​4784 by @​renovate
  • chore(deps): update dependency @​actions/exec to v1.1.1 #​4794 by @​renovate
  • chore(deps): update dependency firebase to v9.6.9 #​4795 by @​renovate
  • chore(deps): update dependency zx to v6.0.3 #​4797 by @​renovate
  • fix(deps): update dependency node-ssh to v12.0.4 #​4798 by @​renovate
  • fix(deps): update graphqlcodegenerator monorepo #​4799 by @​renovate
  • fix(deps): update dependency fastify-static to v4.6.0 #​4800 by @​renovate
  • fix(deps): update dependency pino to v7.9.1 #​4801 by @​renovate
  • fix(deps): update dependency fastify-static to v4.6.1 #​4814 by @​renovate
  • chore(deps): update dependency zx to v6.0.6 #​4821 by @​renovate
  • chore(deps): update dependency @​types/react-dom to v17.0.14 #​4829 by @​renovate
  • chore(deps): update dependency @​types/babel__core to v7.1.19 #​4839 by @​renovate
  • fix(deps): update dependency react-hook-form to v7.28.1 #​4840 by @​renovate
  • fix(deps): update dependency systeminformation to v5.11.9 #​4844 by @​renovate
  • chore(deps): update actions/cache action to v3 #​4847 by @​renovate
  • fix(deps): update dependency @​graphql-yoga/common to v0.1.0-canary-bfd2627.0 #​4857 by @​renovate
  • fix(deps): update dependency cross-undici-fetch to v0.1.27 #​4858 by @​renovate
  • chore(deps): update dependency zx to v6.0.7 #​4861 by @​renovate
  • fix(deps): update typescript-eslint monorepo to v5.16.0 #​4862 by @​renovate
  • chore(deps): update peter-evans/create-or-update-comment action to v2 #​4867 by @​renovate
  • chore(deps): update peter-evans/find-comment action to v2 #​4868 by @​renovate
  • chore(deps): update dependency @​clerk/clerk-js to v2.17.7 #​4871 by @​renovate
  • chore(deps): update dependency @​clerk/types to v1.29.3 #​4872 by @​renovate
  • fix(deps): update graphql-tools monorepo #​4878 by @​renovate
  • chore(deps): update dependency @​clerk/clerk-sdk-node to v2.10.0 #​4879 by @​renovate
  • fix(deps): update dependency pino to v7.9.2 #​4884 by @​renovate
  • chore(deps): update dependency @​supabase/supabase-js to v1.31.2 #​4887 by @​renovate
  • fix(deps): update graphql-tools monorepo #​4888 by @​renovate
  • fix(deps): update dependency graphql-scalars to v1.16.0 #​4890 by @​renovate

Removed Deprecations and Breaking Changes

This release removes prior deprecations and has breaking changes.

Removed binary rw-api-server; replaced with rw-server [side]

This bin is used for running the Fastify server, which is called when you run yarn rw serve.

Projects should use yarn rw-server api. Also takes web positional (or both).

dbAuth: removed COOKIE_META cookies

PR #​4722 dbAuth cookie config has moved to api/src/function/auth.js for better customization. See:

Refer to Code Modification below to update.

DevFatalErrorPage now pretty prints query

PR #​4696 updates src/components/FatalErrorPage.tsx

Refer to Code Modification below to update.

Private routes and Set now use roles (instead of role)

PR #​4681 Changes the use of Router role to be replaced by roles plural.

Projects using role for RBAC will need to make a Code Modification

Code Modifications

Update DevFatalErrorPage

We've made a small change to FatalErrorPage make sure your bundle sizes are as small as possible!
If you only have the default FatalErrorPage, you can run our automatic codemod to pull in the latest changes.

npx @​redwoodjs/codemods@canary update-dev-fatal-error-page

If you've customised your error page, just a small tweak is needed:

// src/components/FatalErrorPage.tsx
if (process.env.NODE_ENV === 'development') {
-  RedwoodDevFatalErrorPage = require('@​redwoodjs/web').DevFatalErrorPage
+  RedwoodDevFatalErrorPage = require('@​redwoodjs/web/dist/components/DevFatalErrorPage').DevFatalErrorPage
}
Update roles for role in Private routes and Sets

Projects using roles and RBAC will need to change any prop in Routes.ts|js named role to roles. The value can be a string or array of strings, which is consistent with previous behavior.

Example:

- <Private unauthenicated="home" role="admin">
+ <Private unauthenicated="home" roles="admin">
Netlify Deploy: Update .toml

PR #​4782 improves prerender performance on Jamstack deploy providers. For most cases, the changes are automatic.

It is recommended that projects deploying to Netlify should update netlify.toml:

[[redirects]]
   from = "/*"
-  to = "/index.html"
+  to = "/200.html"
   status = 200
 `
Nhost Auth: Upgrade to v2

PR #​4770 updates Nhost Auth provider to use Nhost v2.

Existing projects using Nhost need to use the new Nhost SDK. Make the following changes to Auth.ts|js:

- import { createClient } from 'nhost-js-sdk'
+ import { NhostClient } from '@&#8203;nhost/nhost-js'

- const nhostClient = createClient({
-  baseUrl: 'url'
+ const nhostClient = new NhostClient({
+  backendUrl: 'url' 
})
dbAuth: Set Secure Cookie Attribute in Config Template

If you're using dbAuth with the new cookie config that we added to api/src/functions/auth.js in the last release, you'll need to make a change if you use Safari as your dev browser, or if you access your dev server at a host other than localhost (you may have noticed that you can't stay logged in).

Change the Secure config to this:

cookie: {
  HttpOnly: true,
  Path: '/',
  SameSite: 'Strict',
- Secure: true,
+ Secure: process.env.NODE_ENV !== 'development' ? true : false,
},

This will set the cookie to not secure when in a development environment, but otherwise true everywhere else (like in production). Chrome has an exception that you can set a secure cookie over HTTP, but only if the domain is localhost. Safari does not have this exception!

Deploy Redwood Record on Netlify (experimental)

See #​4618

Redwood Record datamodel file
In order to fix the Netlify deploy when using Redwood Record the datamodel.json generated by running yarn rw record init was moved and will now be tracked under git.

How to Update
If you are using the RedwoodRecord lib the only thing you have to do is run yarn rw record init again and you'll be good to go.

v0.49.1

Compare Source

Patch Release

This release includes the following fixes:

v0.49.0

Compare Source

🎬 Call for Redwood product and startup demos
Redwood 1.0.0 will arrive within the month. We’re planning the first RedwoodJS Startup Showcase, full of demos and panels, highlighting the amazing people and projects using Redwood. Want to demo? Let's talk! Just take a look at this forum post and complete the submission form.

🔬Help QA the new Redwood Tutorials
Both Tutorials I and II have been re-written for v1. We need your help making sure that every "i" is dotted and "t" is crossed. If you're interested in helping, check out the details here.

Changelog

Unique contributors: 4

PRs merged: 7

Features

  • Implement dbAuth CORS support + Add cookie options to auth handler #​4150 by @​dac09
    • DEPRECATION Warning: see "dbAuth Cookie Configuration" section below
  • Codemod for webhook verifier option renaming #​4675 by @​Tobbe

Fixed

Chore

Package Dependencies
View all Dependency Version Upgrades
  • Update dependency esbuild to v0.14.25 #​4657 by @​renovate
  • Update dependency @​clerk/clerk-js to v2.17.0 #​4660 by @​renovate
  • Update dependency @​clerk/types to v1.28.0 #​4661 by @​renovate
  • Update dependency css-loader to v6.7.0 #​4663 by @​renovate
  • Update dependency @​clerk/clerk-js to v2.17.1 #​4664 by @​renovate
  • Update dependency @​clerk/clerk-sdk-node to v2.9.5 #​4665 by @​renovate
  • Update dependency @​clerk/types to v1.28.1 #​4666 by @​renovate
  • Update dependency @​clerk/clerk-sdk-node to v2.9.6 #​4667 by @​renovate
  • Update dependency firebase to v9.6.8 #​4668 by @​renovate
  • Update dependency @​supabase/supabase-js to v1.31.0 #​4677 by @​renovate
  • Update dependency @​auth0/auth0-spa-js to v1.20.1 #​4682 by @​renovate
  • Update dependency fastify to v3.27.3 #​4683 by @​renovate
  • Update dependency magic-sdk to v8.1.0 #​4684 by @​renovate
  • Update dependency @​azure/msal-browser to v2.22.1 #​4686 by @​renovate
  • Update typescript-eslint monorepo to v5.14.0 #​4687 by @​renovate

Recommended Code Modification

dbAuth Cookie Configuration

If you are using dbAuth, we've moved the configuration for the dbAuth cookie alongside the rest of the configuration in api/src/functions/auth.js. The original configuration, which was internal to Redwood itself, is now deprecated. If you do not add this cookie config to auth.js your app will continue to work for now, but will show a deprecation notice in your api logs. The old behavior will be removed in a future version of Redwood.

To preserve the existing cookie settings, add the cookie property to the options sent into new DbAuthHandler():

const authHandler = new DbAuthHandler(event, context, {
  db: db,
  authModelAccessor: 'user',
  authFields: {
    id: 'id',
    username: 'email',
    hashedPassword: 'hashedPassword',
    salt: 'salt',
    resetToken: 'resetToken',
    resetTokenExpiresAt: 'resetTokenExpiresAt',
  },
  forgotPassword: forgotPasswordOptions,
  login: loginOptions,
  resetPassword: resetPasswordOptions,
  signup: signupOptions,

+ cookie: {
+  HttpOnly: true,
+  Path: '/',
+  SameSite: 'Strict',
+  Secure: true,
+  // Domain: 'example.com',
+  },

})

The cookie Domain is now set here instead of in an ENV var. When do you need to set Domain? If your web side and api side are served from different domains (such as www.example.com and api.example.com). To read more about Domain config: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies

v0.48.0

Compare Source

Highlight: 🧶 Yarn 3 (Preview)

This release adds preview support for using Yarn v3 with Redwood projects. Why would you want to bump from Yarn v1 to v3? Because it's amazingly superior. And it's SuperEasy™ to upgrade and try it out. Just run the codemod:

npx @&#8203;redwoodjs/codemods@canary upgrade-yarn

Let us know how it goes!

Known Gotchas
Upgrading to Yarn 3 requires corepack. If you're on a Node.js version less than v14.19, you need to install it manually via npm i -g corepack

Code Modification: Webhook timestamp verifiers

This is a required modification for projects using the the timestamp webhook verifier option.

PR #​4608 introduces a new option called eventTimestamp. Together with the existing tolerance option it's possible to add timestamp diff checks to all verifiers. But do note that all webhook events won't have the needed timestamp info to implement. That's up to the vendor you're integrating with to include or not include. Currently we know Svix, Clerk and Stripe have the required info.

🚨This PR renames the timestamp webhook verifier option to currentTimestampOverride.

To automatically update your code, simply run this code modification in your Redwood project:

npx @&#8203;redwoodjs/codemods@canary rename-verifier-timestamp

Manual Upgrade Step
Only necessary if you do not use the automated code mod above.

  1. For any webhook verifier you have a customized timestamp value, you'll need to rename the timestamp object key to currentTimestampOverride. A simple find and replace should do the trick!

Changelog

Unique contributors: 9

PRs merged: 22

Features

  • Enable yarn 3 for Redwood projects #​4444 by @​jtoar
  • Webhook verifiers: Add Base64Sha256 version for Svix webhooks used by Clerk auth #​4598 by @​Tobbe
  • feat(exec): Allow listing of scripts with rw exec to improve dx #​4600 by @​dac09
  • Webhook verifiers: Make them all support timestamp diff check #​4608 by @​Tobbe
    • BREAKING: see "Code Modifications"

Fixed

Chore

Package Dependencies
View all Dependency Version Upgrades
  • Update prisma monorepo to v3.10.0 #​4551 by @​renovate
  • Update graphql-tools monorepo #​4568 by @​renovate
  • Update dependency @​clerk/clerk-sdk-node to v2.9.4 #​4570 by @​renovate
  • Update dependency @​clerk/types to v1.25.4 #​4571 by @​renovate
  • Update dependency @​playwright/test to v1.19.2 #​4572 by @​renovate
  • Update dependency @​types/node to v16.11.26 #​4573 by @​renovate
  • Update dependency @​clerk/clerk-js to v2.14.3 #​4575 by @​renovate
  • Update dependency eslint-plugin-react to v7.29.1 #​4579 by @​renovate
  • Update actions/setup-node action to v3 #​4580 by @​renovate
  • Update dependency @​types/lodash to v4.14.179 #​4582 by @​renovate
  • Update dependency eslint to v8.10.0 #​4583 by @​renovate
  • Update dependency eslint-plugin-react to v7.29.2 #​4586 by @​renovate
  • Update dependency systeminformation to v5.11.5 #​4587 by @​renovate
  • Update dependency @​supabase/supabase-js to v1.30.7 #​4589 by @​renovate
  • Update dependency yargs-parser to v21.0.1 #​4595 by @​renovate
  • Update dependency zx to v5.2.0 #​4596 by @​renovate
  • Update typescript-eslint monorepo to v5.13.0 #​4601 by @​renovate
  • Update dependency cypress to v9.5.1 #​4602 by @​renovate
  • Update dependency typescript to v4.6.2 #​4603 by @​renovate
  • Update dependency @​clerk/clerk-js to v2.15.0 #​4606 by @​renovate
  • Update dependency @​clerk/types to v1.26.0 #​4607 by @​renovate
  • Update dependency @​apollo/client to v3.5.10 #​4609 by @​renovate
  • Update actions/checkout action to v3 #​4610 by @​renovate
  • Update dependency systeminformation to v5.11.6 #​4611 by @​renovate
  • Update dependency @​types/aws-lambda to v8.10.93 #​4620 by @​renovate
  • Update dependency @​types/react-dom to v17.0.12 #​4621 by @​renovate
  • Update dependency @​types/testing-library__jest-dom to v5.14.3 #​4624 by @​renovate
  • Update dependency @​clerk/clerk-js to v2.16.0 #​4627 by @​renovate
  • Update dependency @​clerk/types to v1.27.0 #​4628 by @​renovate
  • Update dependency @​types/react-dom to v17.0.13 #​4629 by @​renovate
  • Update dependency msw to v0.38.2 #​4630 by @​renovate
  • Update dependency eslint-config-prettier to v8.5.0 #​4631 by @​renovate
  • Update dependency esbuild to v0.14.24 #​4635 by @​renovate
  • Update dependency graphql-scalars to v1.15.0 #​4636 by @​renovate
  • Update dependency @​clerk/clerk-js to v2.16.1 #​4639 by @​renovate
  • Update dependency @​clerk/types to v1.27.1 #​4640 by @​renovate
  • Update dependency supertokens-auth-react to v0.19.0 #​4641 by @​renovate
  • Update dependency webpack to v5.70.0 #​4642 by @​renovate
  • Update dependency @​envelop/core to v2.1.0 #​4643 by @​renovate
  • Update dependency @​envelop/depth-limit to v1.3.0 #​4644 by @​renovate
  • Update dependency @​envelop/disable-introspection to v3.1.0 #​4646 by @​renovate
  • Update dependency @​envelop/filter-operation-type to v3.1.0 #​4647 by @​renovate
  • Update dependency @​envelop/parser-cache to v4.1.0 #​4648 by @​renovate
  • Update dependency @​envelop/testing to v4.1.0 #​4649 by @​renovate
  • Update dependency eslint-plugin-react to v7.29.3 #​4650 by @​renovate
  • Update dependency @​envelop/validation-cache to v4.1.0 #​4651 by @​renovate
  • Update dependency @​types/vscode to v1.65.0 #​4652 by @​renovate
  • Update dependency mini-css-extract-plugin to v2.6.0 #​4653 by @​renovate
  • Update actions/upload-artifact action to v3 #​4654 by @​renovate
  • Update dependency npm-packlist to v4 #​4655 by @​renovate
  • Update dependency ts-morph to v14 #​4656 by @​renovate
  • Bump url-parse from 1.5.7 to 1.5.10 in /__fixtures__/example-todo-main-with-errors #​4584 by @​dependabot
  • Bump url-parse from 1.5.7 to 1.5.10 in /__fixtures__/example-todo-main #​4585 by @​dependabot

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

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.

0 participants