Scan: a ScanFilter value nested 32 levels deep is accepted; the service refuses it with the nesting text

Abierto Apto para principiantes
#721 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust
Área
backend

Línea de trabajo

Empieza en crates/engine/src/scan.rs, en la rama ScanFilter de handle_scan (alrededor de la línea 124), y luego lee desugar_filter en crates/engine/src/legacy_filter.rs (alrededor de la línea 332) para ver dónde se copian los valores de AttributeValueList. La comprobación de profundidad existente es validate_attribute_values_nesting_depth en crates/core/src/validation, usada por put_item.rs, update_item.rs y delete_item.rs. Se considera terminado cuando un valor de ScanFilter anidado a 32 niveles devuelve la ValidationException de anidamiento y 31 niveles sigue pasando.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

A ScanFilter whose AttributeValueList holds a value nested 32 levels deep is accepted and the scan runs. The service refuses the request with the nesting text it uses for ExpressionAttributeValues and for items.

Measured against Amazon DynamoDB in us-east-1 on 31 October 2026, each request twice, both answers identical. Table pk S HASH, sk S RANGE, items p0/s1 (a 1), p0/s2 (a 2) and p1/s1 (a 3). ExtendDB answers are from main f49c5f823 (SQLite, release build), each request twice, both answers identical.

Request Service ExtendDB main f49c5f823
Scan, "ScanFilter": {"a": {"ComparisonOperator": "EQ", "AttributeValueList": [v]}} with v = {"N": "1"} inside 32 nested L values ValidationException: Nesting Levels have exceeded supported limits: Attributes in the item have nested levels beyond supported limit 200, Count 0, ScannedCount 3
the same with 31 nested L values not sent to the service 200, Count 0, ScannedCount 3

For comparison, the same value in ExpressionAttributeValues of a Scan with a FilterExpression answers the nesting text on the service from 32 levels and passes at 31 (measured 30 and 31 October 2026, #564). The fix for #564 adds that check for ExpressionAttributeValues on Scan and still answers the ScanFilter request above with 200, as main does.

Where the answer comes from

crates/engine/src/scan.rs, handle_scan: the ScanFilter arm at line 124 passes the map to desugar_filter (crates/engine/src/legacy_filter.rs, line 332), which builds the filter expression and its value map from the AttributeValueList entries. No call checks the depth of those values. The depth check the engine uses for items and for the ExpressionAttributeValues of PutItem, UpdateItem and DeleteItem is validate_attribute_values_nesting_depth in crates/core/src/validation (put_item.rs line 180, update_item.rs line 224, delete_item.rs line 96).

Related

#477 item 3: a ScanFilter EQ with an N value that is not a number answers 200 where the service reports the number text; that is the same code path with a different check missing. Whether the service checks QueryFilter and KeyConditions values the same way was not measured.

Lenguaje dominante
Rust
Estrellas
517
Forks
60
Merge medio
5 d 1 h
PR fusionados (30 d)
67

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ExtendDB/extenddb

Todos los issues de ExtendDB/extenddb

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.