Repository navigation
Reject tokens with unusable characters before any request - #1
Open
snehal-thombare wants to merge 2 commits into
Open
snehal-thombare wants to merge 2 commits into
snehal-thombare wants to merge 2 commits into
Conversation
Finding commandsProofline recorded 1 finding command on this pull request.
Affected findings |
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.
Problem
A token with a non-ASCII or control character is accepted by the client.
The mistake is not reported when the client is created.
Approach
token_value() now raises ValueError when the token is not printable ASCII.
The message does not include the token. Both clients use this check.
Reproduce (on main)
Create ProoflineClient("abc\x00", base_url="http://127.0.0.1:9"):
no error is raised for the invalid token.
Tests
Proofline review
Two warnings about test gaps. I accepted both and added tests in f6576f9.
The two-line fix itself did not change.
Related
prooflinedev#75 changes how errors before a request are
reported. This change rejects the bad token when the client is created.
AI use
I used an AI assistant to find the bug and draft the test, fix and description.