fix: support all base64 variants in DSSE decoding and normalize type filter#4
Open
Sandipmandal25 wants to merge 1 commit intoSBOMit:masterfrom
Open
Conversation
6434704 to
37b409b
Compare
Jaydeep869
reviewed
Apr 2, 2026
…filter Signed-off-by: Sandipmandal25 <sandipmandal02.sm@gmail.com>
37b409b to
011c3ac
Compare
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.
Description
decodeBase64Anypreviously only usedbase64.StdEncoding. However, the DSSE spec (https://github.com/secure-systems-lab/dsse) encodes payloads using base64url without padding (RawURLEncoding). As a result, realwitness runattestations failed to parse with anillegal base64 dataerror.Additionally,
ExtractAllstored raw type filter strings without normalization. This caused all files to be silently dropped when--typeswas passed as values likeCommand-RunorCOMMAND-RUN, even though the parser layer already normalizes these values.fixes #5
Changes Made
Fixed
parser.go:decodeBase64Anynow attempts all four base64 variants in order:RawURLEncoding → URLEncoding → StdEncoding → RawStdEncodingFixed
extractor.go:strings.ToLower(strings.TrimSpace(t))extractAttestationsAdded tests:
parser_test.goto validate base64 decoding across variantsextractor_test.goto verify type normalization behaviorTesting
Before:
After: