test: reconcile env-var security test with callable traversal hardening - #12430
Merged
julian-risch merged 1 commit intoAug 21, 2026
Merged
Conversation
#12397 landed a regression test that resolves `os.environ.update` through an allowlisted module's scope-level `environ` binding to prove that an env write during a load cannot flip the frozen unsafe-mode snapshot. #12416 landed the per-hop resolved-module check in `deserialize_callable`, which refuses that `environ` hop outright because the object belongs to the un-allowlisted `os`. Both were green on their own bases and merged without a re-run, so main now fails: the test's premise ("a serialized handle can resolve that mutator in safe mode") is no longer true. Split the test in two so each defense layer is covered independently: - the gadget is no longer resolvable at all (asserts the #12416 rejection, matching on the `os` module in the error); - the frozen snapshot still cannot be flipped by an env write, granted the write by other means so this keeps testing only that property. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
julian-risch
marked this pull request as ready for review
August 21, 2026 13:42
julian-risch
requested review from
davidsbatista and
sjrl
and removed request for
a team and
sjrl
August 21, 2026 13:42
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||
julian-risch
enabled auto-merge (squash)
August 21, 2026 13:48
julian-risch
disabled auto-merge
August 21, 2026 13:50
julian-risch
deleted the
fix/serialization-security-test-after-traversal-hardening
branch
August 21, 2026 13:50
davidsbatista
pushed a commit
that referenced
this pull request
Aug 21, 2026
…ng (#12430) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Related Issues
mainunit-test failure introduced by the interaction of feat: addHAYSTACK_UNSAFE_DESERIALIZATIONenv var #12397 and fix: validate modules during callable traversal #12416mainis red on all three OS runners with one failing test:Proposed Changes:
Split the unit test for deserialization security so each defense layer is covered on its own
How did you test it?
Notes for the reviewer
Checklist
test:, no breaking changes.ignore-for-release-notes