fix(libSceLibreSsl3): reject oversized lengths in AES_wrap_key and AES_unwrap_key #23208
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23208"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by gurtgg on 2026-11-18T20:19:18Z.
What
inlen > INT_MAX - 8inAES_wrap_key_nid_postfix(core/libs/prx/libSceLibreSsl3/src/AesWrap.cpp) andlength > INT_MAXinAES_unwrap_key_nid_postfix(core/libs/prx/libSceLibreSsl3/src/Aes.cpp) with-1, matching LibreSSL 4.0.0aes.cand preventing multi-gigabyte guest reads/allocations and signedintreturn overflow.std::invalid_argumentcheck first inAES_wrap_key_nid_postfixso existing null-argument tests remain unchanged.Tested
CheckKeyWrapBounds(core/libs/prx/libSceLibreSsl3/tests/AesCcm.cpp): verifies a 16-byte RFC 3394 wrap/unwrap round-trip returns24and16, and negatively controls oversized aligned lengths (0x7ffffff8u,0x80000000u,0xfffffff8uforAES_wrap_key_nid_postfix;0x80000000u,0x80000008u,0xfffffff8uforAES_unwrap_key_nid_postfix) by asserting-1without modifying pre-filled sentinel output bytes.Checklist
tools/check_conventions.pypasses (UTF-8 no-BOM LF, zero disallowed comments, Conventional Commits)mainand passes after fixImported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T20:37:05Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
3c255b2ff3:tools/check_conventions.pypassed.guest_libressl3_aes_ccm_testsbuilt cleanly.guest_libressl3_aes_ccm):core/libs/prx/libSceLibreSsl3/src/Aes.cpp,core/libs/prx/libSceLibreSsl3/src/AesWrap.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me