Repository navigation
security: Python exec/b64decode-write/marshal.loads rules (Part of #8433) - #8614
Merged
Merged
Conversation
) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
1 similar comment
Contributor
|
No description provided. |
Contributor
Contributor
|
No description provided. |
squid-protocol
added a commit
that referenced
this pull request
Nov 18, 2026
…, one more REFLECTION_METAPROGRAMMING (Part of #8431) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
8 tasks
squid-shepherd Bot
pushed a commit
that referenced
this pull request
Nov 18, 2026
…Part of #8431) (#8611) * fix(security): shadow-patch flag is a manual hint, assigns no class (Part of #8431) Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * tests: real-model shadow-patch test compares against the flag-less outcome (Part of #8431) Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * tests: regenerate docs_read_by_tests.txt (Part of #8431) Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * tests: policy-gate fixture trips secrets_risk, not a secret-named key (CodeQL clear-text source, Part of #8431) Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * tests: re-bless doom-ascii golden for main's Python exec rules (#8614), one more REFLECTION_METAPROGRAMMING (Part of #8431) Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --------- Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.
Part of #8433 (security epic #8427). Slice 1: the three Python members of the "common malware idioms with no rule" class.
What changed
Three alternatives added to
high_risk_executioningitgalaxy/security/security_lens.py, each scoped topython/embedded_pythonthroughHIGH_RISK_EXECUTION_SCOPE(#5463), so they are dropped for any other language:exec(whose argument is a decoded or built string (b64decode,decompress,codecs.decode,marshal.loads,bytes.fromhex,x.decode(, an f-string, or a literal joined with%/+/.format/.join).exec('x = 1')andexec(code, ns)stay silent..write(b64decode((decode-and-drop stagers).marshal.loads(.Tests:
tests/security_auditing/test_python_malware_idioms_8433.py(planted cases that must fire, near-misses that must stay silent, a not-a-vector check in javascript/go/java/ruby/php, embedded_python, commented-out).Class / Sibling gaps
Class: common malware idioms with no
SecurityLensrule (#8433 table, six members).exec(of built/decoded stringb64decodefeeding a file writeexec(b64decode(...))form is covered by the first rule)marshal.loads(_0xnames / string-array rotationpull_request_targetwithgithub.head_ref/ untrusted checkouttoJSON(secrets)Sibling gaps (Python, not done here): a two-statement stager (
p = b64decode(x)thenexec(p)) needs taint tracking, not a per-line regex;exec(compile(b64decode(...)))is not matched;f.write(b64decode(data))also fires on a legitimate decoded-image write (accepted: the rule cannot see the destination type).Remaining slices
security_lens.py, test file; JS-family scope).pull_request_target+head_ref/untrusted checkout (security_lens.py, test).toJSON(secrets)(security_lens.py, test).Facts checked
exec(,marshal,b64decodewere absent fromTHREAT_SIGNATURESbefore; the scope table's first-match-decides rule means the newexec\b/.write\b/marshal.loads\bentries claim only these hits (no existing hit starts with them).pr_gates.py --fast: 9/9 pass (ruff 0.17.4, mypy 2.4.1 pinned).tests/security_auditing: 999 passed, 2 skipped, 2 xfailed.crucible_check.py(no--update) passes on both legs (full_precision, zero_dependency): counts did not move, no rebless.keyword-rosettais not under/srv/storage_16tb/projects/gitgalaxy), so it was NOT run; CI will. If its counts move, a rebless is the tick's call.pr_gates.py --ratchets: cics-spec, ports, port-surface, estate, det-mutation, time pass. fact-crosscheck, completeness and ground-truth fail becauseexample-health-apisis not fetched at its pinned ref on this box (a mainframe corpus, untouched by a security-lens change); not re-checked against main.Cross-repo
keyword-rosetta (plant for these idioms) is a companion, not part of this PR; if its sweep moves counts, that side re-runs after merge.
Co-Authored-By: Claude Sonnet 5.5 [email protected]
🤖 Generated with Claude Code