Assess security controls for PDF uploads

3 July 2025

A padlock with keys hanging from a metal cable over wooden boards.
Illustrative photograph. Cropped and resized. Photo: “Small padlock with three keys in Holma Marina.jpg” — W.carter / Wikimedia Commons. Original notice: CC BY-SA 4.0 · CC BY-SA 4.0

A PDF upload needs controls across admission, processing, storage and retrieval. Checking the filename or receiving a clean scan result is only one part of the decision. Identify every component that interprets the file, restrict what those components can access, set resource limits and define a safe failure state. Verify the arrangement with harmless files in an authorised environment before accepting sensitive production documents.

Related articles

What should happen between a PDF upload and its first preview?

The decision to make

The service owner needs to decide whether the proposed processing path can accept untrusted documents within an acceptable risk boundary. “Untrusted” includes files supplied by legitimate customers: the organisation has not yet established their structure, provenance or behaviour.

Identify the entry points. A browser form, partner API, watched folder and email integration may feed the same processor through different controls. A rule enforced only in the browser interface does not establish what happens to files arriving through another route.

Scope and assumptions

This is a defensive threat model and acceptance design. No production upload service, ArkePDF parser or customer environment was tested for this article. The accompanying cases use benign files and controlled failures; they are not a substitute for a qualified security assessment of the implementation.

The assessment covers confidentiality, integrity and availability. A file can create an unacceptable outcome by being exposed to the wrong tenant or exhausting processing resources even when it contains no malware. Keep those outcomes in scope alongside malicious-content detection.

Map the processing path

Validation, scanning, storage and conversion

Draw the path from the uploader to the final recipient. Include the receiving endpoint, temporary storage, type checks, scanner, parser, renderer, OCR or conversion worker, output store and download route. Identify queues, retry mechanisms and diagnostic copies that may otherwise be overlooked.

For each stage, record which identity operates it and which data or network destinations it can access. A conversion worker that needs one input object and one output location should have a clearly justified reason for any wider permission.

OWASP's File Upload Cheat Sheet recommends layered checks, limits, controlled storage and maintained processing libraries. It also warns that a supplied content-type header or file signature should not be treated as sufficient validation on its own.

StageUnwanted outcomeEvidence to request
AdmissionUnauthorised or oversized upload acceptedIdentity checks and enforced limits on each route
QuarantineUnreviewed file becomes downloadableStorage permissions and state transitions
ProcessingParser affects unrelated data or service capacityWorker permissions, isolation and resource controls
OutputPartial or wrong-tenant result is releasedCompletion criteria and ownership checks
RetrievalAnother user obtains the fileAuthorised access tests and link behaviour
CleanupFailed jobs leave unmanaged copiesRetention rules and observed deletion or review process

Treat external scanners and conversion services as part of the data flow. Sending a confidential file to another service for inspection is itself a disclosure decision. Obtain the applicable processing and retention arrangements before including that service in the path.

Design benign failure tests for a supplier document portal

Set up the example

Consider a fictional supplier portal that receives a PDF submission and produces a preview for an internal reviewer. The proposed design stores new uploads in a quarantine area, creates a job record and releases the preview only after the required checks and conversion complete.

Use explicit job states: received, checking, processing, accepted, rejected and awaiting investigation. Assign a reason to every transition. A file awaiting investigation must not inherit the download route of an accepted file merely because both exist in the same storage system.

The expected normal outcome is a preview tied to the submitting account and the original input identifier. The expected failure outcome is a clear status, no unintended publication, an accountable operator and enough diagnostic evidence to investigate without copying the document into ordinary logs.

The upload threat-model worksheet turns this design into control questions. The benign acceptance cases cover routine admission, size boundaries, unreadable input, interrupted processing and access separation. Every observed-result field is empty because the portal is hypothetical.

Before implementation, decide whether encrypted PDFs, forms, attachments and active features are supported. An encrypted file that the inspection pipeline cannot read needs an explicit route; accepting it as “scanned” would misstate the evidence. A supported document feature may still need to be removed or transformed for the preview, and that transformation must be checked for business usefulness.

Interpreting the result

The model makes control ownership and failure states reviewable. It does not prove that a sandbox is correctly configured, a scanner detects every threat or a parser has no vulnerabilities.

Content reconstruction can change what recipients receive. If the business needs signatures, forms or exact rendering, assess the output against those requirements instead of assuming that a transformed preview can replace the original record. Security processing and document fidelity need a joint acceptance decision.

Verify safely with benign test files

Type, size and failure-handling checks

Use a bounded test environment with approved accounts, harmless files and agreed request limits. Start with a normal synthetic PDF that should succeed. Confirm its input identifier, processing status, final preview and authorised retrieval. This establishes the normal path before testing exceptions.

For type handling, submit an ordinary text file with a misleading PDF extension and an empty file. The purpose is to observe a clear rejection or approved exception route, not to construct an exploit. Record which component rejects the input and whether a user receives a useful explanation.

For size limits, use benign files just below and just above the configured boundary. Keep the sizes within the authorised test plan. Verify that rejection occurs at the intended stage and does not leave the job indefinitely queued or produce a publicly accessible partial object.

Exercise a controlled processor failure or timeout using the platform's supported test mechanism. Observe the job status, retry count, temporary storage and notification route. Set a finite retry policy and check that repeated attempts do not silently create multiple accepted outputs for the same submission.

Use a second test account to check retrieval separation. An accepted preview belonging to one fictional supplier should not become available to another simply because the second user knows its identifier. Perform this only with resources created for the authorised test.

Retain the observed result, relevant event references, configured limits and operator response. A scanner's “clean” label should remain one recorded observation within that wider result.

Before approving the upload path

Parser changes and security updates

The release record should identify the processor, renderer, OCR engine and scanner versions, including services operated by third parties. Assign responsibility for updates, vulnerability assessment and emergency changes. A successful acceptance run cannot establish the safety of every future dependency version.

Before enabling the path for its intended document class, confirm that:

  • Every entry route applies the required identity, type and size controls.
  • Quarantined, rejected and incomplete files cannot use the accepted-file delivery path.
  • Processing permissions and resource budgets are documented and tested within scope.
  • Output ownership remains connected to the correct uploader and tenant.
  • Failure, retries and cleanup have observable states and accountable owners.
  • A supplier or internal team owns security updates and incident investigation.

Use supplier discussions to request evidence, not only assurances. NIST's Secure Software Development Framework 1.1 provides a vocabulary for discussing development and vulnerability-management practices with software producers. It is not a product certificate or a substitute for reviewing the actual upload path.

Escalate unresolved isolation, sensitive-data transfer or parser behaviour to competent security specialists. Document which risks remain and who may accept them for the proposed operating scope.

Set release and maintenance gates

A versioned defensive checklist

Approve a specific combination of entry routes, document features, limits and processing components. Keep unsupported cases outside that scope with a clear user-facing explanation and a safe alternative route where one exists.

Retest after a processor update, new file feature, storage change, integration or revised retry policy. Use the retained benign corpus to detect regressions, then add targeted cases for the change. Do not confuse a large number of repeated checks with evidence that an unexamined dependency is safe.

Maintain a concise operational record: the current configuration, last relevant tests, open findings, update owner and incident contact. The objective is a service whose behaviour is bounded and observable when a file succeeds or fails. That is the basis for a defensible rollout decision; an unsupported promise that all uploaded PDFs are safe is not.

Validate PDF file types at an upload boundary

Check admission at the upload boundary using a harmless file with a misleading extension. Record both the response and the storage outcome.

Read “Validate PDF file types at an upload boundary”.

Set safe file-size limits for PDF processing

Test files just below, exactly at and just above the agreed byte limit, including whether the remaining queue continues normally.

Read “Set safe file-size limits for PDF processing”.

Prevent duplicate processing during upload retries

Match each upload attempt with the business job and its output before accepting a repeat submission after a timeout.

Read “Prevent duplicate processing during upload retries”.

Verify that temporary upload files are cleaned up

Compare cleanup after ordinary completion and after an interruption at the point where the upload first enters temporary storage.

Read “Verify that temporary upload files are cleaned up”.

Review storage permissions for uploaded documents

This section answers a narrower question than the rest of this page, and it does not mint a new URL. The original contribution preserved here is an upload threat model and safe defensive test checklist.

Name the failure you are worried about, then the defensive check. Do not include a method for causing the failure on a system you do not operate, and do not include a bypass.

ConcernWhat a safe test usesWhat you recordResult
The case in the headingA harmless file you are allowed to submitWhether the job state and the stored file match the rule you wrote firstNot run

Reject the test if it would need an exploit, a stolen credential, or a real person’s document.

The rest of this page remains the parent decision. Use the table for the question in the heading, and leave a cell blank rather than filling it from memory.

Sources

Published by Arke Technologies (Pty) Ltd, Johannesburg. Drafted with ChatGPT. Editorial and technical checks by Kairos (Codex). The linked articles were drafted with NotebookLM and independently checked and edited by Kairos (Codex).