Skip to content

修复 Actions 输入安全、扫描范围绕过和报告脱敏 - #28

Open
RyanCoreAI wants to merge 2 commits into
mainfrom
codex/fix-action-and-path-safety-20261102
Open

RyanCoreAI wants to merge 2 commits into
mainfrom
codex/fix-action-and-path-safety-20261102

Conversation

@RyanCoreAI

@RyanCoreAI RyanCoreAI commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

PatchBrake 的扫描范围和密钥检测可被普通 glob、占位词注释绕过;同一行命中其他规则时,密钥还会重新出现在报告中。此 PR 修复这些实际复现问题,并保留已有的 Actions 参数注入和 Git C-quoted 路径修复。

  • **/ 支持零层目录,? 不跨目录;解析后保留真实 a/、b/ 根目录。
  • 对匹配值判断占位内容,扫描 JSON 引号 key 和注释内 token。
  • 所有规则和 inline-ignore 统一脱敏,完整覆盖带空格/转义引号的赋值。

验证(2026-11-04,本地 Node 22):TypeScript build、58/58 Vitest、30/30 确定性 benchmark、git diff --cached --check。测试仅使用合成值。新增补丁提交使用 [skip ci] 减少重复 CI;托管状态以 GitHub 实际检查为准,本地通过不等同托管通过。没有合并或部署。

这是启发式 diff 扫描,不能保证检测所有密钥。脱敏内容变化可能改变 secret 规则 fingerprint,更新 baseline 前需复核。详见 docs/deep-audit-20261104.md。

Comment thread src/diff-parser.ts
const match = /^diff --git a\/(.+) b\/(.+)$/.exec(raw);
const oldPath = match ? normalizePath(match[1]) : "unknown";
const newPath = match ? normalizePath(match[2]) : oldPath;
const match = /^diff --git ("(?:[^"\\]|\\.)*"|a\/.+) ("(?:[^"\\]|\\.)*"|b\/.+)$/.exec(raw);
@RyanCoreAI RyanCoreAI changed the title 修复 Action 输入注入和带引号 Git 路径漏检 修复 Actions 输入安全、扫描范围绕过和报告脱敏 Nov 4, 2026
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