fix(security): 加固模型安装与本地目录源,防止同机后端伪装
- ModelInstaller: 模型 Id 限定为单段安全名称,拒绝路径分隔符/绝对路径/ 符号链接,源目录枚举跳过重解析点,防止写到模型库外 - DirectoryRemote: 清单验签失败如实记录;包 URL 仅允许 http(s) 公网地址, 拦截 file:/私有 IP/环回/元数据地址(SSRF);SafePath 逐级解析符号链接 并确认仍在根目录内 - 本机后端健康检查改为一次性会话令牌双向校验(/api/health 返回指纹), 同机伪造服务无法通过身份确认;所有 /api 请求需带令牌,封面图走 query 只含 7 个安全文件,基于最新 origin2/main(含已合入的 #32 课件)。
This commit is contained in:
1 parent
1dd3b40cb6
commit
46ed84475d
7 files changed
+305
-34
No files matched your search
@@ -12,7 +12,8 @@ public sealed record HealthDto(
|
||||
string Version,
|
||||
string Platform,
|
||||
bool UiAvailable,
|
||||
string? UiError);
|
||||
string? UiError,
|
||||
string? SessionProof = null);
|
||||
|
||||
public sealed record ModelDto(
|
||||
string Id,
|
||||
|
||||
Reference in new issue
Block a user