DjVuLibre 3.5.29 IW44EncodeCodec Integer Overflow (Negative Left Shift in IW44Image::Map::Encode)
DjVuLibre 3.5.29版本存在整数溢出漏洞,源于对负有符号整数进行左移操作,在处理特定PPM输入时引发未定义行为和中间状态损坏,可能导致内存损坏、应用崩溃或信息泄露。 2025-9-8 22:28:24 Author: seclists.org(查看原文) 阅读量:0 收藏

fulldisclosure logo

Full Disclosure mailing list archives


From: Ron E <ronaldjedgerson () gmail com>
Date: Sat, 6 Sep 2025 03:29:38 -0400

The DjVuLibre document compression library (tested version 3.5.29) is
vulnerable to an integer overflow caused by a left shift of a negative
signed integer in the IW44EncodeCodec.cpp component. When processing
crafted PPM input passed through the c44 utility, negative pixel values are
left-shifted in functions such as filter_fh, filter_fv, and
IW44Image::Map::Encode::create. This results in undefined behavior and
corrupted intermediate state during encoding. An attacker can trigger the
condition by supplying specially crafted image data, potentially leading to
memory corruption, application crash*, *or information disclosure depending
on compiler optimizations and runtime environment.


*Impact:*

   - Crash (DoS) confirmed with UBSan/ASan.
   - Possible memory corruption due to undefined behavior on signed shifts

*Proof of Concept:*

convert -size 500x500 gradient: bad.ppm

ASAN_OPTIONS=detect_leaks=0,abort_on_error=1 \

UBSAN_OPTIONS=print_stacktrace=1 \

./tools/c44 bad.ppm out.djvu


*Sanitizer Output:*

IW44EncodeCodec.cpp:936:30: runtime error: left shift of negative value -128

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
IW44EncodeCodec.cpp:936:30
_______________________________________________
Sent through the Full Disclosure mailing list
https://nmap.org/mailman/listinfo/fulldisclosure
Web Archives & RSS: https://seclists.org/fulldisclosure/


Current thread:

  • DjVuLibre 3.5.29 IW44EncodeCodec Integer Overflow (Negative Left Shift in IW44Image::Map::Encode) Ron E (Sep 08)

文章来源: https://seclists.org/fulldisclosure/2025/Sep/23
如有侵权请联系:admin#unsafe.sh