# Research | Blackstorm Security

Unpatched heap overflow in Windows Print Spooler form enumeration lets a local attacker corrupt Segment Heap chunks and escalate to SYSTEM via spoolsv.exe.

- Payout: Research
- Severity: high
- Program: Microsoft
- Write-up by: @
- Disclosed: 2026-11-16
- Write-up quality: 8/10
- Original: https://blackstormsecurity.com/research/
- Library page: https://bugbountylibrary.com/r/blog%3Ablackstormsecurity-com-research
- Tags: area:os domain:desktop impact:privesc kind:research platform:research sev:high tech:windows technique:source-review vuln:memory-corruption vuln:privilege-escalation

**Target:** spoolsv.exe form enumeration RPC path (InternalEnumForms/PackStrings)
**Root cause:** PackStrings memcpy packs attacker-controlled Unicode form name strings into the EnumForms output buffer without validating total size against the allocated chunk, overflowing past the paged-pool buffer.
**Steps:**
1. Call `AddFormW` over RPC to plant a form whose Unicode name is attacker-chosen bytes.
2. Call `EnumForms` with an oversized `cbBuf` so the packed strings slide past the end of the victim chunk.
3. Groom Segment Heap VS allocator: 0x2780-byte spray, free every fourth block to open holes.
4. Land the EnumForms output buffer in a hole; overwrite neighbour's 16-byte `_HEAP_VS_CHUNK_HEADER` then its function pointer.
5. Prove primitive against a PAGE_NOACCESS guard page before real grooming.
6. Four stages: groom, corrupt, control, execute; spoolsv.exe stays running, planted form deleted after.
**How found:** Code review of the form-enumeration path (InternalEnumForms to CopyIniFormToFormInfo to PackStrings to memcpy) revealed the missing bounds check; guard-page testing confirmed the OOB write before grooming.
**Exploitation:** Local attacker with administrative rights (per MSRC assessment) drives two dependent RPC calls: AddFormW plants the oversized form name, EnumForms triggers the memcpy overflow into a groomed VS subsegment hole, smashing the adjacent chunk header and function pointer to gain control of spoolsv.exe running as SYSTEM in Session 0.
**Escalation:** From heap corruption to SYSTEM via control of a function pointer in the SYSTEM-level spooler process; note the obvious shell lands invisibly in Session 0.
**Insight:** Two independent RPC calls joined only by a data dependency (AddFormW plants data, EnumForms triggers the copy) can bypass per-call validation; also check whether NDR stub size checks (RPC_X_BAD_STUB_DATA) block remote reachability before assuming network exploitability.

