Description
pypdftk through 0.5 contains an OS command injection vulnerability in fill_form(), dump_data_fields(), and pdftk_cmd_util() that builds shell commands from caller-supplied paths. Attackers controlling pdf_path or out_file can inject shell metacharacters interpreted by subprocess.Popen with shell=True to execute OS commands as the Python process.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| revolunet | pypdftk | ≤ 0.5 | — |
References
- https://github.com/revolunet/pypdftk/issues/56 issue-tracking
- https://github.com/revolunet/pypdftk/pull/57 issue-tracking patch
- https://github.com/revolunet/pypdftk/blob/1d3b40c3b42fb3cc6b0192d34aba2c21a1efd369/pypdftk.py#L87-L123 technical-description
- https://github.com/revolunet/pypdftk product
- VulnCheck Advisory: pypdftk through 0.5 OS Command Injection via PDF and Output Paths third-party-advisory