Skip to content

fix url upload sec - #1839

Merged
coltea merged 3 commits into
chaitin:mainfrom
coltea:fix-url-upload-sec
Oct 9, 2026
Merged

coltea merged 3 commits into
chaitin:mainfrom
coltea:fix-url-upload-sec

Conversation

@coltea

@coltea coltea commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 07:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Sitemap 中未转义的可配置 URL 会导致无效 XML 或 XML 注入。

1 open finding
What changed in this PR

本 PR 调整字符串构建方式,并同步重新生成 Swagger 文档。

Changes:

  • 使用 fmt.Fprintf 直接写入字符串构建器。
  • 更新 Swagger 模型的全限定引用名称。
  • 当前 sitemap URL 输出仍缺少 XML 转义。
File Description
backend/​usecase/​sitemap.go 调整 sitemap 字符串构建。
backend/​usecase/​llm.go 调整图片 Markdown 拼接。
backend/​domain/​llm.go 调整文档上下文拼接。
backend/​docs/​swagger.yaml 更新 Swagger YAML。
backend/​docs/​swagger.json 更新 Swagger JSON。
backend/​docs/​docs.go 更新生成的 Swagger Go 文档。
Files not reviewed (2)
  • backend/cmd/api/wire_gen.go: Generated file
  • backend/docs/docs.go: Generated file

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread backend/usecase/sitemap.go Outdated
Copilot AI balanced review requested due to automatic review settings October 9, 2026 07:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

主后端新增了对 proprietary 子模块的直接依赖,导致未初始化子模块的常规 CI 和开源构建失败。

2 open findings
Files not reviewed (2)
  • backend/cmd/api/wire_gen.go: Generated file
  • backend/docs/docs.go: Generated file

🧠 Review effort: Balanced

Comment thread backend/handler/share/common.go Outdated
Copilot AI balanced review requested due to automatic review settings October 9, 2026 08:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

SVG 清理会删除 Mermaid 流程图用于节点标签的 foreignObject,导致节点文字丢失。

3 open findings
Files not reviewed (2)
  • backend/cmd/api/wire_gen.go: Generated file
  • backend/docs/docs.go: Generated file

🧠 Review effort: Balanced

Comment thread web/app/src/components/markdown2/sanitizeMermaidSvg.ts Outdated
Copilot AI balanced review requested due to automatic review settings October 9, 2026 08:49
@coltea
coltea force-pushed the fix-url-upload-sec branch from 6e5c525 to 4ae384d Compare October 9, 2026 08:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

SVG 清理仍可通过根节点事件属性和大小写标签绕过,需先修复该安全缺口。

3 open findings
1 resolved since last review
Files not reviewed (2)
  • backend/cmd/api/wire_gen.go: Generated file
  • backend/docs/docs.go: Generated file

🧠 Review effort: Balanced

Comment thread web/app/src/components/markdown2/sanitizeMermaidSvg.ts Outdated
@coltea
coltea force-pushed the fix-url-upload-sec branch from 4ae384d to 3720156 Compare October 9, 2026 08:54
Copilot AI balanced review requested due to automatic review settings October 9, 2026 08:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

SVG 根节点仍可绕过清理,且通用上传 API 和专业版构建存在回归风险。

3 open findings
2 resolved since last review
Files not reviewed (2)
  • backend/cmd/api/wire_gen.go: Generated file
  • backend/docs/docs.go: Generated file

🧠 Review effort: Balanced

Comment thread backend/cmd/api/wire_gen.go
Comment thread backend/usecase/file.go
Copilot AI balanced review requested due to automatic review settings October 9, 2026 08:58
@coltea
coltea force-pushed the fix-url-upload-sec branch from 3720156 to cc2c6b2 Compare October 9, 2026 08:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

远程上传的公共用例产生未声明的 API 破坏,同时 Swagger 与已提交的前端客户端类型不同步。

2 open findings
2 resolved since last review
Files not reviewed (2)
  • backend/cmd/api/wire_gen.go: Generated file
  • backend/docs/docs.go: Generated file

🧠 Review effort: Balanced

Comment thread backend/docs/swagger.yaml
@coltea
coltea merged commit 394e42a into chaitin:main Oct 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants