SPB Git

Repository Public

QYV-CRY-002.json 2.4 KB 21 lines json

1{2  "id": "QYV-CRY-002",3  "title": "Secret temporaries left in released memory by the engine (hash states, HMAC and RFC 6979 intermediates, seed copies)",4  "severity": "medium",5  "cvss_vector": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N",6  "cvss_score": 4.1,7  "cwe": "CWE-226",8  "masvs": "MASVS-STORAGE-2",9  "area": "crypto",10  "location": "Sources/QyvoraKeccak/Keccak.swift:241",11  "tool": "manual-review",12  "rule": "secret-not-erased",13  "status": "fixed",14  "fix_commit": "58a0ddd, c481d53",15  "regression_test": "Tests/QyvoraKeccakTests/SP800185Tests.swift: squeezeAndWipeErasesTheState; Tests/QyvoraSymmetricTests/SHA2BasicTests.swift: pendingBufferIsErased; Tests/QyvoraSecp256k1Tests/Secp256k1Tests.swift: rfc6979AfterHardening",16  "description": "Root cause: the project rule 'wipe temporary secrets with SecureMemory.zero' was applied to named buffers but not to (a) the Keccak sponge of the one-shot SHA-3/SHAKE functions - the state after squeezing can be run backwards through the permutation to the last absorbed block, which is the ML-KEM seed d, the ML-DSA seed xi, z or m; (b) the SHA-256/512 padding tail and pending buffer, which hold the end of the message (key bytes inside HMAC and RFC 6979), and whose growth by reallocation left partial copies; (c) the HMAC inner key block and inner digest; (d) every intermediate K and V of the RFC 6979 generator and the two HMAC messages that contain the secp256k1 private key, freed by plain reassignment; (e) the concatenations d || k and m || H(ek) of ML-KEM and xi || k || l of ML-DSA; (f) the stack block, message schedule and Keccak state of the SLH-DSA PRF on SK.seed; (g) Argon2 and BLAKE2b scratch erased by a plain loop that the optimiser may remove. Impact: an attacker able to read the memory of the process after an operation (memory-disclosure bug, crash dump, forensic image of an unlocked device) could recover long-term keys. No such read primitive is known in the application.",17  "recommendation": "Done for the items above. What the language does not allow to erase is tracked as QYV-CRY-003. The erasures themselves cannot be observed from outside for released buffers: the regression tests check the mechanism where the state is reachable (sponge state, hash buffer) and the unchanged outputs elsewhere (RFC 6979 vectors, ACVP suites of ML-KEM, ML-DSA, SLH-DSA, SHA-2, SHA-3, engine self-test).",18  "evidence": "see security/audit/review/memory-hygiene-crypto.json",19  "fingerprint": "5c03ce0f3bee"20}21
Files main
Menu

Theme