Skip to content

Improving imagemagick security - #255

Merged
bluvulture merged 1 commit into
5.xfrom
security/imagemagick-svg-policy
Jul 23, 2026
Merged

Improving imagemagick security#255
bluvulture merged 1 commit into
5.xfrom
security/imagemagick-svg-policy

Conversation

@bluvulture

Copy link
Copy Markdown
Contributor

This pull request strengthens the security of ImageMagick in the container by introducing a hardened policy configuration. The new policy restricts potentially dangerous coders and paths that SVG assets could exploit, mitigating risks such as remote code execution, local file reads, and server-side request forgery when processing untrusted SVG uploads.

Security hardening for ImageMagick:

  • Added a custom policy.xml to /etc/ImageMagick-7/ to deny file-read, text, scripting, and network coders that SVG xlink:href can invoke, reducing the attack surface for untrusted SVG assets.
  • Updated the Dockerfile to copy the hardened policy.xml into the ImageMagick configuration directory during the build process.

Copilot AI review requested due to automatic review settings July 16, 2026 06:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an ImageMagick policy to restrict dangerous SVG processing paths.

Changes:

  • Adds coder and path restrictions.
  • Installs the policy in the container image.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
files/conf/imagemagick/policy.xml Defines the hardened policy.
Dockerfile Copies the policy into the image.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Dockerfile
Comment thread Dockerfile
@bluvulture
bluvulture merged commit 0e39b80 into 5.x Jul 23, 2026
4 checks passed
@bluvulture
bluvulture deleted the security/imagemagick-svg-policy branch July 23, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants