fix: remove vulnerable excel runtime dependency

This commit is contained in:
Codex
2026-06-30 06:55:26 +08:00
parent 7ab702f471
commit e66623158d
8 changed files with 153 additions and 613 deletions

View File

@@ -151,6 +151,8 @@ RPC 必须:
preview -> job -> items -> issues -> import -> audit -> validate
```
CSV/Excel 导入属于后端规范化能力,`.xlsx` 解析统一走 `read-excel-file`。不要把 `exceljs` 重新加入生产运行时;确需替换解析库时,必须同时证明 `npm run audit:runtime` 通过,并用 API 集成测试覆盖多 Sheet 分数线、题目、单词、知识手册和视频导入。
导入不得直接从前端写正式业务表。迁移脚本若因一次性内控需要直写数据库,必须:
- 保留原始 payload。
@@ -206,4 +208,3 @@ npm run check:refactor
5. `docs/refactor/legacy-feature-gap-matrix.md`
如果需求与这些文档冲突,先更新架构文档并说明原因,再改代码。

View File

@@ -65,6 +65,7 @@ GET /api/tenant-content/imports/post-check
表格导入安全边界:
- `.xlsx` 解析统一使用 `read-excel-file`,生产运行时不要重新引入 `exceljs`;如需更换解析器,必须先跑 `npm run audit:runtime` 和完整导入回归。
- 单文件最大 8MB。
- 单次最多解析 5000 行、160 列。
- 单个单元格最多保留 100000 字符。