At BSides Vilnius 2024, I co-presented collaborative research on “Condition-Based Manipulations of Digitally Signed Documents” alongside the release of our proof-of-concept tool, DigiDevil.
The Problem
Many organizations and individuals rely heavily on digital signatures to ensure the authenticity and integrity of electronic agreements, contracts, and invoices. However, standard PDF specifications support dynamic features—such as embedded JavaScript and Optional Content Groups (layers)—that can be abused.
We demonstrated that it is possible to craft PDF documents where the visible content changes dynamically based on specific conditions, while the cryptographic signature remains 100% valid:
- Change Over Time: Using embedded timers and script execution, document content changes dynamically from one state to another after opening.
- Change on Print: The document displays one set of terms on screen, but silently alters values or terms when sent to a physical or virtual printer.
- Change on File Renaming: The displayed content dynamically adapts depending on the filename of the document (e.g., displaying different contract values depending on how the file is saved).
Resources & Links
- GitHub Repository & Code: advisense/DigiDevil
(Contains Java/iText source code and sample demonstration PDFs). - Media Coverage: Verslo Idėjos / Verslo Žinios: „El. parašas dar negarantuoja sutarties tvirtumo: saugumo ekspertas atskleidė skaitmeninių dokumentų spragą“
