New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Asset Sanitizer Queue & Preview Check #14998
Comments
Would this be a solution to sanitize the pdf files? javascript - How to remove Active Content from uploaded PDF documents? - Stack Overflow |
Yes, that would work, but we should try to get a PHP solution, otherwise we'd need Ghostscript as a requirement. |
Considering #16955 which hints that scanning could be triggering false positive, and excluding that we want to actually sanitize the files, suggesting to consider ways to block JS on rendering (client-side). What about using https://github.com/mozilla/pdf.js ? Also tried Adobe PDF Embed API and works fine, the JS got blocked, it's unlimited and free (but needs a token and i am not sure about licensing). One potential advantage would be replacing the native pdf viewer that comes with the browser WHICH differs depending on the browser (making it homogeneous) with something that Devs could have more control on how it should appear and the tools it should provide (highlighter, search in page button etc..) than the basic chrome one which only allows to zoom, download and print. |
We were using |
Improvement description
Uploaded assets should be sanitized in a message queue, we should check existing things there, like max pixels but also additional things like Javascript in PDFs or SVGs and other things.
pimcore/models/Asset.php
Line 328 in 624dccb
The previews should be only available after the assets were sanitized, in the meantime we don't display any preview of an asset in the admin UI.
Maybe we can combine that with the existing
AssetUpdateTasksHandler
orAssetPreviewImageHandler
is probably even better to avoid race conditions? 🤔The text was updated successfully, but these errors were encountered: