fix(gui): mitigate CVE-2026-48710 (BadHost)#73
Merged
Conversation
Use `request.scope["path"]` instead of `request.url.path` in `require_gui_user()` to prevent Host header forgery from manipulating the login redirect `returnTo` parameter. Bump starlette >= 1.0.1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d359460 to
7f0ce0b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests.
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
request.url.pathwithrequest.scope["path"]inrequire_gui_user()to prevent Host header forgery from manipulating the login redirectreturnToparameter (CVE-2026-48710)>=1.0.0to>=1.0.1(lockfile: 1.0.0 → 1.1.0)request.scope["path"]instead ofrequest.url.pathWhy
Starlette < 1.0.1 constructs
request.urlby concatenating the HTTPHostheader with the request path without sanitization. An attacker can forgerequest.url.pathvia crafted Host headers. Inrequire_gui_user(), this was used to build thereturnTologin redirect — an open redirect vector.request.scope["path"]uses the ASGI scope path set by the server from the actual request target, which is not derived from the Host header.Downstream impact
All NiceGUI apps built on
aignostics-foundry-core(bridge, hermes, etc.) inherit this fix automatically when they bump their dependency. No code changes needed in consuming projects.Test plan
mise run lintpassesTestRequireGuiUser— all 3 tests pass (redirect, authenticated, return_to override)🤖 Generated with Claude Code