bug: expression JSON deserialization throws an uncaught exception on a non-string "type"/"term"
Les mainteneurs répondent en général sous 2 jours
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 75/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- C++
- Étoiles
- 226
- Forks
- 133
- Merge moyen
- 5 j 20 h
- PR mergées (30 j)
- 39
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/iceberg-cpp
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
apache/iceberg-cpp#1000 · 2 commentaires · 1 réaction ·
Les mainteneurs répondent en général sous 2 jours
-
Support Iceberg table encryption (Java-compatible)Peut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 8/100
apache/iceberg-cpp#988 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 20/100
apache/iceberg-cpp#959 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
apache/iceberg-cpp#946 · 5 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
apache/iceberg-cpp#944 ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de apache/iceberg-cpp
Issues similaires
-
llvm.memcpy with destination align but no source align asserts "Missed Source alignment!"Peut-être pris @pvelesko l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
KhronosGroup/SPIRV-LLVM-Translator#4093 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 1 jour
-
SIMQ silently truncates multi-query batch search to the first queryPeut-être pris @LHT129 l’a pris aujourd’hui. Ouvertekind/bug module/index needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
antgroup/vsag#3080 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 Une demi-journée Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
[Bug] Title-bar audio controls shift horizontally when the TX timer appears and disappearsPeut-être pris @w5jwp l’a pris aujourd’hui. Ouvertebug GUI maintainer-review
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
aethersdr/AetherSDR#6455 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour