oCERT-2008-009 libxslt heap overflow


The libexslt library bundled with libxslt is affected by a heap-based buffer overflow which can lead to arbitrary code execution.

The vulnerability is present in the rc4 encryption/decryption functions. An arbitrary length string, passed as an argument in the XSL input, is incorrectly copied over a padding variable which is previously allocated with a fixed size of 128bit (RC4_KEY_LENGTH).

Aside from the heap overflow other bugs affect the code, the length of the plaintext string argument is used for computing the key length rather than the actual key and the zero-padding of the key is incorrectly computed.

A simple XML file with excessively long input can be crafted for triggering the heap overflow.

The following patch fixes the issue: exslt_crypt.patch.

Affected version:

libxslt >= 1.1.8, <= 1.1.24

Fixed version:

libxslt >= 1.1.25

Credit: vulnerability report and PoC code received from Chris Evans <scarybeasts [at] gmail [dot] com>, Google Security Team.

CVE: CVE-2008-2935


2008-07-03: vulnerability report received
2008-07-08: contacted libxslt maintainer
2008-07-10: maintainer provides patch
2008-07-17: patch fixes finalized per reporter feedback
2008-07-18: contacted affected vendors
2008-07-31: advisory release