Missing validation in JSON constructors, LEFT expressions, and CH-block decoding
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
The report identifies three areas: JSON constructors, buildLeftUTF8Function, and CH-block decoding, including cached appends; it does not name source files or tests. Start by tracing those entry points and their existing error handling, then inspect related tests for JSON, LEFT expressions, and V0/V1/V2 decoding. Done means rejecting the described invalid inputs with the specified errors while preserving the valid cases; pull request #11329 is already open.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug Report
1. Minimal reproduce step (Required)
These are source-level reproduction scenarios; they were not executed locally.
- Pass a non-NULL, zero-byte binary JSON value to the internal
json_arrayfunction, or as a value argument tojson_object. These functions expect binary JSON, so this input represents an invalid binary JSON payload, not a valid JSON empty string. Both nullable and non-nullable execution branches constructJsonBinaryusingdata_from.size - 1without first checking that the input is nonempty. - Build a scalar DAG expression with signature
tipb::ScalarFuncSig::LeftUTF8and zero children, or one valid string child, then analyze it withDAGExpressionAnalyzer::getActions.buildLeftUTF8Functionreads children 0 and 1 without first checking their count. With more than two children, extra arguments are silently ignored. - Decode a CH-block chunk declaring two rows and two UInt64 columns, but containing two values in the first column and only one value, or no values, in the last column. For V1/V2, keep the declared sub-block row count at two and compress the shortened raw payload so compression framing remains valid. Exercise both first-chunk decoding and appending after a valid cached chunk. A single-column chunk that provides fewer values than its declared row count exposes the same missing validation.
2. What did you expect to see? (Required)
Reject non-NULL empty binary JSON with BAD_ARGUMENTS, before reading its type byte or subtracting from its length. SQL NULL values should still become JSON null, correctly encoded JSON empty strings should remain valid, and json_object should continue to accept empty member names.
Reject LEFT expressions whose child count is not exactly two with an ordinary Coprocessor::BadRequest error before accessing any child. Preserve normal two-argument UTF-8 LEFT behavior.
Reject CH-block columns whose decoded row count does not match the declared count with an ordinary CANNOT_READ_ALL_DATA error before exposing the Block to downstream execution. Check each column and sub-block, accounting for rows accumulated from previous chunks. Preserve valid V0/V1/V2 decoding, compression, and cached appends.
3. What did you see instead (Required)
For empty binary JSON constructor values, the length subtraction wraps to SIZE_MAX. JsonBinary stores that length without validation; the array/object builders can pass it through VectorWriter::write to memcpy, potentially crashing TiFlash.
For LEFT expressions with fewer than two children, the analyzer indexes outside the protobuf repeated field, potentially crashing TiFlash. Extra children are ignored instead of being rejected.
For truncated CH-block columns, numeric bulk deserialization accepts short reads at EOF. The V0 and V1/V2 decode paths do not verify each column's actual resulting size, and Block::rows() only reports the first column's size. A Block whose first column has two rows and last column has one can therefore reach downstream vectorized code that assumes equal column lengths, potentially reading outside the shorter column's valid range. The same gap exists during cached appends.
These findings were confirmed by source inspection, without a local runtime reproduction.
4. What is your TiFlash version? (Required)
master at 1e98c8ec6627674d848132a8f81b79baec80a7ad.
- Lingua principale
- C++
- Stelle
- 1k
- Fork
- 428
- Merge medio
- 2g 7h
- PR unite (30g)
- 100
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pingcap/tiflash
-
component/compute type/bug
Difficoltà 2/5 1-2 giorni Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Out-of-bounds read in MyDateTime formatting from unvalidated packed valuesForse già presa @ChangRui-Ryan l’ha presa oggi. Apertaaffects-25.10 affects-26.3 affects-26.9 affects-7.5 affects-8.1 affects-8.5 severity/major type/bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
I maintainer di solito rispondono entro 1 giorno
-
component/storage severity/moderate type/bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
pingcap/tiflash#11335 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[disagg] Query fails with Code: 11000 NoSuchKey when S3 GC (ScanThenDelete) removes a DMFile that a compute node still readsForse già presa @JinheLin l’ha presa 6 giorni fa. Apertamay-affects-25.10 may-affects-26.3 may-affects-26.9 may-affects-7.5 may-affects-8.1 may-affects-8.5 severity/moderate type/bug
pingcap/tiflash#11291 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Support binding a TiFlash node to a specific keyspaceForse già presa @ChangRui-Ryan l’ha presa 7 giorni fa. Apertatype/enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di pingcap/tiflash
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
useless statementAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
grizzlypeak3d/DJV#962 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno