Prevent attestation metadata spoofing and unattested redirects - #176
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes some security issues.
attested-get. The library returns the original response; the CLI rejects 3xx responses. Request errors now propagate instead of panicking.