PlayStation Portal (Remote Play): Stack-buffer overflow in HEVC decoder
MediumPublished Jun 14, 2024 · updated Jun 27, 2024
### Summary The HEVC decoder used in PlayStation Portal's Remote Play does not validate the length of elements copied to an array. This results in an out-of-bounds write on the stack and may lead to RCE. In addition to this buffer overflow, gaps in PlayStation Portal's patching were identified to be vulnerable to CVE-2023-33106 ### Severity Moderate - A user who is able to execute this buffer overflow can modify the PlayStation Portal to run arbitrary code. This affects the PlayStation Portal, and all other remote play clients iOS, Android, Windows, and MacOS. ### Details The HEVC decoder used in Remote Play does not check the result of `num_long_term_ref_pics_sps`, used for an array of `lt_ref_pic_poc_lsb_sps` and `used_by_curr_pic_lt_sps_flag` elements: ``` v80 = consume_bits((int)v2, 1); *(_BYTE *)(this + 224) = v80; if ( v80 ) { v81 = -1; do ++v81; while ( !consume_bits((int)v2, 1) ); v82 = consume_bits((int)v2, v81); v128 = 0; *(_DWORD *)(this + 0xE4) = (1 << v81) + --v82; if ( (1 << v81) + v82 ) { v131 = this + 0xE8; do { v83 = -1; do ++v83; while ( !consume_bits((int)v2, 1) )...
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| Portal Product | < 2.06 | 2.06 |
Details and references
### Summary The HEVC decoder used in PlayStation Portal's Remote Play does not validate the length of elements copied to an array. This results in an out-of-bounds write on the stack and may lead to RCE. In addition to this buffer overflow, gaps in PlayStation Portal's patching were identified to be vulnerable to CVE-2023-33106 ### Severity Moderate - A user who is able to execute this buffer overflow can modify the PlayStation Portal to run arbitrary code. This affects the PlayStation Portal, and all other remote play clients iOS, Android, Windows, and MacOS. ### Details The HEVC decoder used in Remote Play does not check the result of `num_long_term_ref_pics_sps`, used for an array of `lt_ref_pic_poc_lsb_sps` and `used_by_curr_pic_lt_sps_flag` elements: ``` v80 = consume_bits((int)v2, 1); *(_BYTE *)(this + 224) = v80; if ( v80 ) { v81 = -1; do ++v81; while ( !consume_bits((int)v2, 1) ); v82 = consume_bits((int)v2, v81); v128 = 0; *(_DWORD *)(this + 0xE4) = (1 << v81) + --v82; if ( (1 << v81) + v82 ) { v131 = this + 0xE8; do { v83 = -1; do ++v83; while ( !consume_bits((int)v2, 1) ); v84 = consume_bits((int)v2, v83); v85 = v83; v86 = v131; *(_DWORD *)v131 = (1 << v85) - 1 + v84; // overflow v87 = consume_bits((int)v2, 1); v88 = v128; v131 = v86 + 4; *(_BYTE *)(this + v128 + 0x168) = v87; // overflow v128 = v88 + 1; } while ( (unsigned int)(v88 + 1) < *(_DWORD *)(this + 0xE4) ); } } ``` This results in an out-of-bounds write in the array and may lead to RCE. This affects the PlayStation Portal, and all other remote play clients for iOS, Android, Windows and MacOS. ### Further Analysis #### KGSL vulnerability Additionally, the PlayStation Portal has patch gaps and is vulnerable to [https://googleprojectzero.github.io/0days-in-the-wild//0day-RCAs/2023/CVE-2023-33106.html](https://www.google.com/url?q=https://googleprojectzero.github.io/0days-in-the-wild//0day-RCAs/2023/CVE-2023-33106.html&sa=D&source=buganizer&usg=AOvVaw1tQaWkwSoT73tgZToisy8S) which may allow an attacker to escalate privileges." ### Timeline **Date reported**: 02/21/2024 **Date fixed**: 05/03/2024 **Date disclosed**: 06/14/2024
- Severity from
- GitHub (reviewed advisory)
More Google advisories
All Google| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Jul 242024 | TurboMeeting: Boolean-based SQL Injection | Critical9.8 | None |
| Jul 162024 | Linux Kernel: Vulnerability in the eBPF verifier register limit tracking | Medium | No fix yet |
| Jul 162024 | Kioxia: Open JTAG Debug Port | High7.3 | No fix yet |
| Jun 252024 | Nuvoton / Dell iDRAC: RootBlock | Critical | 10.10.19+2 more |
| Jun 72024 | GitHub - Workflow Privilege Escalation via Artifacts Upload | High | No fix yet |
| May 92024 | PostgreSQL: Anonymizer SQL Injection and Trusted Schema Bypasses | High | v1.3 |