CVE-2026-136756: Text::Minify::XS versions from 0.3.0 before 0.7.10 for Perl have a heap buffer overflow in minify on malformed UTF-8 when utf8 warnings are disabled
Text::Minify::XS versions from 0.3.0 before 0.7.10 for Perl have a heap buffer overflow in minify on malformed UTF-8 when utf8 warnings are disabled.
Text::Minify::XS removes indentation and trailing whitespace from multi-line text.
With utf8 warnings disabled in the calling scope, a malformed byte decodes to a replacement character that takes more bytes to encode than were read, overflowing the output buffer, which is sized to the input. minifyutf8 is an alias for minify.
The fix for CVE-2026-7040 in version 0.7.8 rejects malformed UTF-8 only when perl reports a decoding error, which it does only when utf8 warnings are enabled.
An application that minifies untrusted text with utf8 warnings disabled, for example under "no warnings", allows heap corruption and a crash.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Text-Minify-XSto a version that resolves this vulnerability.Fixed in 0.7.10
Event History
Frequently Asked Questions
Which applications are realistically exposed?
Applications using Text::Minify::XS from 0.3.0 before 0.7.10 are exposed when they pass untrusted multi-line text to minify or its minify_utf8 alias while UTF-8 warnings are disabled in the calling scope, such as under "no warnings".
What does an attacker need to provide?
An attacker needs to cause the application to minify malformed UTF-8 input. With UTF-8 warnings disabled, malformed bytes can be converted to a replacement character whose encoded output is larger than the input allocation, causing heap corruption and a crash.
Are default warning settings affected?
The described condition requires UTF-8 warnings to be disabled. The earlier 0.7.8 handling rejects malformed UTF-8 only when Perl reports a decoding error, and Perl reports that error only when UTF-8 warnings are enabled.
What can be done if an immediate upgrade is not possible?
Do not send untrusted text to minify or minify_utf8 while UTF-8 warnings are disabled. Ensure UTF-8 warnings are enabled in the calling scope and reject malformed UTF-8 before minification.