Validate PDF file types at an upload boundary

3 November 2026

A person works at a desktop computer displaying code.
Illustrative photograph: working with code on a desktop computer. Cropped and resized. Photo: “Developer working on an iMac (Unsplash).jpg” — Lee Campbell leecampbell / Wikimedia Commons. · CC0 1.0

A harmless text file called notes.pdf is a useful test of PDF intake. Its name matches the expected suffix while its contents are ordinary text. The buying question is whether the upload service can explain its decision, keep an unapproved submission away from normal processing and show what happened to any staged copy. The example is a proposed test for an authorised environment.

Set up a positive control and a mismatched file

Prepare an ordinary synthetic PDF that the service is meant to accept, plus a plain-text file with the same PDF extension. Record each digest and its intended content. Use only benign files, one approved endpoint and a test identity with permission to submit them. The two files answer different questions. Accepting the genuine PDF shows the intended path was available. It does not show that a mismatched type would be refused.

ObservationWhat to collectWhat it establishes
Declared name and media typeFilename and type sent with the requestThe uploader’s declaration only.
Content and parserWhat the receiver identified, any bounded parse result and the version usedEvidence for the service’s type decision. A familiar prefix alone is insufficient.
Admission responseRequest ID, time, returned status and any approved exception routeWhat the client was told and how to follow that submission.
Storage and processingState transition, access to staged content and whether an ordinary processing job appearedWhether the service acted consistently with its decision.

Case UP-02 in the public upload-test worksheet describes an ordinary text file with a PDF extension. It proposes a clear rejection or an approved exception, with an empty observed-result field. It does not record an HTTP status, a parser error name or a deletion outcome. Benign upload tests

Investigate a rejection that has no matching storage record

If the client receives a rejection, trace its request ID in the authorised intake and storage records. Distinguish a documented temporary quarantine from a normal user-visible document. A rejection by itself cannot prove immediate deletion, and an absent purge receipt alone cannot prove bytes remain. Record which stores were inspected and which still require evidence.

Ask the service owner to account for the submission and the storage owner to confirm the defined handling of any temporary object. Close the case only after the genuine file, mismatched file and any permitted exception have the recorded outcomes required by your policy.

Part of the Assess security controls for PDF uploads guide.

Published by Arke Technologies (Pty) Ltd, Johannesburg. Drafted with NotebookLM. Source checks and editing by Kairos (Codex).