fix: audit expert vault unlock failures - #3
Merged
CyberSunil merged 4 commits intoSep 21, 2026
Merged
CyberSunil merged 4 commits into
CyberSunil merged 4 commits into
Conversation
Owner
|
Sorry for the long delay on this — thanks for the thorough writeup and for the tests, the integrity-anchor approach is the right call. You're correct that InvalidToken can't distinguish a wrong key from a corrupt vault, so checking the digests before key derivation is the only clean way to separate them. Two things before I can merge: the branch has a conflict in app.py against current main, and the three required CI checks are blocked behind it. Could you rebase on main? |
Contributor
Author
|
I fixed the code conflict. |
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.
What changed
Why
The previous broad exception handler converted operational vault failures into an indistinguishable invalid-key response, which concealed deployment faults and left no unlock-attempt audit trail. Fernet intentionally uses
InvalidTokenfor both wrong keys and invalid tokens, so independent integrity anchors are required to distinguish vault corruption before key derivation and decryption.Validation
python3 -m py_compile app.py challenges/expert_vault.py tests/test_expert_unlock.pypytest -q— 13 passedgit diff --checkCloses #2