Repository navigation
Conversation
Signed-off-by: Nik Cubrilovic <[email protected]>
…whole JOSE header or short truncation, not a continued token #1227 Signed-off-by: Nik Cubrilovic <[email protected]>
Merged
Contributor
Author
|
Landed in v0.0.159 as nik |
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.
Refs #1227 (the last open criterion: "A JWT that is only a header segment (no payload or signature) is not reported").
Bearer eyJhbGciOiJIUzI1NiIs(the header segment of a JWT, no dot) was reported at medium as aBearer Token:isJwtHeadonly suppresses a Bearer value when a second segment follows.isHeaderOnlyJwtnow drops it, on positive proof only:JSON.parse) to a plain object that has analgand only JOSE header keys (alg,typ,kid,cty,enc,zip,x5t,x5t#S256,x5u,x5c,jku,jwk,crit); bodies over 2,048 characters are not read as one; or{"alg",{"typ",{"kid"or{"cty";.followed by a token character (so.-<payload>continues, a sentence period does not),%,\, or whitespace or,followed by.oreyJ. End of text, a quote, a bracket and other punctuation do not.Shapes that stop reporting
A complete JOSE header (any JOSE key set with an
alg), and a truncated one of 64 characters or fewer, afterBearerin a script, anAuthorizationheader, acurlexample and a<code>block.Shapes that report (were wrongly dropped by the first version)
alg/typ/kid/ctyand carries other keys ({"typ":"access","sub":...},{"alg":"x","sub":...,"token":...}), at 120 and 1,000 characters of paddingalg; a truncated value past 64 characters; a short truncated value that does not open with a header keyBearerwith%2E, a space, a comma, a newline or escaped newline, or.-between its partsAcceptance criterion
Bearer <JWT>and an opaque bearer still reportleaked-secrets-bearer-header-1227.test.ts, 8 cases). Mutants killed: key-name check,algrequirement, 64-character bound, 2,048 bound, whole-body decode (vs first 24 characters), prefix regex relaxed, and each continuation clause (.,%,\,,/eyJ).Skill change: none.