Skip to content

fix(security): stop interpolating appPath into shell strings in afterPack - #69

Merged
orange2ai merged 1 commit into
marswaveai:mainfrom
moyu12-ae:fix/afterpack-shell-injection
Sep 5, 2026
Merged

fix(security): stop interpolating appPath into shell strings in afterPack#69
orange2ai merged 1 commit into
marswaveai:mainfrom
moyu12-ae:fix/afterpack-shell-injection

Conversation

@moyu12-ae

Copy link
Copy Markdown
Contributor

解决的问题

scripts/afterPack.js 将打包路径 appPath 直接插值进 execSync 的 shell 字符串,构成命令注入面。

修复方式

execSyncexecFileSync,以参数数组传递 xattr / find 的实参,打包路径不再经过任何 shell。行为完全不变(含 find -exec sh -c 内部通过 find 的 argv 传入文件路径的既有写法)。

独立的打包脚本修复,与功能 PR 无关,便于审计。

…Pack

Run xattr and find through execFileSync with argument arrays so the
packaged app path never passes through a shell.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants