Summary
OpenNHP selects its trusted-execution attestation verifier based on an attacker-controlled test_purpose field in submitted evidence. By including this field and supplying an enrolled measurement and serial-number pair from the allowlist, an attacker may bypass intended attestation checks and obtain unauthorized access.
Affected context
The vulnerability occurs in OpenNHP deployments that use trusted-execution attestation to authorize access and choose a verifier based on fields supplied in attestation evidence. It becomes risky when the evidence can influence verifier selection and the fallback verifier does not enforce the same security guarantees as the intended attestation path.
Exploit preconditions
- Attack surface: The OpenNHP attestation and access-control interface
- Required access: Ability to submit or influence attestation evidence
- Trigger point: Processing evidence containing the
test_purposekey - Additional condition: The attacker must provide an enrolled measurement and serial-number pair from the configured allowlist
- Why exploitation is possible: Attacker-controlled evidence determines verifier selection, causing the fallback path to be used without adequate assurance that the evidence is a legitimate test request
Why this happens
The underlying issue is an authentication-design flaw in which security-critical verifier selection depends on an untrusted input field. The presence of test_purpose causes the FallbackVerifier to execute unconditionally, allowing the request to avoid the intended attestation verification process when matching allowlisted values are supplied. This behavior maps to CWE-287: Improper Authentication, because the system can treat insufficiently verified evidence as proof of an authorized identity or execution state.
Potential impact
- An attacker may bypass trusted-execution attestation
- Unauthorized users or workloads could gain protected access
- Access-control decisions may be based on unauthenticated evidence
- Compromised workloads could use the bypass to reach sensitive services or data
- Audit records could misrepresent the assurance level of an authorized session
General mitigation guidance
Mitigation generally focuses on making verifier selection independent of attacker-controlled claims and ensuring every authorization path provides equivalent authentication assurance.
Common defensive patterns include:
- Select the verifier from trusted server-side policy or an authenticated protocol context
- Treat fields such as
test_purposeas metadata rather than authorization signals - Require cryptographic verification before accepting measurements, serial numbers, or execution-mode claims
- Apply the same strict validation and authorization requirements to fallback and testing paths
- Separate test environments and credentials from production trust domains
- Use least-privilege identities and narrowly scoped allowlists for attestation-approved workloads
- Record verifier selection and attestation outcomes for security auditing
How teams detect issues like this
Detection efforts can include:
- Static analysis and code review for verifier selection controlled by request fields
- Searches for conditional branches that select authentication or authorization handlers from untrusted input
- Tests that submit alternate evidence modes and confirm that every path requires cryptographic verification
- Policy checks requiring server-side control over authentication-method selection
- Runtime monitoring for unexpected use of fallback or test verifiers in production
- Alerts for repeated attestation attempts using
test_purposeor unusual allowlisted measurement and serial-number combinations

