fix: hotpack 包管理全面审计与加固(marker 精确匹配 / 无损卸载 / 冲突矩阵 / 进程隔离 / 重定向与 env 安全) - #37
Merged
Conversation
- patch:appendPatchBlock 改用精确 marker 匹配(消除前缀 id 误拒);unmountPack 只撤本次实际安装/替换的 npm 包(无损替换,持久化 installedNpm 所有权,缺省一个不删) - status/check:cached/preview 收敛 isNpmCached 单一真源(版本+包名双校验);checkAsync 冲突按「源类型+版本+落地路径」指纹判定(github/path 漏报与 npm vs 非 npm 误报根治) - gateway:importPack 纳入 serialize 串行链,消除与 activate 的并发竞态 - run-cli:超时用 taskkill /T /F 杀整棵进程树(Windows 孤儿进程根治)+ timedOut 归一退出码(不再误报 exit 1) - paths:显式 DSH_PROFILE 无条件遵守(不再静默回退 desktop/web/headless) - shared-core:httpsGetText 拒绝非 https 重定向(防 TLS 降级/进程级崩溃);sanitizeChildEnv 补齐 LD_/DYLD_/GIT_ 注入面;stripUndefined 显式拒绝 __proto__ 键与非纯对象(防静默数据丢失) - 文档:版本号统一 1.0.1(hotpack 格式说明、install-plugins 缺省资产 URL) - 测试:三套件 900 → 962;vendored 共享内核保持字节一致
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
对插件(hotpack)包管理及其全部相关功能做全面审计与加固:确认并根治 9 处真实缺陷(每处均有可复现失败测试 + 根因定位),补齐进程隔离,测试覆盖 900 → 962 全绿。版本号保持 1.0.1 不变。
修复清单
appendPatchBlock由子串匹配改为精确 marker 匹配(消除前缀 id 误拒);unmountPack只撤本次实际安装/替换的 npm 包(无损替换,持久化installedNpm所有权,缺省一个不删)cached/preview收敛到isNpmCached单一真源(版本 + 内部包名双校验);checkAsync冲突按「源类型 + 版本 + 落地路径」指纹判定(github/path 漏报与 npm vs 非 npm 误报根治)importPack纳入serialize串行链,消除与activate的并发竞态taskkill /T /F杀整棵进程树(Windows 孤儿进程根治)+timedOut归一退出码(不再误报 exit 1)DSH_PROFILE无条件遵守(不再静默回退 desktop/web/headless)httpsGetText拒绝非 https 重定向(防 TLS 降级 / 进程级崩溃);sanitizeChildEnv补齐 LD_/DYLD_/GIT_ 注入面stripUndefined显式拒绝__proto__键与非纯对象(防静默数据丢失)进程隔离
taskkill /T /F,走 SystemRoot 绝对路径防 PATH 隔离失效)LD_PRELOAD/DYLD_*)与 git 命令/配置注入面(GIT_*)测试
三套件全绿:launcher 540 / shared-core 215 / dsh-hotplug-hub 207(合计 962,较基线 900 增 62,全部为价值用例,无滥竽充数);vendored 共享内核(4 处副本)经
check-vendored-shared校验逐文件字节一致。