Exempi through version 2.4.5 is vulnerable to a NULL pointer dereference in the WEBP_Support.hpp:WEBP::GetLE32() function. An attacker could exploit this to cause a denial of service via a crafted file.
Created exempi tracking bugs for this issue:
Affects: fedora-all [bug 1594643]
This issue did not affect the versions of exempi as shipped with Red Hat Enterprise Linux 6 and 7 as they did not include support for WEBP format in the code of which the vulnerability exists.
void VP8XChunk::xmp(bool hasXMP)
XMP_Uns32 flags = GetLE32(&this->data);
flags ^= (-hasXMP ^ flags) & (1 << XMP_FLAG_BIT);
WEBP_Support.hpp (not accurately ordered):
static inline XMP_Uns32 GetLE16(const XMP_Uns8* const data)
return (XMP_Uns32)(data << 0) | (data << 8);
static inline XMP_Uns32 GetLE32(const XMP_Uns8* const data)
return (XMP_Uns32)GetLE16(data) | (GetLE16(data + 2) << 16);
static inline void PutLE16(XMP_Uns8* const data, XMP_Uns32 val)
assert(val < (1 << 16));
data = (val >> 0);
data = (val >> 8);
static inline void PutLE32(XMP_Uns8* const data, XMP_Uns32 val)
PutLE16(data, (XMP_Uns32)(val & 0xffff));
PutLE16(data + 2, (XMP_Uns32)(val >> 16));
The code should check if this->data is a vector of required size before accessing it. In the reproducer attached to upstream bug, this->data is an empty vector, which causes NULL pointer dereference (though it may also cause an out of bounds access - error may be different based on what code is generated by the compiler).
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):