Skip to content

fix(startup): reject unknown TEE provider names at startup (HW-001) - #232

Merged
imran-siddique merged 1 commit into
mainfrom
fix/hw-001-tee-platform-validation
Jun 7, 2026
Merged

fix(startup): reject unknown TEE provider names at startup (HW-001)#232
imran-siddique merged 1 commit into
mainfrom
fix/hw-001-tee-platform-validation

Conversation

@imran-siddique

Copy link
Copy Markdown
Member

Summary

  • Closes MEDIUM: TEE platform string not validated before use in attestation report — open string injection (HW-001) #171 (HW-001: TEE platform string not validated before use in attestation report)
  • Adds _VALID_PROVIDERS: frozenset[str] constant to startup.py with the five canonical provider names (sev-snp, tdx, opaque, tpm, software-only), mirroring the keys of _PROVIDER_MAP in audit/trace_claim.py without creating a circular import
  • Validates attestation_report.provider against that allowlist immediately after attestation succeeds; calls _fatal("ATTESTATION_PROVIDER_INVALID", ...) and sys.exit(1) on any unknown value, preventing the string from propagating into TRACE Claims or Cedar policy context

Test plan

  • test_startup_fails_on_unknown_tee_provider_name: mocks SoftwareOnlyProvider.get_attestation_report to return a report with provider="evil-custom-tee" and asserts sys.exit(1)
  • All 9 existing startup tests continue to pass
  • Run pytest tests/unit/test_startup.py -v locally — all green

🤖 Generated with Claude Code

…loses #171)

Add _VALID_PROVIDERS frozenset to startup.py and validate
attestation_report.provider immediately after attestation succeeds.
An unrecognised provider name calls _fatal() and exits 1 before the
value can propagate into TRACE Claims or Cedar policy context.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@imran-siddique
imran-siddique merged commit 7fbdd99 into main Jun 7, 2026
1 of 8 checks passed
@imran-siddique
imran-siddique deleted the fix/hw-001-tee-platform-validation branch July 29, 2026 23:19
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.

MEDIUM: TEE platform string not validated before use in attestation report — open string injection (HW-001)

1 participant