next.js
0dd68a50 - Fix Go proxy RSC dot-segment authorization bypass (#102444)

Commit
4 hours ago
Fix Go proxy RSC dot-segment authorization bypass (#102444) ### What? Fixed an authorization bypass in adapter-built Go proxies where RSC suffix normalization could make a protected path appear as a public parent path. ### Why? Adapters pass the original URL to downstream Go routes. When proxy authorization uses a different normalized path, protected dynamic and catch-all handlers can be reached without the intended proxy checks. ### How? Reject requests when removing an RSC transport suffix exposes a literal or percent-encoded dot segment that changes during the second URL parse. Added unit coverage and adapter tests that run the real emitted `proxy.go` and `route.go` executables. ### Verification - Confirmed the new adapter regression returned 200 before the fix and 404 after it; ordinary protected and public controls returned 403 and 200. - `cargo test -p next-api` — 16 unit tests and 1 integration test passed (using a canonical macOS temp path). - `cargo clippy -p next-api --tests -- -D warnings -A deprecated` — passed. - `cargo fmt --all -- --check`, `gofmt`, Prettier, and ESLint — passed. <!-- NEXT_JS_LLM -->
Author
Parents
Loading