Repository navigation
fix(transport,harness): validate collect_metadata/parent_record_hash, bound SDK float-to-int by safe int, and reject duplicate JSON keys in harness (#286) - #291
Conversation
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed exact head 9e81cc380152ff2b2f01e35e5df706cb3fa58c0a in an isolated checkout.
The adapter refuses non-object metadata and empty supplied parent hashes, SDK float conversion is bounded to finite safe integers, and the hardware harness rejects ambiguous configuration/chain JSON before provider work. The focused adapter boundary control passes here and fails against the baseline adapter module. Valid adapter and harness software controls remain passing; this review does not claim hardware acceptance.
Independent validation in a fresh repository-hash-locked Python 3.12.10 environment: 780 tests passed, 16 skipped; pip check, configured Ruff, mypy, Bandit and diff whitespace checks passed. Commit sign-offs are present. Hosted CI and applicable independent maintainer/security gates remain separate prerequisites to merge.
Reviewed with OpenAI Codex.
9e81cc3 to
1889ce4
Compare
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed current head 2a0c45e478818b899285b2eab9f1faad05d46cba in an isolated checkout.
The adapter rejects non-object metadata and empty parent hashes, SDK integer normalization is limited to finite safe-integer values, and the hardware-harness JSON loader rejects duplicate members. This is software input/transport validation; I did not run a hardware acceptance session.
Fresh Python 3.12.10 validation: 836 passed, 16 skipped; Ruff, mypy and configured Bandit pass. The installed dependencies are consistent, and the PR commit carries a DCO sign-off. The required format check and whitespace check pass. Hosted CI and the required independent security approvals remain separate.
Reviewed with OpenAI Codex.
2a0c45e to
57b1026
Compare
|
@drk-ram Sorry for the late reply. Thanks for these hardening changes. Could you address the OpenTelemetry dependency audit failure before merging? As nonblocking follow-ups, please add regression tests for empty parent hashes and SDK integer boundaries, and consider rejecting overflow JSON numbers such as |
|
@zohebk8s Addressed the OpenTelemetry audit failure and the follow-ups on
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
… bound SDK float-to-int by safe int, and reject duplicate JSON keys in harness (agentrust-io#286) Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
Reject 1e400 in the harness JSON loader via parse_float and math.isfinite. Add regression coverage for an empty parent_record_hash and for SDK safe-integer boundaries at +/-(2**53 - 1). Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
063d375 to
e9d5fb8
Compare
zohebk8s
left a comment
There was a problem hiding this comment.
Thanks for addressing the review feedback. The tests now cover empty parent hashes and SDK integer boundaries, overflow JSON numbers are rejected, and the dependency audit passes. Approved.
What
Validate
message_or_requestandmetadatamapping types and reject empty stringparent_record_hashina2a_adapter, boundmetadata_from_sdk_messagefloat-to-int conversion by RFC 8785 safe-integer limits (2**53 - 1), and reject duplicate JSON keys andNaN/Infinityinhardware_acceptance.Why
Closes #286.
Security impact
Prevents unhandled
AttributeError/TypeErroron malformed A2A envelopes, prevents lossy IEEE-754 floats>= 2**53in protobufStructmetadata from being coerced into imprecise integers, and closes duplicate-key JSON smuggling in the hardware acceptance harness.Test plan
pytestpasses (pytest tests/unit/test_hardware_acceptance.py tests/unit/test_a2a_adapter.py -q:27 passed, 1 skipped)ruff checkpasses (ruff check src tests/unit/test_hardware_acceptance.py:All checks passed!)mypypassesDCO sign-off
Developer Certificate of Origin (https://developercertificate.org).