Skip to content

Prevent attestation metadata spoofing and unattested redirects - #176

Merged
ameba23 merged 3 commits into
mainfrom
peg/rm-measurement-headers-from-source
Sep 11, 2026
Merged

ameba23 merged 3 commits into
mainfrom
peg/rm-measurement-headers-from-source

Conversation

@ameba23

@ameba23 ameba23 commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

This fixes some security issues.

  • Strips source-supplied measurement headers from requests and responses before inserting verified measurements. Otherwise the source can spoof measurement headers when attestation is disabled.
  • Always enforce the server’s attestation policy, including when it accepts only none, before exposing the peer’s attestation type.
  • Disable redirects and environment proxies in attested-get. The library returns the original response; the CLI rejects 3xx responses. Request errors now propagate instead of panicking.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The public exhaustive ProxyError change is source-breaking without a semver-major release.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Hardens attestation metadata integrity and prevents unattested redirects and proxy use.

Changes:

  • Sanitizes measurement headers and enforces attestation policies.
  • Disables redirects and environment proxies in attested-get.
  • Adds regression tests, CLI redirect rejection, and documentation.
File summaries
File Reviewed change
tests/attested_get_redirect.rs Tests redirect and proxy protections.
src/main.rs Rejects redirect responses in the CLI.
src/lib.rs Sanitizes headers and adds request error handling.
src/attested_get.rs Disables redirects/proxies and propagates errors.
README.md Documents the updated behavior.
attested-tls/src/lib.rs Enforces server-side attestation policies.
Review details

Suppressed comments (1)

src/attested_get.rs:86

  • This changes request execution from an unconditional panic to a ProxyError::Reqwest, but the added tests only cover successful responses and redirects. Please add a regression test that exercises a request/build or execution failure and asserts the error is returned, so this error-propagation contract is protected.
    let response = client.execute(request).await?;
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/lib.rs
@ameba23
ameba23 merged commit 0f3b35a into main Sep 11, 2026
3 checks passed
@ameba23
ameba23 deleted the peg/rm-measurement-headers-from-source branch September 11, 2026 11:03
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.

2 participants