fix: escape + and / in Base64 string regex pattern#1129
Merged
mr-tz merged 1 commit intomandiant:masterfrom Mar 4, 2026
Merged
fix: escape + and / in Base64 string regex pattern#1129mr-tz merged 1 commit intomandiant:masterfrom
mr-tz merged 1 commit intomandiant:masterfrom
Conversation
Collaborator
|
Uh good find. Should we add other variants here or in a new rule? |
Contributor
Author
|
I think adding the URL-safe variant ( -_ ) to this same rule under an or: block would be the cleanest approach, it's still Base64, same ATT&CK mapping. Those are really the only two standardized alphabet. I can add this here or in a follow-up PR. |
Collaborator
|
In here is great. Thank you. |
b38b279 to
bd29ed4
Compare
Contributor
Author
|
Added the URL-safe variant ( -_ ) under an or: block with description labels for both. BFB9 is back as an example since it matches the URL-safe pattern. All lints pass. Thanks for the review! |
mr-tz
approved these changes
Mar 4, 2026
Collaborator
mr-tz
left a comment
There was a problem hiding this comment.
perfect, thanks for the tweak and good inline doc!
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.
The + in the regex pattern was unescaped, causing it to act as a "one or more" quantifier instead of matching a literal +. The trailing / was also consumed as the regex closing delimiter, so the literal / character was never actually required.
Fixed by escaping both: + and /.
Also replaced the example BFB9B5391A13D0AFD787E87AB90F14F5, it uses URL-safe Base64 (-_ instead of +/) and only matched before due to the bug. Added B766CC43D649D30E9F27AFF8F7EE7DE0 as a replacement, which genuinely contains the standard Base64 alphabet including + and /.
closes #1101