Investigate suspicious PDF features
By Anton Samper · Reviewed
Look for scripts, automatic actions, launch actions, and embedded files, then follow their references to understand what the PDF contains.
List the actions
- Open the PDF and choose Actions in the explorer.
- Each row shows the trigger, the
/Saction type, a short target and the object that holds the action. Rows for/JavaScript,/Launch,/SubmitFormand/ImportData, and rendition actions that carry a script, have an orange rule and a label. Actions chained with/Nextare indented under the action before them. Control and text-direction characters in targets are shown as code points, such as⟨U+202E⟩, so a file name can't disguise itself. - For a script stored in a stream, choose Show decoded script. The text is decoded and nothing runs. Choose Inspect to open the stream, and check Original bytes when you need the exact syntax stored in the file.
- Document-level scripts sit in the catalogue’s
/Names /JavaScripttree and run when the file opens. Each entry gets its own row, named after its key. Inspect holder opens the tree node that lists it. A node written inline has no object of its own, so the button opens the object that contains it. - An action that is malformed or points to a missing object stays in the list with a note.
Search for what Actions leaves out
Actions reads the catalogue and its /Names /JavaScript tree, pages, annotations, form fields and outline. Scripts inside XFA forms and actions stored anywhere else are not listed. A note at the top of the list says when the document has an XFA form, and another names any source left unread because the list stopped. To find them, select Keys in search and look for JavaScript and JS, then OpenAction and AA. Select a result to inspect the dictionary that holds it.
Read what you found
/OpenAction identifies an action or destination used when opening a document; it is not always a script. /AA holds additional actions associated with events. In an action dictionary, /S /JavaScript identifies a JavaScript action and /JS holds its script or a reference to it. /S /Launch identifies a launch action.
These illustrative entries connect a catalogue’s opening action to a script stream. They are not part of the bundled samples:
1 0 obj
<< /Type /Catalog /Pages 2 0 R /OpenAction 8 0 R >>
endobj
8 0 obj
<< /S /JavaScript /JS 9 0 R >>
endobjActions shows this as one row: Document opens, /S /JavaScript, with the script in stream 9. To trace it by hand, start at object 1, follow /OpenAction 8 0 R, then /JS 9 0 R to inspect the script stream. Record the references and bookmark the relevant objects. Finding the word “JavaScript” alone gives less context than tracing this relationship.
Check embedded files and known strings
Use Resources → Attachments to inspect embedded files and their file specifications. For a known string, choose Decoded streams; for a known byte sequence, choose File hex.
Review reported issues
Open Issues for parser diagnostics and object warnings, with links to affected objects or file structure. Error and warning counts are separate from inspection limitations and information notes. Stream-read failures appear when you inspect or search those streams; preview and download errors stay beside the relevant action.
A clean result means the checks detected no issues; they do not validate every stream, page appearance, signature, or PDF conformance requirement. Locked and recovered documents identify incomplete coverage.
Interpret the results carefully
These features can have legitimate uses. A match identifies something to investigate; it does not establish that a file is malicious. PDF Internals does not run an antivirus signature scan, analyse what a payload would do when run, or declare a file safe.
An empty search does not establish safety. Compression, encryption, unsupported filters, obfuscation, and unavailable objects can hide content. Decoded search covers only the first 256 KiB per stream. Review the inspection limits before drawing conclusions.