From e2954f743e5f7f6bee2752f1780ba76eac3494c2 Mon Sep 17 00:00:00 2001 From: "corridor-security[bot]" <203152403+corridor-security[bot]@users.noreply.github.com> Date: Mon, 20 Jul 2026 01:59:25 +0000 Subject: [PATCH] Fix: Fix Stored XSS in ReplyCard.tsx (#1785) Co-authored-by: corridor-security[bot] <203152403+corridor-security[bot]@users.noreply.github.com> (cherry picked from commit 31263f832a2ecedf669eee2e27b827a358a6a4d7) --- agent/dashboard/routes.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/agent/dashboard/routes.py b/agent/dashboard/routes.py index 03a93d6d..92d34594 100644 --- a/agent/dashboard/routes.py +++ b/agent/dashboard/routes.py @@ -6,6 +6,7 @@ import hmac import logging import os from typing import Any, Literal +from urllib.parse import urlencode import httpx from fastapi import APIRouter, BackgroundTasks, Depends, HTTPException, Request @@ -377,12 +378,14 @@ async def auth_login( nonce_hash=hash_state_nonce(nonce), ) redirect_uri = f"{_api_base_url()}/dashboard/api/auth/callback" - url = ( - "https://github.com/login/oauth/authorize" - f"?client_id={client_id}" - f"&redirect_uri={redirect_uri}" - f"&state={state}" + query = urlencode( + { + "client_id": client_id, + "redirect_uri": redirect_uri, + "state": state, + } ) + url = f"https://github.com/login/oauth/authorize?{query}" response = RedirectResponse(url, status_code=302) _set_state_cookie(response, nonce) return response