-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The current decoder logic filters values that contain non-ascii characters. This works quite well, however, if the encoded value contains a unicode character (chinese symbols, ê, etc.) it will be silently skipped.
gitleaks/detect/codec/ascii.go
Lines 13 to 22 in 6eaad03
| // isPrintableASCII returns true if all bytes are printable ASCII | |
| func isPrintableASCII(b []byte) bool { | |
| for _, c := range b { | |
| if !printableASCII[c] { | |
| return false | |
| } | |
| } | |
| return true | |
| } |
To Reproduce
- Base64-encode a value that uses a valid UTF8 character
- Attempt to decode it; it will be skipped.
Expected behavior
Segments with valid UTF8 characters ideally shouldn't be skipped. I don't know what the performance implications are of this.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working