Skip to content

Hardening: GetObjectAttributes numeric XML coercion to 0 and DeleteObjects root-element validation #219

Description

@harshavardhana

Two low-risk robustness nits raised in the #217 review that were intentionally deferred (server responses are trusted, so real-world risk is low):

  1. GetObjectAttributes silently coerces malformed numeric XML to 0.
    In src/s3/response/get_object_attributes.rs, parse_u32 / parse_u64 use unwrap_or(0), so a malformed or unexpected numeric field (e.g. ObjectSize, part numbers) is silently treated as 0 instead of surfacing a parse error.

  2. DeleteObjects response does not validate the non-error root element name.
    In src/s3/response/delete_object.rs, parse_delete_objects checks for a root <Error> element but otherwise iterates children without first confirming the root is the expected <DeleteResult> element.

Context: follow-up to #217 (CodeRabbit review).

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions