-
-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUGFIX: Sanitize uploaded svg files for suspicious contents
Adding an internal method `sanitizeImportedFileContent` to the resourceManager which is called for every imported resource. If suspicious content was removed from a warning is logged that which mentions the remove date and line. The sanitizing is done using "enshrined/svg-sanitize" that is used by other cms aswell. The initial implementation will only sanitize SVG files as those can contain malicious scripts. In future this should be expanded to a feature that allows registering of custom sanitizing functions. To create the centralized filter the implementation of `ResourceManager->importResource` was changed to read the file content and delegate the rest of the work to `ResourceManager->importResourceFromContent` which is the responsible for calling `ResourceManager->sanitizeImportedFileContent`.
- Loading branch information
Showing
3 changed files
with
48 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters