Skip to content

chore(core): upgrade @octokit deps to fix CVE-2025-25288 (paginate-rest ReDoS)#2524

Open
attehuhtakangas wants to merge 2 commits intointuit:mainfrom
attehuhtakangas:chore/octokit-paginate-rest-cve
Open

chore(core): upgrade @octokit deps to fix CVE-2025-25288 (paginate-rest ReDoS)#2524
attehuhtakangas wants to merge 2 commits intointuit:mainfrom
attehuhtakangas:chore/octokit-paginate-rest-cve

Conversation

@attehuhtakangas
Copy link
Copy Markdown
Contributor

Summary

Bumps @octokit/rest + related plugins to versions that ship a patched @octokit/plugin-paginate-rest, fixing GHSA-h5c3-5r3r-rr8q / CVE-2025-25288 (ReDoS, moderate). The old v18 line of @octokit/rest transitively pins @octokit/plugin-paginate-rest@2.x, which is inside the vulnerable range < 9.2.2.

Socket and other SCA scanners flag this on any project that pulls in @auto-it/core, so fixing it upstream helps every consumer.

Target stack

CJS-compatible — stays off the @octokit/rest@21+ ESM-only line to avoid an ESM migration of the whole monorepo:

Package Before After
@octokit/rest ^18.12.0 ^20.1.2
@octokit/core ^3.5.1 ^5.2.2
@octokit/plugin-throttling ^3.6.2 ^8.2.0
@octokit/plugin-retry ^3.0.9 ^6.1.0
@octokit/plugin-enterprise-compatibility 1.3.0 ^4.1.0

Resolved @octokit/plugin-paginate-rest is 11.4.4-cjs.2 — the CJS back-port on the fixed 11.4.x line, no longer flagged.

Code changes

  • packages/core/src/git.ts
    • plugin-throttling v4 renamed onAbuseLimitonSecondaryRateLimit; v8 moved retryCount out of the options object into a 4th handler argument.
    • @octokit/core v4 removed the previews option — dropped symmetra-preview (GA since 2019, header no longer needed).
    • REST search endpoints now require advanced_search: \"true\" (string) rather than boolean true; test updated.
  • Small cleanups surfaced by the newer TypeScript / @types/node: child.pid narrowing in verify-auth.ts, Object.entries cast in utils/omit.ts, explicit .toString() on execSync output in plugins/exec, tighter regex/reduce types in plugins/released, agent cast at three node-fetch call sites (HttpsProxyAgent shape vs. the new http.Agent).

Test / build environment

  • The new octokit majors require node >= 18. CI bumped to Node 20 (LTS) and pkg-fetch binaries to node18.
  • TypeScript bumped to ~4.9.5 so the import { type X } syntax in the new octokit .d.ts parses. Added skipLibCheck: true and useUnknownInCatchVariables: false to the root tsconfig so the rest of the monorepo keeps compiling without touching catch blocks across the codebase.
  • @types/node hoisted to ^18.19.0 (direct dep + resolution), @types/readable-stream pinned to ^4 via resolution so it matches the new node globals.
  • actions/checkout / actions/cache bumped to v4, actions/setup-node to v4. The old v3 pins were one likely reason some dependabot/related PRs wouldn't go green.

Test status

Locally, on Node 22 / yarn 1:

  • yarn build
  • yarn lint — 3 errors, identical to main (pre-existing unused-memoize imports).
  • yarn test — 790 passing, 60 failing. Identical failure set to main; all remaining failures are pre-existing (the prebuilt pkg binary not being present locally, strip-ansi@7 ESM vs. ts-jest@26, and a handful of tests that require a real GITHUB_TOKEN). No new regressions introduced by this change.

Change Type

  • documentation
  • patch
  • minor
  • major

It's arguably a major because the Node engine requirement effectively moves from 14 to 18 and some octokit-plugin option names change, but the surface of @auto-it/core is unchanged. Happy to relabel if you prefer.

Notes

  • Related / superseded: chore: upgrade octokit dependencies #2459 (same direction, stalled since 2024, conflicting). This PR intentionally jumps past @octokit/rest@19 because that major still ships plugin-paginate-rest@6.x — also inside the CVE's vulnerable range — so it wouldn't fix the advisory.
  • No changes to the public API of @auto-it/core or any plugin.

🤖 Generated with Claude Code

attehuhtakangas and others added 2 commits April 18, 2026 11:27
Bump @octokit/rest, core, and plugins to versions that ship a patched
@octokit/plugin-paginate-rest (>= 9.2.2 / >= 11.4.1), resolving the ReDoS
advisory GHSA-h5c3-5r3r-rr8q (CVE-2025-25288, moderate).

Target stack (CJS-compatible, stays off the v21+ ESM-only line):

- @octokit/rest:                       ^18.12.0 -> ^20.1.2
- @octokit/core:                       ^3.5.1   -> ^5.2.2
- @octokit/plugin-throttling:          ^3.6.2   -> ^8.2.0
- @octokit/plugin-retry:               ^3.0.9   -> ^6.1.0
- @octokit/plugin-enterprise-compatibility: 1.3.0 -> ^4.1.0

This resolves @octokit/plugin-paginate-rest to 11.4.4-cjs.2, which is the
CJS back-port on the fixed 11.4.x line and is no longer flagged by Socket.

Code adjustments:

- @octokit/plugin-throttling v4 renamed `onAbuseLimit` to
  `onSecondaryRateLimit`; v8 moved `retryCount` out of the options object
  into a 4th argument. Update the handler shapes in `packages/core/src/git.ts`.
- @octokit/core v4 removed the `previews` option; drop `symmetra-preview`
  (GA since 2019 and no longer emits a header).
- GitHub's REST search endpoints now require `advanced_search=\"true\"`
  (string) rather than boolean `true`. Update `searchRepo` and its test.

Test/build environment:

- The new octokit majors require Node >= 18, so bump CI to Node 20 and
  `pkg-fetch` binary targets to node18.
- Bump TypeScript to ~4.9.5 so the new `.d.ts` syntax in octokit packages
  parses. Enable `skipLibCheck` and `useUnknownInCatchVariables: false`
  to keep the rest of the codebase compiling unchanged.
- Lock `@types/node` to ^18.19.0 (and via a resolution) so lib types
  match the runtime.
- Pin `@types/readable-stream` to ^4 so it stays compatible with the new
  @types/node shipped globals.
- Bump `actions/checkout` and `actions/cache` to v4; `actions/setup-node`
  to v4. Current v3 pins were producing workflow warnings.

Pre-existing tests and lint errors unchanged vs main: 790 passing, 60
failing, 3 lint errors — all identical to the baseline on upstream main.

Refs: GHSA-h5c3-5r3r-rr8q
See also: intuit#2459 (prior attempt at the same upgrade)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`@endemolshinegroup/cosmiconfig-typescript-loader@3.0.2` (last published
2020) calls `ts.resolveTypeReferenceDirectives` with a signature that
TypeScript removed in 4.7. With the TypeScript bump in this branch the
CLI crashes at runtime the moment cosmiconfig tries to load
`auto.config.ts` during `yarn bundle`:

    TypeScriptCompileError: Failed to compile TypeScript: Debug Failure.
    False expression: Non-string value passed to
    `ts.resolveTypeReferenceDirective`, likely by a wrapping package
    working with an outdated `resolveTypeReferenceDirectives` signature.

Swap in the maintained fork `cosmiconfig-typescript-loader@^4.4.0`,
which is CJS, still targets `cosmiconfig@7` (the version auto pins),
and works against modern TypeScript. The v4 API exposes the loader as
a factory (`TypeScriptLoader()`), so update the single call-site in
`packages/core/src/config.ts`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant