GHSA-mw4c-w54x-248r: ThorVG: Heap buffer overflow (OOB write) in bundled jpgd JPEG decoder
Thor Vector Graphics (ThorVG) is a production-ready vector graphics engine. Prior to 1.1.2, the bundled jpgd JPEG decoder accepts duplicate component selectors in an SOS scan header, causing each duplicate to increase mblockspermcu without checking the buffers sized from the frame components. A crafted grayscale JPEG can repeat its component in the SOS header, causing decode paths in src/loaders/jpg/tvgJpgd.cpp to write beyond heap buffers sized for one component. The issue is reachable through direct JPEG decoding and through JPEG images embedded in Lottie content, and confirmed impact is memory corruption followed by a process crash. This issue is fixed in version 1.1.2.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Thor Vector Graphics (ThorVG)to a version that resolves this vulnerability.Fixed in 1.1.2
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using ThorVG versions before 1.1.2 are exposed if they decode attacker-controlled JPEG files directly or render Lottie content that can contain embedded JPEG images.
What does an attacker need to exploit it?
An attacker needs to cause the application to decode a crafted grayscale JPEG whose SOS scan header repeats a component selector. No attacker privileges are required, but user interaction is required.
What is the confirmed impact?
The malformed JPEG causes an out-of-bounds heap write during decoding. The confirmed result is memory corruption followed by a process crash.
What should be done if immediate patching is not possible?
Avoid decoding untrusted JPEG files and untrusted Lottie content containing embedded JPEG images until ThorVG can be updated. The issue is fixed in version 1.1.2.