Skip to content

Commit 48589a6

Browse files
committed
fix: Fix SSRF causing arbitrary file read vulnerability
1 parent beeddb6 commit 48589a6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

backend/apps/db/db.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ def check_sql_read(sql: str, ds: CoreDatasource | AssistantOutDsSchema):
688688
def checkParams(extraParams: str, illegalParams: List[str]):
689689
kvs = extraParams.split('&')
690690
for kv in kvs:
691-
k, v = kv.split('=')
692-
if k in illegalParams:
693-
raise HTTPException(status_code=500, detail=f'Illegal Parameter: {k}')
691+
if kv and '=' in kv:
692+
k, v = kv.split('=')
693+
if k in illegalParams:
694+
raise HTTPException(status_code=500, detail=f'Illegal Parameter: {k}')

0 commit comments

Comments
 (0)