-
-
Notifications
You must be signed in to change notification settings - Fork 849
Open
Description
Odin/core/encoding/base64/base64.odin
Lines 122 to 135 in dc57773
| #no_bounds_check { | |
| c0 = DEC_TBL[data[i]] | |
| c1 = DEC_TBL[data[i + 1]] | |
| c2 = DEC_TBL[data[i + 2]] | |
| c3 = DEC_TBL[data[i + 3]] | |
| b0 = (c0 << 2) | (c1 >> 4) | |
| b1 = (c1 << 4) | (c2 >> 2) | |
| b2 = (c2 << 6) | c3 | |
| buf[0] = byte(b0) | |
| buf[1] = byte(b1) | |
| buf[2] = byte(b2) | |
| } |
The issue is that the DEC_TBL has a size of 128, however the input string could contain non-ascii characters leading to an out of bound access. This does not raise a bounds check error, given that it happens in a #no_bounds_check block. I'm not sure what the best way to fix this is, either increasing the table size or adding bounds checks ig. I would imagine the security impact of this to be relatively small, but given that base64 decoding happens rather frequently in a network context this could be a potential attack vector and should be fixed.
Metadata
Metadata
Assignees
Labels
No labels