Repository navigation
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace torus-scripts 8 (Babel, Rollup, ESLint, Prettier) with torus-scripts 9 presets on vite-plus. Keep the dist/lib.esm and dist/lib.cjs layout for every subpath export, inject AUTH_VERSION with define, and target ES2022 so Object.hasOwn stays native. Types move from dist/lib.cjs/types to dist/lib.cjs. Remove Babel, Rollup, webpack, cross-env, tsconfig-paths, husky, lint-staged, and the unused platform optional dependencies. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Fix the strictNullChecks and noUncheckedIndexedAccess errors in src and test. Auth now throws userNotLoggedIn or notInitialized instead of a TypeError when the session has no user info or the iframe auth provider is missing. getHashQueryParams copies only the known redirect keys from the URL query and hash, which fixes the js/remote-property-injection alerts. Co-authored-by: Cursor <cursoragent@cursor.com>
color 5 ships its own types. customauth, session-manager, and secure-pub-sub stay on their current majors until EMBED-590 ships, because they still depend on constants 16 and metadata-helpers 8. Co-authored-by: Cursor <cursoragent@cursor.com>
Vue example: drop @toruslabs/constants, @toruslabs/eccrypto, @toruslabs/fnd-base, core-js, autoprefixer, postcss, empty-module, source-map-explorer, @types/bs58, and the ESLint and Prettier setup. React example: drop @types/bs58 and the Create React App leftovers. Both examples move to TypeScript 7, deny install scripts, use the hardened .npmrc, and have regenerated lockfiles with 0 npm audit findings. Co-authored-by: Cursor <cursoragent@cursor.com>
Update brace-expansion, ws, engine.io-client, socket.io-parser, and @humanfs/node within their existing ranges (lockfile only). npm audit goes from 51 findings (20 high) to 14 (9 low, 5 moderate, no high). Configure Dependabot for the root, both examples, and GitHub Actions with a 3-day cooldown. Co-authored-by: Cursor <cursoragent@cursor.com>
…an AWS role Run harden, lint and format, typecheck, build, tests, a packed consumer check, and both example builds on Node 24.22 and 26 with npm 12. Pin every action to a commit SHA and default the token to read-only. The master demo deploy assumes vars.AWS_ROLE_ARN through OIDC and uses the AWS CLI for the S3 sync and CloudFront invalidation, which replaces the static access keys and the unpinned third-party actions. Add the shared MetaMask security scanner and a manual release pull request workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace torus-scripts release with Changesets. version-packages also updates the lockfile. Add a major changeset for the Node 24.22 and npm 12 requirement and the moved type declarations. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 09eaf2a. Configure here.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
A crafted nonce without valid loginParams threw inside init and blocked SDK startup. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Checked the review comments and the red security-scanner jobs. Bugbot (lockfile on CodeQL comments on
Semgrep and zizmor in the same workflow pass (0 results). This workflow file is identical to the one that is green on secure-pub-sub#46. The difference is this repo still has CodeQL default setup on (the separate |
A local npm config that points at the JFrog mirror was rewriting example lockfiles. The example .npmrc now forces registry.npmjs.org, matching the root. Co-authored-by: Cursor <cursoragent@cursor.com>
The examples link @web3auth/auth to the repo root and do not install those packages. The cooldown exemption stays in the root .npmrc only. Co-authored-by: Cursor <cursoragent@cursor.com>

Jira Link
EMBED-595 — [Stack 2026 Q4] Auth: tooling, dependencies and security (epic EMBED-573)
Description
Moves
@web3auth/authonto the 2026 Q4 stack, matching the shared acceptance criteria and the shape of secure-pub-sub#46 and ffjavascript #17 / #19 / #20.Each commit is one step and can be reviewed on its own:
>=24.22.0, npm>=12,.nvmrc26,devEngines, and a hardened.npmrc(min-release-age=3,allow-git=none,allow-remote=none,allow-scripts-pin=true). AddsallowScriptsandnpm run harden(LavaMoat at moderate).@toruslabs/torus-scripts@9and@toruslabs/config@5. Builds usevp pack, linting uses Oxlint, formatting uses Oxfmt, tests use Vitest 5, and TypeScript is 7. Babel, Rollup, webpack, ESLint, Prettier, husky, lint-staged,cross-env,rimraf,tsxandtsconfig-pathsare removed.noUncheckedIndexedAccess,strictNullChecks). Runtime behaviour is unchanged.@toruslabs/ffjavascript@7,@toruslabs/constants@17,@toruslabs/metadata-helpers@9,@toruslabs/session-manager@6and@toruslabs/secure-pub-sub@5, and drops the unused@types/color.@toruslabs/customauthstays on22.3.3, the latest release. The four new majors were published inside the 3-day cooldown, so.npmrcexempts only those package names..npmrc,allowScripts, andregistry=https://registry.npmjs.org/so a local install cannot write the JFrog mirror back into the lockfile.js/remote-property-injectioncode-scanning alerts ingetHashQueryParams.Validateworkflow runs on pull requests and on pushes tomaster(Node 24.22 and 26) with Wiz, all actions pinned by SHA, andcontents: read.vars.AWS_ROLE_ARN) and the AWS CLI instead of stored keys and the unpinnedjakejarvis/s3-sync-action@masterandcloudfront-update-distribution@v4.release-pr.yml. This PR includes a major changeset..npmignore(files: ["dist"]already controls the package; the tarball is unchanged at 245 files, 140.9 kB).The Torus CLI skill was intentionally not copied.
Breaking changes (major changeset)
>=24.22.0and npm>=12.@babel/runtimepeer dependency is dropped.dist/lib.cjs/types/*todist/lib.cjs/*.exportsis updated, so normal subpath imports are unaffected.getHashQueryParamsnow returns only known keys:sessionId,sessionNamespace,accessToken,refreshToken,idToken,error,state,nonceandloginParams.Before / after
master)>=22.x/>=10.x>=24.22.0/>=12.nvmrc>=24.x26.npmrchardeningmin-release-age=3,allow-git=none,allow-remote=none,allow-scripts-pin=truenpm run hardenpasses at moderate, in CIvp pack(torus-scripts 9, config 5)vp check: 0 errors, 144 warnings (mostly Vitest mock type parameters and tsdoc)^5.9.3, non-strict profile^7.0.2, strict library profile,tsc --noEmitcleandistcheck:packchecks CJS and ESM keys andtscnodenext types for all 6 subpaths)npm audit(root)npm auditReact examplenpm auditVue exampleValidate(Node 24.22 and 26), release-notes check, security scanner@mastervars.AWS_ROLE_ARN)release-pr.ymlCode-scanning alerts
unpinned-tagmissing-workflow-permissionspermissionsjs/remote-property-injection(getHashQueryParams)js/user-controlled-bypass(auth.ts:params.error,params.nonceandloginParamsfrom the redirect URL)parseRedirectLoginParamsignores aloginParamsvalue that is not valid JSON naming an auth connection, so a bad value no longer throws insideinit(). Recommend dismissing as "won't fix".examples/vue-example/App.vue)Remaining
npm audititems (not force-fixed, per policy)deepmerge@4.3.1: the latest release, with no patch. It remains through@toruslabs/customauth@22.3.3(Dependabot alert 850).customauthalso still nestsconstants@16,metadata-helpers@8andsession-manager@5, because22.3.3does not accept the new majors. Forcing those with an override would put undeclared majors insidecustomauth. It clears when EMBED-590 ships acustomauththat no longer depends ondeepmerge.minimatchviaeslint-plugin-tsdoc: comes through the Oxlint preset. It's dev-only, never shipped, and there's no fix in range.How has this been tested?
On a clean
npm ciunder both Node 24.22.2 and Node 26.13.0 (npm 12.2.0), all of these pass:npm run harden,npm run check,npm run typecheck,npm run build,npm test(18 files, 437 tests) andnpm run check:pack.run tests(Node 24.22 and 26),release-notes, Semgrep, zizmor and Socket all pass.registry.npmjs.org. The root and both example.npmrcfiles pin that registry, so a machine whose global npm config points at the Consensys JFrog mirror does not rewrite the lockfiles.npm ciandnpm run buildagainst the newdist, and both report 0 vulnerabilities.check:packpacks the tarball and installs it into a temporary ESM consumer. It checks that the CJS and ESM export keys match for all subpaths (148 / 8 / 1 / 57 / 5 / 48, identical to 11.8.3), that the injectedversionmatches the package version, and thattsc(nodenext) resolves types for every subpath.vite preview: the page renders, and Login redirects throughauth.web3auth.io/v11/startto Google sign-in. A full OAuth login wasn't completed because no test credentials were available.Not verified yet / needs an admin
Validate(Node 24.22 and 26),release-notes, Semgrep, zizmor and Socket pass on this PR.vars.AWS_ROLE_ARNexists and its trust policy allows this repo onmaster. The deploy job runs only on a push tomaster. After it succeeds, remove theAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYsecrets.security-scan / CodeQL analysisjobs fail with "CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled". The Semgrep and zizmor parts of the scanner already pass.release-pr.yml).master) with the reasons above.Types of changes
Checklist
Note
High Risk
Major release with breaking Node/engine, build output, and types layout requirements, plus stricter redirect parsing in security-sensitive auth flows and large dependency major bumps.
Overview
Major stack upgrade for
@web3auth/auth: requires Node ≥24.22 and npm ≥12, ships as a major changeset, and replaces the Rollup/Babel/webpack toolchain with Vite+ (vp pack) targeting ES2022. The@babel/runtimepeer is removed;.d.tsfiles now sit beside CJS output (dist/lib.cjs/*.d.ts) with updatedexports.Dependencies bump Torus packages to new majors (
ffjavascript7,constants17,metadata-helpers9,session-manager6,secure-pub-sub5). Dev workflow moves to Oxlint/Oxfmt, TypeScript 7, Vitest 5, Changesets, and LavaMoatnpm run harden, plus a newcheck:packscript that validates every subpath export after pack.Auth behavior changes:
getHashQueryParamsonly copies allowlisted redirect keys (fixes remote-property-injection alerts).parseRedirectLoginParamsis new so iframe redirects resume login only whenloginParamsis valid JSON naming an auth connection, instead of throwing ininit(). Minor strictness fixes inPopupHandlerand JRPC error stringification.CI/release:
Validateruns on PRs andmaster(Node 24.22 & 26: harden, check, typecheck, build, test, pack check, example builds). Adds Dependabot, MetaMask security scanner, release-notes job,release-pr.yml, and demo deploy via AWS OIDC instead of long-lived keys. Examples drop legacy ESLint/Prettier config and align with the new toolchain.Reviewed by Cursor Bugbot for commit 8e892fb. Bugbot is set up for automated code reviews on this repo. Configure here.