mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
fix: Fix SSRF causing arbitrary file read vulnerability
This commit is contained in:
@@ -688,6 +688,7 @@ def check_sql_read(sql: str, ds: CoreDatasource | AssistantOutDsSchema):
|
||||
def checkParams(extraParams: str, illegalParams: List[str]):
|
||||
kvs = extraParams.split('&')
|
||||
for kv in kvs:
|
||||
k, v = kv.split('=')
|
||||
if k in illegalParams:
|
||||
raise HTTPException(status_code=500, detail=f'Illegal Parameter: {k}')
|
||||
if kv and '=' in kv:
|
||||
k, v = kv.split('=')
|
||||
if k in illegalParams:
|
||||
raise HTTPException(status_code=500, detail=f'Illegal Parameter: {k}')
|
||||
|
||||
Reference in New Issue
Block a user