pdf_sanitizer
Enhance your Drupal site's security by automatically sanitizing uploaded PDF files. The PDF Sanitizer module removes malicious content like JavaScript actions, ensuring only safe PDFs are stored. This module provides a crucial security solution for any Drupal site that allows users to upload PDF documents, protecting both your server and your site's visitors from potentially harmful embedded content.
Features
The PDF Sanitizer module provides a crucial security layer for Drupal sites that allow users to upload PDF files. Its basic functionality is to automatically intercept and process any PDF file uploaded through standard Drupal file upload mechanisms (e.g., file fields, media library).
What makes this module unique is its use of the powerful Ghostscript utility to perform deep sanitization. It specifically targets and removes potentially malicious content, such as embedded JavaScript actions, which could otherwise pose a security risk to users viewing these PDFs.
Someone would use this module whenever they need to ensure the integrity and safety of PDF files uploaded by users or external sources. Common use cases include:
* Websites where users submit documents (e.g., job applications, forms).
* Content management systems where editors upload PDF resources.
* Any scenario where you want to mitigate risks associated with untrusted PDF content.
By automatically replacing the original uploaded file with its sanitized version, the module ensures that only clean and safe PDFs are stored on your server and served to your site's visitors.
Post-Installation
Once installed and enabled, the PDF Sanitizer module works automatically in the background. There are no configuration pages, new content types, or text format settings to manage. Simply enable the module, and it will begin sanitizing PDF files as they are uploaded.
Additional Requirements
This module requires the following:
* Ghostscript: A system-level executable that must be installed on your server and accessible from the command line. Refer to the module's README.md file for installation instructions for various operating systems (Linux, macOS, Windows, DDEV).
* PHP 8.1 or higher
* Drupal 9 or 10
Recommended modules/libraries
Currently, there are no specific modules or libraries recommended to enhance the core functionality of the PDF Sanitizer module.