security: 移除 /rbac/add_superuser.dspy 未授权超管创建后门

该端点被授权给 any 角色且文件内零鉴权:任何未登录者裸调 URL 即可创建
superuser/111111(角色 owner.superuser+admin)→ 登录后完全接管平台
→ 经 agent run_shell/终端可达 RCE。等同奇安信 QVD-2026-57410(DSH 9.8) 危害。

超管初始化改为部署期本地 CLI(宿主应用 scripts/create_superuser.py),
不再经 HTTP 暴露。load_path.py 同步移除该路径注册。
This commit is contained in:
yumoqing 2026-08-25 14:46:50 +08:00
parent a0b200c459
commit f5b9d697b3
2 changed files with 0 additions and 20 deletions

View File

@ -37,7 +37,6 @@ PATHS_LOGINED = [
f"/{MOD}/add_provider.dspy",
f"/{MOD}/add_provider.ui",
f"/{MOD}/add_reseller.dspy",
f"/{MOD}/add_superuser.dspy",
f"/{MOD}/find_unauth_files.dspy",
f"/{MOD}/get_all_roles.dspy",
f"/{MOD}/get_normal_roles.dspy",

View File

@ -1,19 +0,0 @@
debug('/rbac/add_superuser.dspy')
db = DBPools()
dbname = get_module_dbname('rbac')
async with db.sqlorContext(dbname) as sor:
ns = DictObject(**{
"id": uuid(),
"username":"superuser",
"password":password_encode('111111'),
"orgid":"0"
})
roles = [
{
"orgtypeid":"owner",
"roles":["superuser", "admin"]
}
]
await create_user(sor, ns, roles)
return "OK"
return "Error"