Repository navigation
fix(transport): enforce canonical base64url in b64url_decode and reject non-string fields in parse_channel_offer (#271) - #276
Conversation
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed exact head b0852d7785ce0a76034724fb429b71d57dc537d4 in an isolated checkout.
The shared transport decoder rejects noncanonical encodings and the channel-offer parser validates nonempty string claims and mapping-shaped attestation. The six encoding regressions pass here; restoring the actual merge-base decoder/parser in process causes the three nonzero-pad-bit cases to fail their rejection assertions, while existing valid transport exchanges pass in the full suite.
Fresh hash-locked Python 3.12.10 validation: 817 unit tests passed, 16 skipped; pip check, Ruff, mypy and Bandit passed. Commit sign-offs are present. Please trim the extra blank line at test_a2a_adapter.py EOF. No blocking source finding; hosted CI and applicable security-maintainer approvals remain separate.
Reviewed with OpenAI Codex.
|
@drk-ram Kindly rebase on main |
b0852d7 to
1889ce4
Compare
|
@rajnisht7 Rebased onto |
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed current head 9a3a1b6f9782f69de9714b4f57c50533418558ae in an isolated checkout.
The scoped input-hardening behavior passes source review and the full local unit/conformance suite (873 passed, 16 skipped). Ruff lint, mypy, configured Bandit and dependency consistency pass; the commit is signed off.
The required ruff format --check src/ tests/ job still fails on this head, while the same command passes on current main. Please run the pinned formatter on tests/unit/test_a2a_adapter.py and rerun the format gate. The formatting diff is mechanical; no additional behavioral repair is requested by this review. Hosted CI and the independent security-review requirements still apply.
Reviewed with OpenAI Codex.
|
The requested formatting correction is ready for author adoption: dinakarjs#4, commit |
…ct non-string fields in parse_channel_offer (agentrust-io#271) - Require len(value) % 4 != 1 and exact round-trip b64url_encode(raw) == value in b64url_decode. - Require non-empty str values for channel_public_key, platform, measurement, public_key, and nonce and a dict attestation object in parse_channel_offer. Closes agentrust-io#271 Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
|
@carloshvp Amended and force-pushed |
9a3a1b6 to
f231b13
Compare
What
Enforce canonical unpadded base64url in
ca2a_runtime.transport._b64url.b64url_decodeand reject non-string or empty claim fields inca2a_runtime.transport.wire.parse_channel_offer.Why
Closes #271.
Security impact
Prevents malleable non-canonical base64url encodings (non-zero trailing padding bits) in
sealed_payloadand hardware evidence fields (raw_evidence,quote_signature,attestation_key_pem,attestation_key_chain_pem) and prevents silentstr(...)coercion ofnull,bool,int, orlistvalues in channel offers.Test plan
pytestpasses (pytest tests/unit/test_a2a_adapter.py tests/unit/test_peer_request.py tests/unit/test_caller_offer_relay.py -q:85 passed)ruff checkpasses (ruff check src/ca2a_runtime/transport/_b64url.py src/ca2a_runtime/transport/wire.py tests/unit/test_a2a_adapter.py:All checks passed!)mypypasses (mypy --strict src/ca2a_runtime/transport/_b64url.py src/ca2a_runtime/transport/wire.py:Success)DCO sign-off
Developer Certificate of Origin (https://developercertificate.org).