Adobe Acrobat Reader DC text field "comb" property remote code execution vulnerability
A JavaScript-accessible text field property in Adobe Acrobat Reader DC can cause an out-of-bounds memory write when a large character limit is set, because the return value of a memory reallocation is not checked. An attacker could exploit this to corrupt memory and potentially execute arbitrary code when a victim opens a malicious PDF or visits a malicious web page.
Originally disclosed on Cisco Talos
A specific JavaScript code embedded in a PDF file can lead to a heap corruption when opening a PDF document in Adobe Acrobat Reader DC, version 2019.8.20071. With careful memory manipulation, this can lead to arbitrary code execution.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the code does not check whether a realloc call returned NULL before using the returned pointer, and the subsequent loop writes to an offset controlled by the growing index, turning a NULL dereference into an arbitrary write.
Impact
With further memory control, this could possibly result in further memory corruption and arbitrary code execution.
What the attacker needed
Victim opens a malicious PDF; or victim visits a malicious web page; JavaScript enabled in Acrobat Reader
How it was found
- Create a PDF with a text field named 'txt1'.
- Set the field's charLimit property to a large value.
- Set the field's comb property to true (or an object).
- Open the PDF in Adobe Acrobat Reader DC; the large charLimit causes the buffer to grow until realloc fails, leading to an out-of-bounds write.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Adobe Acrobat Reader can run JavaScript inside PDF files. A bug in how it handles a text field's 'comb' property lets a script write data past the end of a memory buffer. If an attacker can control that write, they might run their own code on the victim's computer, but the victim must first open a malicious PDF or visit a malicious page.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.