mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-02 03:53:18 +00:00
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)
This commit is contained in:
parent
780d980efb
commit
e2954f743e
1 changed files with 8 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue