fix(py-isolation-adversarial-policy): suppress S307 on encoded-injection payload#2182
Merged
imran-siddique merged 1 commit intoMay 12, 2026
Conversation
…ion payload
`BUILTIN_VECTORS` in `chaos/adversarial_policy.py` contains an attack
vector whose ``payload["command"]`` is the literal string
``"eval(base64decode('aW1wb3J0IG9z'))"`` — test data used to assert
that the policy engine blocks injection attempts. The string is never
evaluated.
Static scanners (bandit, ruff S307) flag the substring ``eval(`` even
inside a string literal that's only used as fixture data, producing a
noisy false positive every time the file is scanned.
Add ``# noqa: S307`` with a comment naming why the suppression is
correct: the token is test data, not invoked code. Suppression is
intentionally narrow — only the one line that carries the ``eval(``
token, not the whole module.
Pure annotation change — no behaviour delta, no new tests needed (the
existing 37 adversarial-chaos tests cover the vector being a
valid fixture entry).
🤖 AI Agent: docs-sync-checker — Docs SyncDocs Sync
|
🤖 AI Agent: test-generator — View detailsTest coverage looks good. No gaps identified. |
🤖 AI Agent: breaking-change-detector — View detailsNo breaking changes detected. |
🤖 AI Agent: code-reviewer — View detailsTL;DR: 0 blockers, 0 warnings. No issues found. Clean change. |
🤖 AI Agent: security-scanner — View detailsNo security issues found. |
|
🟡 Contributor Check: MEDIUM
Automated check by AGT Contributor Check. |
PR Review Summary
Verdict: ✅ Ready for human review |
MohammadHaroonAbuomar
pushed a commit
to MohammadHaroonAbuomar/agt-acs
that referenced
this pull request
Jun 1, 2026
…ion payload (microsoft#2182) `BUILTIN_VECTORS` in `chaos/adversarial_policy.py` contains an attack vector whose ``payload["command"]`` is the literal string ``"eval(base64decode('aW1wb3J0IG9z'))"`` — test data used to assert that the policy engine blocks injection attempts. The string is never evaluated. Static scanners (bandit, ruff S307) flag the substring ``eval(`` even inside a string literal that's only used as fixture data, producing a noisy false positive every time the file is scanned. Add ``# noqa: S307`` with a comment naming why the suppression is correct: the token is test data, not invoked code. Suppression is intentionally narrow — only the one line that carries the ``eval(`` token, not the whole module. Pure annotation change — no behaviour delta, no new tests needed (the existing 37 adversarial-chaos tests cover the vector being a valid fixture entry).
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.
Summary
adversarial_policy.py'sBUILTIN_VECTORScontains an attack vector whosepayload["command"]is the literal string"eval(base64decode('aW1wb3J0IG9z'))"— test data used to assert that the policy engine blocks injection attempts. The string is never evaluated.Static scanners (
banditrule B307,ruffrule S307) flag the substringeval(even inside a string literal that's only used as fixture data, producing a noisy false positive every time the file is scanned.Change
Add
# noqa: S307with a comment naming why the suppression is correct: the token is test data, not invoked code. Suppression is intentionally narrow — only the one line that carries theeval(token, not the whole module — so a realeval(call anywhere else in the file would still flag.Tests
Pure annotation change — no behaviour delta, no new tests needed.
The existing 37 adversarial-chaos tests cover the vector being a valid fixture entry; they still pass with the noqa annotation in place.
Test plan
test_adversarial_chaos.pybandit/ruffS307 no longer flagsadversarial_policy.py:113Surfaced during independent audit conducted by @finnoybu (Ken Tannenbaum, AEGIS Initiative); [LOW, Python Isolation].