Files
Nexus/docs/changelog/2026-05-23-phase3-audit-fixes.md
T
2026-07-08 22:31:31 +08:00

25 lines
1.5 KiB
Markdown
Raw 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.
# Phase 3 逐行走读修复
**日期**: 2026-05-23
**批次**: 3a(安全核心)、3bbackground)、3c(基础设施)、3dmain/middleware
## 修复清单
| ID | 文件 | 级 | 说明 | 修复 |
|----|------|----|------|------|
| F3a-01 | `agent.py:97-102` | P2 | `float(cpu/mem/disk)` 对非数字 Agent 数据 → ValueError/500 | 提取 `_safe_float()` 包裹转换,非数字值 WARNING 级跳过 |
| F3b-01 | `schedule_runner.py:84` | P1 | `now`tz-aware- `last_run_at`MySQL naive)→ TypeError → 已跑调度永远失败 | 统一去除 tzinfo 后再减 |
| F3b-02 | `schedule_runner.py:47` | P3 | cron `*/0` → ZeroDivisionError | step==0 时返回 False 跳过 |
| F3c-01 | `redis/client.py:49` | P2 | Redis URL 含 auth 时密码写入日志 | 启动日志脱敏(`user:**@host` |
| F3d-01 | `main.py:116-118` | P2 | primary lock 丢失时续锁退出,后台任务继续双跑 | lock 丢失时 cancel 所有后台任务 |
| F3d-02 | `main.py:344` | P2 | CORS origins 不去除空格 | `o.strip()` 过滤 |
## 审查结论
| 批次 | 覆盖 | 结论 |
|------|------|------|
| 3a | auth_jwt.py、webssh.py、crypto.py、agent.py、dependencies.py | 1 BUG 修复;安全核心均正确 |
| 3b | heartbeat_flush、retry_runner、schedule_runner、self_monitor | 2 BUG 修复;整体逻辑正确 |
| 3c | engine_compat.py、session.py、redis/client.py | 1 日志脱敏;新增文件无安全问题 |
| 3d | main.py | 2 BUG 修复;中间件注册顺序正确 |