Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Scan request validation gaps: empty ScanFilter in the parameter mix, empty AttributesToGet, legacy and ExclusiveStartKey numbers, ExpressionAttributeValues nesting depth

Đang mở
#564 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@LeeroyHannigan đang làm issue này rồi.

Từ ngày 25/10/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Observed on the service

Measured against DynamoDB (us-east-1) on 2026-10-25 at 10:38 and 10:55 UTC, each request sent twice, raw signed HTTP Scan on an existing table of 29 items.

  1. An empty ScanFilter counts as present for the expression and non-expression parameter mix. ScanFilter: {} with FilterExpression: "a = :n" answers ValidationException: Can not use both expression and non-expression parameters in the same request: Non-expression parameters: {ScanFilter} Expression parameters: {FilterExpression}. ScanFilter: {} alone is accepted (200, Count 29); ScanFilter: {} with an unused {"N": "bob"} answers the number text.
  2. An empty AttributesToGet is refused by a length constraint ahead of the number check. AttributesToGet: [] alone, with a FilterExpression, or with a FilterExpression and a {"N": "bob"} value, answers 1 validation error detected: Value at 'AttributesToGet' failed to satisfy constraint: Member must have length greater than or equal to 1.
  3. A malformed N in a legacy ScanFilter AttributeValueList answers The parameter cannot be converted to a numeric value: bob.
  4. A malformed N in ExclusiveStartKey (with a valid filter) answers The parameter cannot be converted to a numeric value: bob.
  5. ExpressionAttributeValues nesting depth. An L nested 32 or deeper with a valid N at the bottom, unused, answers Nesting Levels have exceeded supported limits: Attributes in the item have nested levels beyond supported limit (depths 32, 33, 40 and 60 measured); 31 levels answers the unused-value text. With {"N": "bob"} at the bottom, depths 31 to 60 and an M at 32 answer the number text: the number check runs before the nesting check. At 100 levels the service answers ExpressionAttributeValues contains invalid value: Nesting Levels have exceeded supported limits: Attributes in the item have nested levels beyond supported limit for key :d.

Observed on ExtendDB

At the head of the Scan number check branch, and on main except where main has no number check on Scan (item 2):

  1. ScanFilter: {} with a FilterExpression is accepted (200, the filter runs).
  2. AttributesToGet: [] is accepted (200), with or without a ProjectionExpression or a number fault; with a {"N": "bob"} value the number text is reported instead of the length constraint.
  3. ScanFilter with {"N": "bob"} in an AttributeValueList is accepted (200, Count 0).
  4. ExclusiveStartKey with {"N": "bob"} on an S key answers The provided starting key is invalid: The provided key element does not match the schema.
  5. No nesting depth check on Scan or Query: a 32 level L with a valid number answers the unused-value text or scans; at 100 levels the JSON parser's limit answers SerializationException: ... recursion limit exceeded. PutItem, UpdateItem and DeleteItem call validate_attribute_values_nesting_depth; scan.rs and query.rs do not.

Proposed change

In the Scan request-time checks: count an object ScanFilter as present whether or not it is empty; refuse AttributesToGet: [] with the length constraint text, ahead of the number check; run the number check over the legacy AttributeValueList values and the ExclusiveStartKey values; and call the nesting depth check on ExpressionAttributeValues after the number check, with the bare text for depths the parser accepts. The same AttributesToGet and QueryFilter questions apply to Query and should be measured there before they are encoded.

Ngôn ngữ chính
Rust
Star
517
Fork
60
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
25

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ExtendDB/extenddb

Tất cả issue của ExtendDB/extenddb

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.