Page MenuHomePhabricator

Look into alternatives to parse PDF metadata not using NodeJS
Closed, DeclinedPublic

Description

Context

We're currently working on a way to support the Citoid service in retrieving metadata from PDF properties or content. Adding this functionality the citoid-service in NodeJS comes with some additional security considerations. On the one hand regarding the added node package dependencies and on the other regarding the need to put such a functionality into a separate sandboxed service.

Idea

We'll try to explore alternatives here that we would want to discuss with stackholders. The obvious one being the MediaWiki-extensions-PdfHandler that parses PDF properties using xpdf-utils and poppler-utils on the PHP backend side for uploaded PDF files.

The rough guess would be an API that

  • takes a pdf link
  • validates the content type and max size using the header
  • downloads the pdf to a temp directory ( probably applying another layer of size restriction )
  • uses the xpdf-utils and poppler-utils to extract metadata
Questions
  • Could we use the PdfHandler and add an API to it that ( temporarily ) downloads PDF's files from external sources and analyzes them?
  • Should we rather add such an API to the Citoid extension using the same tools in the background?

Event Timeline

WMDE-Fisch removed WMDE-Fisch as the assignee of this task.

It's not an option to add the functionality to MediaWiki-extensions-PdfHandler we'll wait for the security review on the original approach and see next steps from there T430305: RfC: Citoid service performance assessment for PDF parsing feature