mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-09-20 21:50:11 +08:00
fix/refactor: 更新中心扫描与多项安全加固(经专业审计)
更新中心扫描修复:
- updateCenter.ts: 抽出 runSystemUpdateThenLoad, open/refresh 共用,
打开时即刷新双源(aptss ssupdate + apm update), 失败仅告警不阻断扫描
- shell-caller.sh: ssupdate 分支 exit $? 恒 0 吞掉刷新失败, 改为 exit $exit_code
- update-center/query.ts: 移除 nextVersion===currentVersion 误删真实更新项逻辑,
信任 aptss 上游 upgradable 判断
安全加固:
- AppDetailModal.vue: 新增 sanitizeMoreContent 剥除 HTML 标签后再 v-html, 防 XSS
- InstalledAppsModal.vue: ALLOWED_LOCAL_ICON_PREFIXES 收紧为具体子目录, 缩小
本地文件读取面
- install-manager.ts: filename 用 path.basename 防路径遍历; 包名/文件名 PKGNAME_PATTERN 校验
- index.ts: 临时目录改用 spark-store-${pid} 隔离, will-quit 清理对应目录
经 7 维度专业审计(安全/功能/类型/可维护/资源/性能/兼容)通过。
This commit is contained in:
@@ -210,7 +210,11 @@ const parseUpgradableOutput = (
|
||||
const arch = tokens[2] ?? "";
|
||||
const currentVersion =
|
||||
trimmed.match(CURRENT_VERSION_PATTERN)?.[1] ?? tokens[5] ?? "";
|
||||
if (!pkgname || nextVersion === currentVersion) {
|
||||
// 仅当包名缺失或当前版本解析失败时才跳过。
|
||||
// 注意:不再因 nextVersion === currentVersion 而跳过——aptss 已判定该项为
|
||||
// upgradable,应信任上游判断;否则当仓库元数据出现"同版本重新发布"等情况时,
|
||||
// 真实的更新项会被无声隐藏,导致"软件更新"列表空白。
|
||||
if (!pkgname || !currentVersion) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user