bug: expression JSON deserialization throws an uncaught exception on a non-string "type"/"term"
Maintainer antworten meist innerhalb von 2 Tagen
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 75/100
Rechercherichtung
Start in src/iceberg/expression/json_serde.cc and compare the unguarded type/term checks with OperationTypeFromJson and util/json_util_internal.h. Trace the metadata path through FieldFromJson in src/iceberg/json_serde.cc and the REST filter entry points mentioned in metrics/json_serde.cc and catalog/rest/json_serde.cc. Done means non-string discriminators return JsonParseError rather than escaping as nlohmann exceptions.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
The expression JSON deserialization functions in src/iceberg/expression/json_serde.cc call json[kType].get<std::string>() (and one json[kTerm].get<std::string>()) guarded only by is_object() and contains(kType). When "type" or "term" is a number, bool, null, or array, nlohmann throws json::type_error.302. These functions return Result<...> and the expression parse chain has no try/catch, so the exception escapes the Result contract and terminates any caller that lacks an exception barrier.
Root Cause
The unguarded get<std::string>() calls sit behind only is_object() && contains(kType): IsTransformTerm, NamedReferenceFromJson (both the type and the term node), both LiteralFromJson overloads' wrapper check, and ExpressionFromJson. The sibling OperationTypeFromJson already checks is_string() first, and util/json_util_internal.h exists precisely to convert nlohmann throws into JsonParseError. The unguarded sites are the outliers, not the policy.
Impact
These parsers run on real deserialization paths, all through ICEBERG_ASSIGN_OR_RAISE, which forwards a Result error but not a thrown exception. Table-metadata parsing is the live path today: FieldFromJson (src/iceberg/json_serde.cc) parses a field's initial-default / write-default through the type-aware LiteralFromJson, so a metadata file whose default is wrapped as {"type": <non-string>, "value": ...} throws instead of returning a parse error — the same path #877/#878 hardened. REST catalog responses reach the expression sites too: the scan-metrics report filter (metrics/json_serde.cc) and the residual, partition, and plan filters (catalog/rest/json_serde.cc) all parse server-supplied JSON. A non-string discriminator on any of these throws type_error.302 out of a Result-returning function and past the ICEBERG_ASSIGN_OR_RAISE call site, which is the same uncaught-exception-escaping-Result class as the merged #857.
Per SECURITY-THREAT-MODEL.md, catalog-supplied metadata is trusted input, so this is a robustness and contract issue, not a security one.
Proposed Fix
Add an is_string() check to each guard so a non-string type/term returns JsonParseError, mirroring OperationTypeFromJson.
- Vorherrschende Sprache
- C++
- Sterne
- 226
- Forks
- 133
- Ø Merge
- 5 T. 10 Std.
- Gemergte PRs (30 T.)
- 33
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/iceberg-cpp
-
bug: ReferenceVisitor::GetReferencedFieldIds dereferences null on a bound COUNT(*)Evtl. vergeben @LuciferYang hat das vor 11 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
apache/iceberg-cpp#978 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug: InMemoryCatalog skips the namespace existence check in CreateTable and RegisterTableEvtl. vergeben @LuciferYang hat das vor 11 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/iceberg-cpp#977 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
apache/iceberg-cpp#1000 · 1 Kommentar · 1 Reaktion ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Support Iceberg table encryption (Java-compatible)Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 8/100
apache/iceberg-cpp#988 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
apache/iceberg-cpp#959 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in apache/iceberg-cpp
Ähnliche Issues
-
ai_p2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
ClickHouse/ClickHouse#125522 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG] rpicam-still loops forever with "ERROR: Device timeout detected, attempting a restart!!!"Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
raspberrypi/rpicam-apps#934 ·
-
[BUG] The priority slider's keyboard-hints tooltip shows on the 'Default' label, not the sliderOffenagent:WSL bug linux LOW ui
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 1 Tag
-
Branch-3.3.5a
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
TrinityCore/TrinityCore#32060 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
open-telemetry/opentelemetry-cpp#4697 ·
Maintainer antworten meist innerhalb von 1 Tag