Repository navigation
fix(sovereign-agent-connector): reject boolean GCP claims, invalid validity_seconds, and non-canonical base64url signatures (#379) - #384
Conversation
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed exact head c17d8244b79cda2624fc6477ce0a4ceeff8f0970 in an isolated checkout.
The software example rejects boolean GCP numeric claims, invalid validity intervals, malformed public-key hex and noncanonical/wrong-length signatures, while preserving the valid signed placement/appraisal controls. All 53 example tests pass; the focused control fails with the baseline appraisal/core modules restored. I resolved the example's declared requirements into a fresh local hash lock; pip check, scoped example/repository Ruff and diff whitespace checks pass. Operator placement assertions, verified token claims and hardware evidence remain separate. No blocking finding in the changed example; hosted CI and maintainer policy remain separate.
Reviewed with OpenAI Codex.
rajnisht7
left a comment
There was a problem hiding this comment.
independent_verify.py still accepts padded base64url signatures.
tools/independent_verify.py has:
def decode_b64url(value: str) -> bytes:
return base64.urlsafe_b64decode(value + "=" * (-len(value) % 4))verify_ed25519() uses it directly, no canonical re-encode check, no 64-byte length check on the signature, and no lowercase 64-char hex check on the trusted key.
also confirmed a signature with a trailing = is rejected by core._verify_signed but accepted by the independent verifier. The docs describe independent_verify.py as a clean-room reproduction of the same wire semantics, so the two paths should agree.
kindly update decode_b64url (and the key check in verify_ed25519) to match the rules in core._unb64 / _verify_signed, and add a test that a padded signature is rejected. That keeps the independent path consistent with the producer.
dinakarjs
left a comment
There was a problem hiding this comment.
Source follow-up at c17d824. The changed core verifier has canonical base64url and key-format checks, but the added padded-signature test calls only core._verify_signed. It therefore does not cover the independent-verifier discrepancy reported by Rajnish.
Please exercise the same intact signed artifact through both verifier entry points, then alter only its textual signature encoding by adding padding. The canonical control should remain accepted and the same-byte padded representation should be refused by both. Add independent wrong-length signature and malformed trusted-key controls so one validation failure does not hide another. Preserve the independent implementation while aligning the documented wire semantics.
This is a source/test-coverage follow-up to the existing report, not a claim of a fresh local reproduction or test run. Reviewed with OpenAI Codex.
…lidity_seconds, and non-canonical base64url signatures (agentrust-io#379) - Reject boolean GCP numeric claims, non-string/blank GCE instance_id, non-positive or non-int validity_seconds, and non-hex workload_key in agentrust_auc/appraisal.py. - Enforce canonical unpadded base64url signatures (64 decoded bytes) and 64-character lowercase hex trusted keys across both agentrust_auc/core.py (_unb64 / _verify_signed) and tools/independent_verify.py (decode_b64url / verify_ed25519). Closes agentrust-io#379 Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
|
@rajnisht7 @dinakarjs @carloshvp Rebased onto
|
c17d824 to
6b95166
Compare
dinakarjs
left a comment
There was a problem hiding this comment.
Re-reviewed exact head 6b95166 on Linux/Python 3.12.14.
The core and independent signature paths now enforce canonical unpadded base64url, 64-byte Ed25519 signatures and lowercase trusted-key text consistently. I checked the intact signed controls and padding/key/length refusal cases across both entry points. All 72 sovereign-agent-connector tests pass in a fresh environment installed from this example's declared requirements; whitespace passes. My previous independent-verifier follow-up is addressed. These requirements are version declarations, not a fully hash-pinned lock, and the evidence remains bounded to the software example and fixtures; hosted acceptance remains separate.
Reviewed with OpenAI Codex.
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed current head 6b95166f7336305c1c5b1b3eb8c6b92b04c4c150 in an isolated checkout.
The GCP and validity checks reject booleans/malformed values, and core plus independent signature paths agree on canonical unpadded base64url, exact Ed25519 signature lengths and canonical trusted-key hex. The positive/malformed cross-verifier controls pass. All 72 connector tests and 60 root tests pass.
The repository CI Ruff selection and whitespace checks pass; all PR commits carry DCO sign-offs. This approves the bounded software scope. Current-head hosted checks and maintainer requirements remain applicable.
Reviewed with OpenAI Codex.
Closes #379
Summary
iat,exp, andinstance_id(and emptyinstance_id) inmake_gcp_placement_assertion.type(validity_seconds) is int and validity_seconds > 0and canonical 64-char lowercase hexworkload_keyacrossmake_placement_assertion,make_azure_placement_assertion, andmake_gcp_placement_assertion.trusted_key_hexinagentrust_auc.core._unb64and_verify_signed.examples/sovereign-agent-connector/tests/test_appraisal.py.Validation
pytest examples/sovereign-agent-connector/tests/test_appraisal.py -q— passed (14 passed)