Scan: a ScanFilter value nested 32 levels deep is accepted; the service refuses it with the nesting text
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 crates/engine/src/scan.rs 中 handle_scan 的 ScanFilter 分支(约第 124 行)开始阅读,然后查看 crates/engine/src/legacy_filter.rs 中的 desugar_filter(约第 332 行),了解 AttributeValueList 的值在哪里被复制。现有的深度检查是 crates/core/src/validation 中的 validate_attribute_values_nesting_depth,被 put_item.rs、update_item.rs 和 delete_item.rs 使用。完成标准是:嵌套 32 层的 ScanFilter 值返回嵌套相关的 ValidationException,而 31 层仍然通过。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Rust
- 星标
- 517
- 派生
- 60
- 平均合并
- 5 天 5 小时
- 30 天内合并 PR
- 41
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ExtendDB/extenddb 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 4 天内回复
-
bug security
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 4 天内回复
-
bug security
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 4 天内回复
-
Launch-prep: scope statement + backend tiers + version policy可能已有人在做 @navareamol 于 1 天前认领。 未关闭
难度 2/5 3-5 天 新手友好度 65/100
ExtendDB/extenddb#662 · 已指派 1 人 ·
维护者通常 4 天内回复
查看 ExtendDB/extenddb 的全部 Issue
相似的 Issue
-
r-bug
难度 1/5 1 小时以内 新手友好度 88/100
servo/rust-smallvec#844 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 76/100
farion1231/cc-switch#9122 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
lbjlaq/Antigravity-Manager#3801 ·
维护者通常 1 天内回复
-
LIMIT inputs are named MIN/MAX instead of the standard MN/MX, so LIMIT(MN := ...) does not resolve未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
Published SDL drops input-field default values: a non-null field with a default renders as required未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复