Repository navigation
linux-luminarium: avoid invalid find flag destinations - #297
Merged
Merged
Conversation
Member
|
Thanks! |
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 #279.
The
findinitializer can choose/, write the flag back to/flag, and then delete that same file. Choosing a directory that already contains aflagdirectory instead raisesIsADirectoryErrorand leaves the flag at/flag.Filter both destinations before random selection. The extra condition only controls
yield, so valid descendants remain eligible; no retry loop is needed.Reproduction
Connected over SSH to the online
finding filesPractice container and verified that/challenge/.initwas byte-for-byte identical to upstream at8c92f5b. Its directory enumeration included/among 2,068 candidates. The synthetic inputpwn.college{reproduction1309}produces seed13091, which selected/with that directory ordering. Executing the unmodified initializer deleted the synthetic/flagwithout an exception. This was a constructed reproduction, not an observed failure with a platform-issued flag; the existing hidden flag was left untouched.Validation
Executed the complete original and patched scripts in fresh temporary chroots inside the Practice container, using synthetic flags, real filesystem traversal, and the original RNG. The same inputs produced:
flagdirectoryIsADirectoryErrorSuccessful cases checked a single surviving flag, unchanged contents, mode
0644, removal of the original/flag, preservation of the conflicting directory, and continued eligibility of its valid descendant.Python syntax,
git diff --check, and the repository's secret-test encryption hook pass. The official Nix/pwnshopsuite was not run because the required runtime is unavailable locally; the chroot checks above were an ad hoc regression harness, not additions to that suite.