Debian Patches

Status for qt6-5compat/6.11.2-4

Patch Description Author Forwarded Bugs Origin Last update
upstream_d0cd01d_CVE-2026-101201.diff QBinaryJson: prevent OOB read in fromBinaryData()
The fromBinaryData() function computes the document bound in
size_t, but then truncates it to uint. As a result, when
provided a malformed binary json with root.size in the range of
[0xFFFFFFF8, 0xFFFFFFFF], the total size overflows to the values
between 0 and 7, and the size check incorrectly passes.
When combined with a malicious tableOffset, this results in an
out-of-bounds read in the range of up to 4 GiB past the end of
the allocated buffer - depending on the memory layout it can
lead to either a crash or a read of some potentially sensitive
data.

Do the calculations in uint and use qAddOverflow() to detect
overflows. Since the underlying data structure uses uint to
store the size of the allocated data, we can simply return
early if we detect an overflow.

The newly-added test creates a larger buffer and copies a correct
binary json blob there. Then it injects the malformed size of the
payload and a new offset of the data table, together with the new
table. Then the test uses this large buffer to demonstrate an
out-of-bounds read on a modified blob. If the data was not backed
by a large buffer, it would have been an out-of-bounds read.

The fromRawData() method is not affected (assuming that the passed
size is correct), because it uses the input size parameter
directly, without analyzing the internal structure of the binary
json blob.

(cherry picked from commit c0a495894d83a3c48055bd1e544f93147fc6ade1)
(cherry picked from commit 173cc93ec160719dfb0268971ba16e4e8f46dc57)
Ivan Solovev <ivan.solovev@qt.io> no 2026-08-10
upstream_6a61c85_CVE-2026-101201.diff QBinaryJson::fromBinaryData(): do the comparison in size_t
In Qt 6, the QBA can actually store more than UINT_MAX bytes, so
casting to uint can truncate. Use size_t instead.

Amends the port of Qt container size_type form int to qsizetype
(Qt 6.0).

(cherry picked from commit 721ed576391211ca53ecdaaecf6dd41df7bc962e)
(cherry picked from commit 897a3421f925cb73409d3138d464b8c0ab30d15d)
Ivan Solovev <ivan.solovev@qt.io> no 2026-08-11
upstream_CVE-2026-107472.diff QTextCodec: fix OOB read in TSCII codec
The TSCII codec iterates over the input buffer, and if the currently
processed QChar is not ASCII (has a value larger than 0x80), tries to
analyze the next two QChars.
The problem is that it does so without validating the i + 1 and i + 2
indices against the input length. As a result, if it can try to read
up to two QChars past the end of the input buffer.

The test is crafted in such way, that a larger buffer is passed as an
input, so it does not trigger ASAN in case of failure, but rather
simply reports an invalid result.

Note that the else branch in the code that now records an error could
instead save the trailing QChar in the converter state, so that the
following chunk could decode it properly.
But this patch does not try to fix the correctness of the encoding, it
simply eliminates the read past the end of the input buffer.


(cherry picked from commit 5841a625142199bf3c58e6ace6fa2c4a8a2c5254)
(cherry picked from commit 9b5b9a57e72c9d69197b99ab4a3939833d334377)
Ivan Solovev <ivan.solovev@qt.io> no 2026-08-21
upstream_CVE-2026-107479.diff QTextCodec: fix silent truncation of input data to int
The QTextCodec APIs did not account for the fact that QStringView,
QString, and QByteArray uses qsizetype, not int, to represent its
size.

As a result, the size is silently truncated when passing to the
underlying API, which can produce negative values for inputs
larger than INT_MAX. This can lead to all sorts of surprising
results, depending on the codec implementation.

Fix by explicitly checking the input size against INT_MAX. Raise
a warning and return early if the size is greater than this value.

The toUnicode(const char *) overload is special. It is using qstrlen()
to calculate the input size.
The qstrlen() method returns size_t (or uint in 5.15), which is then
truncated to int, and we get the same problem.

Since qstrlen() in 5.15 is broken (returning uint instead of size_t),
fix by using strlen() directly and comparing the result against
INT_MAX. Raise a warning and return early if the size is greater than
this value.

We could theoretically rewrite the code to do the conversion in a loop,
but since it is a compatibility code, the valid usecases are supposed
to use is with inputs less than INT_MAX anyway. If it is required to
deal with a larger input, the chunking can be implemented at the user
side.

[ChangeLog][QTextCodec] Fixed a bug in toUnicode(), fromUnicode(),
and canEncode() methods that could silently truncate the size of
input data if it exceeded INT_MAX. The updated code now raises a
warning and returns an empty QString/QByteArray immediately. To
process long inputs, implement chunking of the input data on the
client side, using the toUnicode() and fromUnicode() overloads that
take the ConverterState as the last parameter.

(cherry picked from commit 8631aea33f3de13c23fcd740d8900c775c18ac00)
(cherry picked from commit aff163c0589bd3c089ab0fe5cfc8a8708319fdc9)
Ivan Solovev <ivan.solovev@qt.io> no 2026-08-24
upstream_CVE-2026-107590.diff QTextCodec: fix OOB write in ICONV codec
The ICONV codec has a size miscalculation error when encoding continues
with a high surrogate kept in the state after encoding of the previous
chunk. The code was requesting a resize based on the length in UTF-16
code points instead of the length in bytes.
As a result, we were requesting half of the bytes that we actually
needed.
Note that since resize() allocates more than requested, the code could
sometimes execute successfully.

The test specifically adds a large tail to the input, so that memcpy()
clearly triggers an out-of-bounds write. The test was triggering ASAN
before the fix.


(cherry picked from commit cf3f5fbc8bae37cd358b8157cff11b329cca02aa)
(cherry picked from commit 724025a7c05596961cc870ef703a2f2b14e55c88)
Ivan Solovev <ivan.solovev@qt.io> no 2026-08-21

All known versions for source package 'qt6-5compat'

Links