JLSEC-2026-2403: An out-of-bounds read (buffer over-read) vulnerability exists in QTextCodec::codecForName() in Qt...
An out-of-bounds read (buffer over-read) vulnerability exists in QTextCodec::codecForName() in Qt. When the function is called with a QByteArray that is not NUL-terminated (for example, one created with QByteArray::fromRawData()), the codec-name matching routine reads past the end of the supplied buffer. In most cases this results in an incorrect text codec being selected; in the worst case, if the over-read reaches unmapped memory, the process crashes (denial of service). The over-read is bounded by the length of the longest codec-name candidate, and the out-of-bounds bytes are only compared internally against Qt's fixed list of codec names, so no data is disclosed to an attacker. Applications that do not pass non-NUL-terminated QByteArrays to QTextCodec::codecForName() are not exposed. The affected code resides in the Qt5Compat module from Qt 6.0.0 onward, and in Qt Core (qtbase) in Qt 4.x and Qt 5.x.
Affected Software
Event History
Child vulnerabilities
Contains the following vulnerabilities.
Frequently Asked Questions
Which applications are exposed to this issue?
Only applications that call QTextCodec::codecForName() with a QByteArray that is not NUL-terminated are exposed. A QByteArray created with QByteArray::fromRawData() is an example of an input that may meet this condition.
What can an attacker achieve?
The likely effect is selection of an incorrect text codec. In the worst case, reading into unmapped memory can crash the process, causing denial of service; the issue does not disclose data because out-of-bounds bytes are only compared with Qt's fixed codec-name list.
Which Qt components and releases contain the affected code?
The affected code is in the Qt5Compat module from Qt 6.0.0 onward. For Qt 4.x and Qt 5.x, it is in Qt Core (qtbase).
What can be done if an update is not immediately available?
Ensure that every QByteArray supplied to QTextCodec::codecForName() is NUL-terminated. Avoid passing raw, non-NUL-terminated buffers, including QByteArray instances created with QByteArray::fromRawData() unless they are made safely NUL-terminated first.