diff --git a/Dockerfile b/Dockerfile index 49eb64f..1e7fd31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -106,6 +106,11 @@ RUN set -eux; \ apt-get clean; \ rm -rf /var/lib/apt/lists/* +# Harden ImageMagick against untrusted SVG assets: deny the file-read, text, +# scripting and network coders that SVG xlink:href can invoke. + +COPY files/conf/imagemagick/policy.xml /etc/ImageMagick-7/policy.xml + RUN --mount=type=bind,from=php_extension_installer,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \ install-php-extensions \ apcu \ diff --git a/files/conf/imagemagick/policy.xml b/files/conf/imagemagick/policy.xml new file mode 100644 index 0000000..2f8593f --- /dev/null +++ b/files/conf/imagemagick/policy.xml @@ -0,0 +1,55 @@ + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + +