Home / vulnerabilitiesPDF  

tiny-AES128-C Buffer Overflow

Posted on 15 October 2015
Source : packetstormsecurity.org Link

 

The library tiny-AES128-C, available from https://github.com/kokke/tiny-AES128-C , contains a buffer overflow in its AES128_CBC_encrypt_buffer() function, where 15 bytes beyond the end of the input buffer can be overwritten. For instance, if the function is invoked with an input buffer of length 33, the bytes at offsets 33…47 with respect to the beginning of the input buffer will be overwritten. An attacker controlling either the key or the plaintext has some latitude to choose the values of some of the bytes thus overwritten.

A fix for the buffer overflow was first proposed by GitHub user andreas-wehrmann in the form of a pull request: https://github.com/kokke/tiny-AES128-C/pull/18

Vincent Benayoun and I fixed a residual issue (a longish writeup can be found at http://trust-in-soft.com/the-sociology-of-open-source-security-fixes-continued/ )

The principal author for the library, who appeared to have abandoned it at the time, has since fixed compiler warnings in tiny-AES128-C, but has not at the time of this writing integrated any fix for the buffer overflow: https://github.com/kokke/tiny-AES128-C/commit/7c959460a188611c26aa45c54c6e8b96b7ac163a

 

TOP