Skip to content

fix(oauth-redirect-proxy): patched Next 15, non-root image, proxy hardening - #62

Open
glebedel wants to merge 4 commits into
mainfrom
fix/security-critical-pass
Open

glebedel wants to merge 4 commits into
mainfrom
fix/security-critical-pass

Conversation

@glebedel

@glebedel glebedel commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Security pass on apps/oauth-redirect-proxy and packages/eslint-config.

Findings and fixes

Source Severity Finding Fix
Dependabot #171, #172, #190 critical Next.js RCE (image optimizer AVIF/SVG, Windows-hosted servers). ^14.0.0 has no patched 14.x release next → ^15.5.29, the first release that clears every open Dependabot alert for this app (24 alerts: 3 critical, 8 high)
Dependabot #9, #57, #84, #86, #90, #130, #132, #189 high Next.js DoS, SSRF, middleware bypass same bump
Aikido IaC medium Dockerfile runs as root image builds and runs as the node user
Codex review high same as the Next.js advisories (WebSocket-upgrade SSRF) same bump
Codex review medium POST callbacks forwarded Cookie and Authorization for the proxy's own domain to api.stackone.com both headers are dropped with the hop-by-hop headers
Codex review medium the request log redacted four parameter names and printed the rest (id_token, JARM response) logs parameter names only
Codex review medium unauthenticated POST bodies were buffered without a limit reads stop at 64 KiB and return 413
Codex review (packages) medium eslint-config-prettier ^10.1.1 admits the compromised 10.1.6 and 10.1.7 releases range narrowed to ^10.1.8

Supporting changes:

Not fixed

  • postcss 8.4.31 (high, npm audit): Next 15.5.29 pins it exactly. The advisories need attacker-controlled CSS at build time; this app has no CSS. Clearing it means Next 16 (next lint is removed there), which is a separate decision.

Testing (local, Node 22.22.0)

  • npm ci, npm run typecheck, npm run lint (no warnings), npm run build: all pass.
  • next start smoke test: GET /connect/oauth2/hubspot/callback?code=…&state=… → 307 to https://api.stackone.com/connect/oauth2/hubspot/callback?… with query preserved; PUT → 405; a 70 KB POST → 413 with and without Content-Length (chunked). The log shows searchParamKeys: ['code','state','response'] and no values.
  • Not run: docker build (no Docker daemon on the test machine) and a POST forwarded to the real api.stackone.com.

🤖 Generated with Claude Code

glebedel and others added 3 commits November 25, 2026 10:05
…run container as non-root

Next 14 has no patched release for the open critical RCE advisories
(image optimizer AVIF/SVG, Windows-hosted servers) or the high SSRF/DoS ones;
15.5.29 is the first release that clears every open Dependabot alert for the
app. Route handler params are a Promise in Next 15, so the handler awaits them.

Also commits a lockfile so builds are reproducible, declares react/react-dom
explicitly, adds a typecheck script and an ESLint config so `next lint` runs
non-interactively, and builds the Docker image with npm ci as the unprivileged
node user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…log param names only

From the Codex security review of the app:
- POST bodies were buffered without a limit; reads now stop at 64 KiB and
  return 413.
- Cookie and Authorization headers for the proxy's own domain were forwarded
  to api.stackone.com; they are now dropped with the hop-by-hop headers.
- The request log redacted four known parameter names but printed every other
  value (id_token, JARM "response"); it now logs parameter names only.

Also narrows eslint-config-prettier in packages/eslint-config to ^10.1.8 so the
range no longer admits the compromised 10.1.6 and 10.1.7 releases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…what they are

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
oauth-redirect-proxy Ready Ready Preview Nov 25, 2026 10:30am UTC

Request Review

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AIKIDO-2026-690382 in nanoid - medium severity
The customAlphabet and nanoid generators in the non-secure module of nanoid decrement a loop counter until it reaches zero to build an identifier. When these functions receive a negative size, the counter starts below zero and the while (i--) loop never reaches its termination condition, spinning indefinitely and hanging the calling thread. An application that forwards an unvalidated, externally influenced negative size into these functions is exposed to a denial-of-service condition. The fix guards the loop with i-- > 0 so a negative size produces an empty string instead of looping forever.

Details

Remediation Aikido suggests bumping this package to version 5.1.16 to resolve this issue

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triage: not reachable, left as is. nanoid 3.3.x comes in through postcss 8.4.31, which Next 15.5.29 pins exactly. postcss calls the non-secure generator only with fixed positive sizes, so the negative-size loop cannot be triggered. The fix exists only in nanoid 5.x, which postcss 8.4 does not accept. The same advisory is already open on main for the rag app's lockfile.

🤖 Generated with Claude Code

Vercel runs the install inside the app directory, where npm resolves the
monorepo workspace root. That root has no lockfile, so deploys would ignore
the lockfile this PR adds. `npm ci --prefix .` installs from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview – oauth-redirect-proxy — cb9e85f7 Deployed Nov 25, 2026 by vercel[bot]
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