Repository Public
1{2 "id": "QYV-CRY-001",3 "title": "KMAC.verify accepted an empty or one-byte tag chosen by the sender",4 "severity": "high",5 "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N",6 "cvss_score": 7.5,7 "cwe": "CWE-347",8 "masvs": "MASVS-CRYPTO-1",9 "area": "crypto",10 "location": "Sources/QyvoraKeccak/SP800185.swift:215",11 "tool": "manual-review",12 "rule": "mac-verify-attacker-chosen-length",13 "status": "fixed",14 "fix_commit": "58a0ddd",15 "regression_test": "Tests/QyvoraKeccakTests/SP800185Tests.swift: SP800185Tests.kmacVerifyRefusesShortTags",16 "description": "Root cause: KMAC.verify(_:key:message:tag:customization:) recomputed the MAC with outputLength = tag.count and compared the two strings. The tag, and therefore its length, comes from the party being authenticated. KMAC with L = 0 is the empty string for every key and message, so an empty tag verified against anything; a one-byte tag was guessed in at most 256 tries, a two-byte tag in 65 536. Impact: complete forgery of any KMAC-authenticated message for a consumer of this function that did not check the tag length itself. Exposure in QYVORA at the reviewed revision: none - no source file outside QyvoraKeccak calls KMAC (checked with grep over Sources/ and App/Sources); the algorithm is listed as 'available' in the engine catalogue. The CVSS base score describes the function as a public API of the engine, not a reachable path of the application.",17 "recommendation": "Done: tags shorter than KMAC.minimumTagSize (8 bytes, SP 800-185 section 8.4.2) are refused. A protocol that adopts KMAC must additionally fix its tag length and compare it before calling verify, as AES-GCM and ChaCha20-Poly1305 already do with their 16-byte tags.",18 "evidence": "KMAC.verify(256, key: k, message: m, tag: []) returned true before 58a0ddd",19 "fingerprint": "d77da3589c5c"20}21