DEV Community

yutianle
yutianle

Posted on

Papermerge OCR workers and API tokens are two different exposure paths

Papermerge OCR workers and API tokens are two different exposure paths

Papermerge turns scans and PDFs into searchable documents. The web application accepts a login and API token, while a worker performs OCR and indexing in the background. A review that stops at the web page misses the processing path that handles the actual documents.

The documentation describes a REST API server and one or more workers. OCR can take seconds or minutes per page, so jobs run outside the request. Each user has an Inbox and Home folder, and the Inbox is intended for received documents such as email attachments.

REST API access uses token authentication. A token tied to a user inherits that user's document access. Bulk import scripts and mailbox connectors may hold such tokens, which makes token lifecycle part of document confidentiality.

Measurement scope

The candidate queries were app="Papermerge", title="Papermerge" and http.body="Papermerge".

On 2026-11-24, a standalone ZoomEye SDK batch used sub_type="all", page 1 and page size 1. All three selected queries failed before a response with ConnectionError and Windows error 10013. No count was returned. These failures are not zero matches and do not establish product exposure.

The query result cannot show whether a worker is reachable, which OCR languages are installed or whether the Inbox contains unprocessed documents. Those facts require direct inspection with authorization.

Separate the surfaces

Expose the API and web interface only through the intended authenticated boundary. The worker should not need a public listener. Restrict the database, message queue and document storage to the application network.

Review API tokens by owner, creation time, last use and scope. Remove tokens used by abandoned import scripts. When a user loses access to a group, verify that their tokens no longer retrieve documents in that group. Token revocation should be tested, not assumed.

Review the Inbox processing path. Confirm which email gateway or bulk-import job can place files there, what file types are allowed and how failures are handled. An OCR failure should not leave a document readable through an accidental public path.

Protect the OCR worker from resource exhaustion. Large PDFs and crafted images can consume CPU, memory and temporary disk. Set page and size limits, monitor job duration and isolate temporary files. A delayed job is a reliability issue until it prevents other documents from processing.

Back up the document store and the index consistently. A restored database with an older or newer search index can expose the wrong text or lose audit evidence.

Verify access and processing

Use a non-admin account and an API token. Confirm that both see the same permitted documents. Submit a test document through the documented import channel and follow it from Inbox to processed state. Check logs for the worker identity and temporary path.

After a token is revoked, retry the request. It should fail before document lookup. After a group change, search for content that should no longer be visible.

Papermerge exposure is the combination of token authority and a processing pipeline. The external title identifies a candidate, while token tests and worker inspection establish the actual document boundary.

References

Top comments (0)