PDF upload security
PDF is not just a document container. It is a programmable format that often moves into previewers, OCR systems, and internal tooling.
Recommended approach
Section titled “Recommended approach”- Give PDF uploads their own route or policy.
- Inspect before storage.
- Treat
suspiciousPDFs as review candidates when the business flow requires it. - Keep downstream PDF processing away from untrusted or unreviewed files.
Practical notes
Section titled “Practical notes”- A clean extension and
application/pdfheader are not enough. - Business portals often need quarantine, not only hard blocking.
- Combine PDF rules with storage isolation and review-friendly logging.