Repository navigation
Conversation
…o-shell ASK rule (#4273) - SecurityLedger.Escalation now ranks true denials (block/eperm/ask-blocked) separately from ask-allowed events: a bypass-downgraded ask RAN, it was not denied - the old wording fired 'was denied N times ... sandbox-probing' at threshold 3 for commands that executed fine (user-measured 186/session). Downgraded allows escalate at threshold 10 with neutral SECURITY NOTICE wording; true denials keep the probing fingerprint and outrank. - New gate ASK rule 'decoded payload piped to shell' (base64|openssl enc -d|xxd -r -p ... | sh): the one capture surface the bare shell-substitution rules uniquely held, kept as an explicit content rule so PR #4238's downgrade of the syntax rules does not widen it. - zz_issue3282_test.go probe switched to a destructive Ask source (rm -f temp.txt) stable under both rule-table shapes; assertions updated to the split-threshold semantics. Complements #4238 (rule-table downgrade); zero overlap in call sites.
This was referenced Oct 17, 2026
This branch has not been deployed
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.
Fixes #4273 (ledger 语义层 + 解码规则补偿;规则表降级归 #4238)。
修复要点
ask-allowed事件(bypass 降级放行、命令实际执行)不再参与 denied 排名——旧文案 "was denied N times ... sandbox-probing" 对实际执行成功的命令是事实性错误指控(用户实测同会话 186 次)(base64|openssl enc -d|xxd -r -p).*\|\s*(ba)?sh\b——裸base64 -d x | sh类混淆载荷),显式内容化,堵住 fix(tool): downgrade shell-substitution ASK rules to informational warnings #4238 降级后扩大的缺口;结尾 \b 吸取 [business-logic] command_gate.go pipe-to-shell rule lacks word boundary - '| sha256sum' flagged as piping to shell #815(sha256sum/shasum 不误报)echo $(date)→rm -f temp.txt(destructive Ask 源,在 fix(tool): downgrade shell-substitution ASK rules to informational warnings #4238 前后两种规则表形态下都稳定触发 Ask);断言改为分裂阈值语义与 #4238 的关系(互补,已与 reviewer 对齐)
测试证据
echo $(printf 'x' | base64 -d) | sh);解码无 shell 消费者不误报;3/9 次降级静默、10 次中性 notice 且禁用 denied 措辞;真拒绝保探测语义;两组不交叉计数+真拒绝优先go test -tags goolm ./internal/tool/绿(65s)go build+go vet绿🤖 Generated with ggcode