mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 15:19:10 +02:00
Fix confused deputy attack via consent binding cookie (#3201)
* Add consent binding cookie to prevent confused deputy attacks (GHSA-rww4-4w9c-7733) The OAuthProxy's consent page verified user intent but didn't bind the consenting browser to the IdP callback. An attacker could intercept the upstream authorization URL after consent and send it to a victim, whose browser would complete the flow without having the consent cookie. This adds a signed consent binding cookie set during consent approval (both manual and auto-approve paths) and verified in the IdP callback handler. A different browser won't have this cookie and gets a 403. * Use startswith for URL assertion in consent binding test * Store consent bindings as per-transaction map to support parallel flows * Only accept __Host- consent binding cookie on HTTPS * chore: Update SDK documentation --------- Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
This commit is contained in:
parent
2dcbb944a8
commit
016b9f90e0
7 changed files with 415 additions and 18 deletions
4
loq.toml
4
loq.toml
|
|
@ -52,7 +52,7 @@ max_lines = 1009
|
|||
|
||||
[[rules]]
|
||||
path = "tests/server/auth/test_oauth_consent_flow.py"
|
||||
max_lines = 1056
|
||||
max_lines = 1274
|
||||
|
||||
[[rules]]
|
||||
path = "src/fastmcp/server/server.py"
|
||||
|
|
@ -76,7 +76,7 @@ max_lines = 1584
|
|||
|
||||
[[rules]]
|
||||
path = "src/fastmcp/server/auth/oauth_proxy/proxy.py"
|
||||
max_lines = 1740
|
||||
max_lines = 1796
|
||||
|
||||
[[rules]]
|
||||
path = "tests/server/test_dependencies.py"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue