Skip to content

fix(ramen-ai-cmcp): enforce canonical base64url and reject duplicate JSON keys in _receipt_verify.py (#367) - #372

Open
drk-ram wants to merge 1 commit into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-ramen-ai-367
Open

drk-ram wants to merge 1 commit into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-ramen-ai-367

Conversation

@drk-ram

@drk-ram drk-ram commented Oct 23, 2026

Copy link
Copy Markdown

Summary

  • Enforce canonical unpadded 64-byte base64url (^[A-Za-z0-9_-]+$, len % 4 != 1, round-trip match) in integrations/ramen-ai-cmcp/_receipt_verify.py (_b64url_decode).
  • Reject duplicate JSON object keys, NaN/Infinity constants, and non-object canonical_payload values in _verify.

Closes #367

Validation

  • python -m pytest integrations/ramen-ai-cmcp/tests/test_mapping.py -q

…JSON keys in _receipt_verify.py (agentrust-io#367)

- Enforce canonical unpadded 64-byte base64url in _receipt_verify._b64url_decode.
- Reject duplicate JSON object keys, NaN/Infinity constants, and non-object canonical_payload values in _receipt_verify._verify.

Closes agentrust-io#367

Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@drk-ram
drk-ram requested review from a team, carloshvp and imran-siddique as code owners October 23, 2026 23:08
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Contributor Check: MEDIUM

Check Result
Profile MEDIUM
Credential LOW
Overall MEDIUM

Automated check by AgenTrust Contributor Check.

@github-actions github-actions Bot added the needs-review:MEDIUM Contributor check flagged MEDIUM risk label Oct 23, 2026

@carloshvp carloshvp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 5506a7a6acc47b87758004899beb874f9c25c122 in an isolated checkout.

Reviewed canonical unpadded signature decoding/length, typed receipt fields, object-shaped canonical_payload and recursive duplicate/non-finite JSON rejection before trust is asserted. The explicitly trusted signed conformance fixtures remain valid and malformed/tampered/untrusted cases fail; default trust is not broadened. No blocking source finding in this scope.

Validation in the hash-locked Python 3.12.10 integration environment: all 24 mapping/trust tests passed; pip check, scoped Ruff and diff whitespace checks passed. Every PR commit has a sign-off. Hosted checks and the maintainer gate still need completion.

Reviewed with OpenAI Codex.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review:MEDIUM Contributor check flagged MEDIUM risk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ramen-ai-cmcp): enforce canonical base64url and reject duplicate JSON keys in _receipt_verify.py

2 participants