GIVE YOUR AGENT THE EVIDENCE

Set up in your agent.

One prompt to get started. Paste it into your coding agent to connect cve.new through MCP and bring vulnerability context into your workflow.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

GIVE YOUR AGENT THE EVIDENCE

Investigate in your agent.

Turn this advisory into a focused investigation. Ask your agent to check your project’s versions, explain the evidence, and suggest a compatible fix.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

GHSA-8q4h-8crm-5cvccritical9.8

elFinder: Command injection in resize background color parameter when using ImageMagick CLI

Check your stack

The advisory, in context

Severity

High
bg can be injected into shell command construction, leading to possible RCE in affected configurations.

Summary

elFinder contains a command injection vulnerability in the resize command.

The bg (background color) parameter is accepted from user input and passed through image resize/rotate processing. In configurations that use the ImageMagick CLI backend, this value is incorporated into shell command strings without sufficient escaping. An attacker able to invoke the resize command with a crafted bg value may achieve arbitrary command execution as the web server process user.

This issue affects configurations where:

  • the resize command is enabled,
  • image processing uses the ImageMagick CLI backend, and
  • the vulnerable code paths are reachable.

Impact

An attacker may execute arbitrary OS commands with the privileges of the web server process.

Impact depends on server configuration, enabled commands, backend image library selection, and surrounding deployment controls.

Affected versions

Affected: all versions before 2.1.66 Patched: 2.1.67

Details

The vulnerable flow is:

  1. The resize command accepts the bg parameter from the request.
  2. The parameter is passed into volume resize handling.
  3. In ImageMagick CLI code paths, the value is interpolated into shell command strings.
  4. Because the value is not safely constrained and escaped, shell metacharacters may be injected.

The issue was addressed by:

  • validating bg against a strict allowlist of supported color formats, and
  • safely escaping the value before it is passed into CLI command construction.

Workarounds

Possible mitigations for users who cannot upgrade immediately:

  • disable the resize command if not required,
  • avoid using the ImageMagick CLI backend for image processing,
  • restrict access to trusted users only.

Upgrading to the patched release is strongly recommended.

Credits

Thanks to Lin, WeiChi and Drew Webber for the responsible disclosure.

Affected packages

Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.

Ecosystem versions

Earlier releases before 2.1.67

Fixed in 2.1.67

74 explicitly affected versions

2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.1.0, 2.1.1, 2.1.10, 2.1.11, 2.1.12, 2.1.13, 2.1.14, 2.1.15, 2.1.16, 2.1.17, 2.1.18, 2.1.19, 2.1.2, 2.1.20, 2.1.21, 2.1.22, 2.1.23, 2.1.24, 2.1.25, 2.1.26, 2.1.27, 2.1.28, 2.1.29, 2.1.3, 2.1.30, 2.1.31, 2.1.32, 2.1.33, 2.1.34, 2.1.35, 2.1.36, 2.1.37, 2.1.38, 2.1.39, 2.1.4, 2.1.40, 2.1.41, 2.1.42, 2.1.43, 2.1.44, 2.1.45, 2.1.46, 2.1.47, 2.1.48, 2.1.49, 2.1.5, 2.1.50, 2.1.51, 2.1.52, 2.1.53, 2.1.54, 2.1.55, 2.1.56, 2.1.57, 2.1.58, 2.1.59, 2.1.6, 2.1.60, 2.1.61, 2.1.62, 2.1.63, 2.1.64, 2.1.65, 2.1.66, 2.1.7, 2.1.8, 2.1.9

View affected-version evidence
{
  "ranges": [
    {
      "events": [
        {
          "introduced": "0"
        },
        {
          "fixed": "2.1.67"
        }
      ],
      "type": "ECOSYSTEM"
    }
  ],
  "versions": [
    "2.0.3",
    "2.0.4",
    "2.0.5",
    "2.0.6",
    "2.0.7",
    "2.0.8",
    "2.0.9",
    "2.1.0",
    "2.1.1",
    "2.1.10",
    "2.1.11",
    "2.1.12",
    "2.1.13",
    "2.1.14",
    "2.1.15",
    "2.1.16",
    "2.1.17",
    "2.1.18",
    "2.1.19",
    "2.1.2",
    "2.1.20",
    "2.1.21",
    "2.1.22",
    "2.1.23",
    "2.1.24",
    "2.1.25",
    "2.1.26",
    "2.1.27",
    "2.1.28",
    "2.1.29",
    "2.1.3",
    "2.1.30",
    "2.1.31",
    "2.1.32",
    "2.1.33",
    "2.1.34",
    "2.1.35",
    "2.1.36",
    "2.1.37",
    "2.1.38",
    "2.1.39",
    "2.1.4",
    "2.1.40",
    "2.1.41",
    "2.1.42",
    "2.1.43",
    "2.1.44",
    "2.1.45",
    "2.1.46",
    "2.1.47",
    "2.1.48",
    "2.1.49",
    "2.1.5",
    "2.1.50",
    "2.1.51",
    "2.1.52",
    "2.1.53",
    "2.1.54",
    "2.1.55",
    "2.1.56",
    "2.1.57",
    "2.1.58",
    "2.1.59",
    "2.1.6",
    "2.1.60",
    "2.1.61",
    "2.1.62",
    "2.1.63",
    "2.1.64",
    "2.1.65",
    "2.1.66",
    "2.1.7",
    "2.1.8",
    "2.1.9"
  ]
}

References