You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Buffer overflow in EncryptHash/DecryptHash (Move of 64 bytes into 16-byte TAESState) #115
TAESState is array[0..3, 0..3] of Byte (16 bytes), so this writes 48 bytes
past the end of State. It is undefined behavior: it may appear to work on
Windows, but on Android (ARM, FMX) it overwrote other locals (in my case
InputBytes itself ended up with Length = 0) and the output differed from
Windows.
The same pattern exists in EncryptPassword (Move with Length of the UTF-8
password bytes) and DecryptPassword (Move with Length of the decoded hex),
which overflow for inputs longer than 16 bytes.
Fix (EncryptHash):
SetLength(InputBytes, SizeOf(State)); // pads with zeros up to 16
Move(InputBytes[0], State, SizeOf(State));
Fix (DecryptHash): validate Length(InputBytes) = SizeOf(State) and raise an
error otherwise, then Move(InputBytes[0], State, SizeOf(State)).
Note: data encrypted with the current version may not decrypt after the fix,
since the overflow can corrupt ExpandedKey depending on the compiler's
stack layout.
Activity
fsansei commentedon Oct 23, 2026
“Sorry, wrong repository”.
MHumm commentedon Oct 24, 2026
Glad you founr that it's not our library. Which one do you use?