Files
X-Financial/document/development/2026-07-17/dev-logs/bugs/knowledge-onlyoffice-callback-security.md
caoxiaozhu 787bc3a481 feat(platform): close AI expense value loop
Add tenant-safe value, telemetry, connector, commercial, and production-readiness foundations.
2026-07-17 14:14:08 +08:00

9 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 修复记录
- 12:45修复匿名 ONLYOFFICE 回调可重放、可跨资源覆盖并可借下载 URL 发起 SSRF 的高风险问题。
- Git 提交检查:已执行 `git fetch --all --prune``git status -sb``git log HEAD..@{u}``git log @{u}..HEAD`upstream 无新提交,本地 `main` ahead 17既有提交未被改写。
- 修改:新增 DB-backed 一次性会话与 `20260717_0027` 迁移token 绑定租户、资源、文档、key、版本、权限、audience、过期时间和 JTI预览禁止写入编辑回调原子 claim 后只能消费一次;下载器拒绝错误 origin、私网/回环/链路本地解析、DNS 重绑定、重定向、超限、错误 MIME 和异常 OOXML。
- 操作:把 content/callback 解析与网络下载从主 KnowledgeService 拆出content token 保持短时callback session 默认 4 小时;失败会话记录受控原因且原文件保持不变。
- 验证:容器内 ONLYOFFICE 租户安全 8 项通过,覆盖平台只读、错 key 不 claim、过期、成功单次回写、重放、SSRF、IP pinning、大小/MIME/OOXML迁移/preflight/ownership 163 项通过、1 项静态套件因未配置测试 DSN 跳过;共享 PostgreSQL 探针另完成 `base → 0028``0028 → 0025 → 0028`Knowledge/AgentAsset 会话表均正常落库。
- 影响:未签名、过期、跨租户、跨文档、旧版本、只读和重放回调均不能覆盖文件;文档服务下载失败时安全拒绝,不向内部网络或任意 URL 发请求。