The vulnerability is a Denial of Service in the jsPDF library, caused by improper input validation of BMP image dimensions. The root cause lies in the BmpDecoder.parseBGR function within src/libs/BMPDecoder.js. This function reads the width and height from a BMP file's header and allocates memory for the image data without any size validation. An attacker can craft a BMP file with extremely large dimensions in the header, causing the new Uint8Array(len) allocation to fail and crash the process due to an out-of-memory error.
The primary entry point for this vulnerability is the addImage function, which is a public method of the jsPDF API. When a user provides image data to addImage, it identifies the image type and, for BMPs, delegates parsing to the BMPDecoder. The patch mitigates this vulnerability by adding a check in BmpDecoder.parseBGR to ensure the calculated memory allocation size does not exceed a reasonable limit (512MB), throwing an error if it does. Therefore, any runtime profile during exploitation would show calls to addImage leading to the vulnerable BmpDecoder.parseBGR function.