fix(security): 代码审查 — 修复 9 个安全/稳定性 bug #2

Merged
feibisi merged 2 commits from fix/code-review-security-bugs into main 2026-03-18 16:05:28 +08:00

2 commits

Author SHA1 Message Date
6b6c572d47 fix(security): BackupManager extract_zip 增加 Zip Slip 路径遍历防护
解压前逐条检查 zip 条目路径,拒绝包含 ../ 遍历的恶意归档,
防止文件被写到目标目录之外。安全回归测试 12/12 通过。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 15:48:53 +08:00
17dfb10c63 fix(security): 代码审查 — 修复 3 个致命 + 5 个高危 bug
CRITICAL:
- BridgeManager::enable_bridge() 移除 orphaned $gpl_result 引用(致命错误)
- AdminPage::ajax_generate_api_key() catch 块补 return 防止空 key 写入
- BridgeManager 改用 VendorManager::get_instance() 避免双实例状态不同步

HIGH:
- SubscriptionManager::resolve_subscription() 加 is_array() null 防护
- GiteeHandler 移除 URL 中的 access_token,仅通过 Authorization header 发送
- SourceResolver::convert_source() 加 is_encrypted() 检查防止双重加密
- AdminPage/VendorAdmin/Plugin 共 106 处 wp_send_json_error() 后补 return
- BridgeClient::get_download_url() 加空 server_url 检查

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 15:48:53 +08:00