Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

prototype(execution_appraisal,azure_execution_binding): fail closed with ExecutionDenied on malformed inputs, private JWKs, and non-minimal Base64urlUInt

Aperta
#583 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@drk-ram ci sta già lavorando.

Dal 19/10/2026.

  • #589 di @drk-ram — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start by reading prototype/execution_appraisal.py and prototype/azure_execution_binding.py, focusing on the named parsing and authentication functions. Run the supplied reproductions first, then inspect or add tests around malformed JWTs, JWKs, signatures, UEFI logs, and entry-point types. Done means every listed malformed or noncanonical input raises ExecutionDenied, valid inputs still work, and private JWK parameters and non-minimal RSA encodings are rejected.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What is wrong

Contributor: Raghuvar Durga (@drk-ram)

On main (a7f0858), prototype/execution_appraisal.py and prototype/azure_execution_binding.py have several input-validation and exception-boundary gaps:

  1. prototype/execution_appraisal.py (authenticate_token and appraise_launch):

    • authenticate_token(token, jwks) is a public function documented as failing closed with ExecutionDenied, yet calling it directly with malformed JWT headers/payloads or malformed jwks leaks raw UnicodeDecodeError, json.JSONDecodeError, KeyError, TypeError, and InvalidSignature instead of raising ExecutionDenied.
    • authenticate_token checks key.get("kty") != "RSA", n.bit_length() < 2048, and e != 65537, but:
      • Does not reject RSA JWKs carrying private key parameters (d, p, q, dp, dq, qi, oth, k).
      • Does not reject non-minimal Base64urlUInt encodings of n and e with leading zero bytes (0x00, forbidden by RFC 7518 §6.3.1.1), which allows the same RSA key to be represented with padded n/e bytes.
    • In appraise_launch (line 185), signature = base64.b64decode(packet["holder_signature_b64"], validate=True) does not check isinstance(packet.get("holder_signature_b64"), str) or canonical base64 round-trip encoding (base64.b64encode(signature).decode("ascii") == packet["holder_signature_b64"]) or 64-byte signature length before passing to Ed25519PublicKey.verify.
  2. prototype/azure_execution_binding.py (parse_quote, parse_uefi_log, parse_ima_log, appraise_execution, authenticate_ak):

    • Calling parse_quote, parse_uefi_log, parse_ima_log, appraise_execution, or authenticate_ak with non-bytes / non-dict inputs leaks raw TypeError or AttributeError instead of raising ExecutionDenied.
    • In parse_uefi_log (line 151), if len(log) < 32: is not checked before struct.unpack_from("<I", log, 28), and 32 + size > len(log) is not checked before slicing header = log[32 : 32 + size].
    • In authenticate_ak (lines 422-426), n = keys[0]["n"] is decoded with base64.urlsafe_b64decode(n + "=" * (-len(n) % 4)) without validating canonical base64url encoding or rejecting private JWK members (d, p, q, dp, dq, qi, oth, k) on the HCL HCLAkPub JWK.

Reproduction on main (a7f0858):

from prototype import execution_appraisal as ea
from prototype import azure_execution_binding as aeb

# 1. authenticate_token leaks UnicodeDecodeError on non-UTF-8 JWT header:
ea.authenticate_token("_w.e30.e30", {"keys": []})
# UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff...

# 2. parse_uefi_log / appraise_execution leak TypeError / AttributeError:
aeb.parse_uefi_log("not-bytes")
# TypeError: a bytes-like object is required, not 'str'

Spec section or file

  • prototype/execution_appraisal.py (authenticate_token, appraise_launch)
  • prototype/azure_execution_binding.py (parse_quote, parse_uefi_log, parse_ima_log, appraise_execution, authenticate_ak)

Expected behavior

  1. execution_appraisal.authenticate_token and appraise_launch should wrap malformed JWT/JWKS/signature inputs in ExecutionDenied, reject private JWK parameters (d, p, q, dp, dq, qi, oth, k) and leading-zero Base64urlUInt encodings (n, e), and enforce canonical 64-byte holder_signature_b64.
  2. azure_execution_binding.parse_quote, parse_uefi_log, parse_ima_log, appraise_execution, and authenticate_ak should validate bytes/dict input types at entry, guard header lengths in parse_uefi_log, and enforce canonical base64url + no private JWK members on HCLAkPub, raising ExecutionDenied on any malformed input.

Impact

Ensures both confidential-compute execution appraisal modules fail closed with ExecutionDenied on all malformed or untrusted inputs, rejects private JWK material and non-minimal RSA Base64urlUInt parameters, and enforces canonical signature encodings.

Lingua principale
Python
Stelle
37
Fork
33
Merge medio
1g 9h
PR unite (30g)
119

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di agentrust-io/trace-spec

Tutte le issue di agentrust-io/trace-spec

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.