Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test to ensure the BatBadBut mitigation handles trailing . and space safely #23363

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

squeek502
Copy link
Collaborator

@squeek502 squeek502 commented Mar 26, 2025

Previously: #19698

Context:

Note that the Rust test case for this checks that it executes the batch file successfully with the proper mitigation in place, while the Zig test case expects a FileNotFound error. This is because of a PATHEXT optimization that Zig does, and that Rust doesn't do because Rust doesn't do PATHEXT appending (it only appends .exe specifically, see #13993 (comment)). See the added comment for more details.

…space safely

Context:
- https://blog.rust-lang.org/2024/09/04/cve-2024-43402.html
- rust-lang/rust#129962

Note that the Rust test case for this checks that it executes the batch file successfully with the proper mitigation in place, while the Zig test case expects a FileNotFound error. This is because of a PATHEXT optimization that Zig does, and that Rust doesn't do because Rust doesn't do PATHEXT appending (it only appends .exe specifically). See the added comment for more details.
@alexrp alexrp merged commit 63014d3 into ziglang:master Mar 26, 2025
9 checks passed
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