Skip links

Researchers find 134 flaws in the way Word, PDFs, handle scripts

Black Hat Asia Security researchers have devised a tool that detects flaws in the way apps like Microsoft Word and Adobe Acrobat process JavaScript, and it’s proven so effective they’ve found 134 bugs – 59 of them considered worthy of a fix by vendors, 33 assigned a CVE number, and 17 producing bug bounty payments totaling $22,000.

The tool is named “Cooper” – a reference to the “Cooperative mutation” technique employed by the tool.

Speaking at the Black Hat Asia conference in Singapore, PhD student Xu Peng of the Chinese Academy of Sciences – one of the tool’s co-authors – explained that the likes of Word and Acrobat accept input from scripting languages. Acrobat, for example, allows JavaScript to manipulate PDF files.

Making that happen requires the PDF both to define native PDF objects and to parse JavaScript code. The native objects are processed by Acrobat modules, and an embedded JavaScript engine handles the scripts. A “binding layer” does the translation.

In his talk and a paper [PDF] describing Cooper, Xu and his collaborators assert the binding code “is prone to inconsistent semantics and security holes, which lead to severe vulnerabilities.”

That bit about severe vulns is not just bluster. Cooper identified CVE-2021-21028 and – a pair of 8.8/10 rated flaws in Acrobat.

Xu said Cooper can find such flaws because the cooperative mutation technique it uses “simultaneously modifies the script code and the related document objects to explore various code paths of the binding code.” That approach contrasts with other defensive techniques that check for flaws in scripts.

As explained on the tool’s GitHub page, Cooper has three components:

  • Object Clustering In the beginning, Cooper parses the given sample documents to extract native objects. To reduce the object search space, Cooper categorizes objects into different classes based on their attributes.
  • Relationship Inference Then, Cooper produces a large number of documents by combining different object classes and API groups, and records the execution results of the embedded scripts. Based on the success rate of the script execution and the distribution of object classes, Cooper infers the relationships between API groups and object classes.
  • Relationship-Guided Mutation Finally, Cooper leverages the inferred relationship to guide the object selection, script generation and object mutation.

Cooper is therefore in some ways an elaborate fuzzing tool – inferring the relationships guides the process of searching for conditions under which scripts, apps, and the binding layer produce unwanted and/or dangerous behaviour.

The tool is itself a set of scripts – in Python – and is yours for the asking here.

The project was created by Xu Peng and Professor Purui Su, both of the Chinese Academy of Sciences, security researcher Yanhao Wang from the QI-ANXIN Technology Research Institute, and Hong Hu, an assistant professor at Pennsylvania State University. ®