Skip to content

fix: bound reference HTTP ingress - #99

Merged
imran-siddique merged 1 commit into
mainfrom
agent/harden-reference-http-ingress
Aug 11, 2026
Merged

fix: bound reference HTTP ingress#99
imran-siddique merged 1 commit into
mainfrom
agent/harden-reference-http-ingress

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

What changed

  • validate Content-Length as bounded decimal input before reading
  • return structured 400 responses for malformed UTF-8/JSON instead of escaping the handler
  • apply a ten-second socket read timeout to incomplete requests
  • require exactly one non-empty handshake nonce, capped at 256 characters
  • serialize attestation-provider failures through the normal cA2A error path
  • document the reference-server bounds and add raw HTTP regression tests

Why

The unauthenticated reference server converted Content-Length with a bare int() and decoded request bodies without handling invalid UTF-8. Malformed traffic could terminate worker handlers outside the structured error path. Body reads also had no timeout, and handshake query/nonce input was not explicitly bounded before invoking an attestation provider.

Impact

Well-formed clients are unchanged. Malformed or ambiguous requests fail promptly and predictably. Production deployments should still apply platform-level connection and rate limits.

Validation

  • focused live HTTP tests: 20 passed
  • full suite: 398 passed, 3 skipped (hardware-only)
  • Ruff check and format gate
  • mypy strict
  • Bandit
  • git diff --check

@imran-siddique
imran-siddique force-pushed the agent/harden-reference-http-ingress branch from 7f4733d to e357c90 Compare August 11, 2026 21:59
@imran-siddique
imran-siddique marked this pull request as ready for review August 11, 2026 21:59
@imran-siddique
imran-siddique merged commit 8231b9b into main Aug 11, 2026
11 checks passed
@imran-siddique
imran-siddique deleted the agent/harden-reference-http-ingress branch August 11, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant