Skip to content

Commit 6c2c763

Browse files
committed
security: fix RCE via terminology poisoning and restrict upload access
1 parent b25470a commit 6c2c763

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

backend/apps/db/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ def check_sql_read(sql: str, ds: CoreDatasource | AssistantOutDsSchema):
670670
write_types = (
671671
exp.Insert, exp.Update, exp.Delete,
672672
exp.Create, exp.Drop, exp.Alter,
673-
exp.Merge, exp.Command
673+
exp.Merge, exp.Command, exp.Copy
674674
)
675675

676676
for stmt in statements:

backend/apps/terminology/api/terminology.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def inner():
164164

165165

166166
@router.post("/uploadExcel", summary=f"{PLACEHOLDER_PREFIX}upload_term")
167+
@require_permissions(permission=SqlbotPermission(role=['ws_admin']))
167168
@system_log(LogConfig(operation_type=OperationType.IMPORT, module=OperationModules.TERMINOLOGY))
168169
async def upload_excel(trans: Trans, current_user: CurrentUser, file: UploadFile = File(...)):
169170
ALLOWED_EXTENSIONS = {"xlsx", "xls"}

0 commit comments

Comments
 (0)