Repository navigation
prototype(tdx_collateral): reject non-finite JSON, non-minimal/duplicate PCK OIDs, boolean integer fields, and non-list advisoryIDs (#644) - #650
Open
drk-ram wants to merge 1 commit into
Conversation
…ate PCK OIDs, boolean integer fields, and non-list advisoryIDs (agentrust-io#644) - Reject NaN, Infinity, -Infinity, and overflowed float literals in _json via parse_constant and parse_float. - Reject trailing continuation bytes and non-minimal leading 0x80 subidentifier bytes in _oid, and reject duplicate OIDs in _pck_extension. - Enforce exact int types on QCNL cache expiration hours, collateral snapshot version/tee_type, tcbInfo version/tcbType, qeIdentity version/isvprodid, and tcbEvaluationDataNumber. - Require advisoryIDs (when present) to be a list of non-empty strings. Closes agentrust-io#644 Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
Contributor
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
Member
|
Batch response for this cluster is here: #653 (comment) |
This branch has not been deployed
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.
What this changes
Closes #644.
Hardens offline Intel TDX collateral appraisal in
prototype/tdx_collateral.py:NaN,Infinity,-Infinity, and overflowed float literals (1e309,-1e309) in_jsonviaparse_constantandparse_float.value[-1] & 0x80 != 0) and non-minimal leading0x80subidentifier bytes in_oid, and rejects duplicate OIDs in_pck_extension.inttypes (type(...) is int) on QCNL cache expiration hours (pck_cache_expire_hours,verify_collateral_cache_expire_hours), collateral snapshotversionandtee_type,tcbInfoversionandtcbType,qeIdentityversionandisvprodid, andtcbEvaluationDataNumber.advisoryIDs(when present) is alistof non-emptystritems before sorting.Validation commands and results:
PYTHONPATH=src python -m pytest tests/test_tdx_collateral.py -q-> passed (36 passed, 51 skipped)python -m ruff check prototype/tdx_collateral.py tests/test_tdx_collateral.py-> passed (All checks passed!)python tools/check_dashes.py-> passed (no dashes outside examples/, spec/trace-v0.1.md)PYTHONPATH=src python tools/review_bar.py --base origin/main --head HEAD-> passed (23 changed test cases fail on behaviour at origin/main)Type of change
Spec section
prototype/tdx_collateral.py(experimental Intel TDX QVL collateral appraisal prototype; no normative change tospec/trace-v0.2.md)Tests for a fix
parse_constant=_no_constantsandparse_float=_finite_floatin_json:tests/test_tdx_collateral.py::test_json_rejects_nan_infinity_and_float_overflow0x80subidentifier byte checks in_oid:tests/test_tdx_collateral.py::test_oid_rejects_trailing_continuation_and_leading_zero_subidentifier_pck_extension:tests/test_tdx_collateral.py::test_pck_extension_rejects_duplicate_outer_and_inner_oidsintchecks onpck_cache_expire_hoursandverify_collateral_cache_expire_hoursin_check_qcnl:tests/test_tdx_collateral.py::test_check_qcnl_rejects_boolean_and_float_cache_expire_hoursintchecks onsnapshot["version"],snapshot["tee_type"],tcb_info["version"],tcb_info["tcbType"],qe_identity["version"],qe_identity["isvprodid"], andlist[str]validation onadvisoryIDsinappraise_collateral:tests/test_tdx_collateral.py::test_appraise_collateral_rejects_non_int_fields_and_invalid_advisory_idsChangelog entry
prototype.tdx_collateralnow rejects non-finite JSON constants and overflowed floats in_json, incomplete or non-minimal DER OIDs and duplicate OIDs in_pck_extension, boolean/float values on integer collateral/QCNL fields, and non-list or non-stringadvisoryIDs.Checklist
git commit -s)<!-- CHANGED: #NNN: description -->in spec text