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-qgp4-5qx6-548ghigh7.6

Cross-site scripting (XSS) from unsanitized uploaded SVG files in Kirby

Check your stack

The advisory, in context

Impact

An editor with write access to the Kirby Panel can upload an SVG or XML file that contains harmful content like <script> tags. The direct link to that file can be sent to other users or visitors of the site. If the victim opens that link in a browser where they are logged in to Kirby, the script will run and can for example trigger requests to Kirby's API with the permissions of the victim.

This vulnerability is critical if you might have potential attackers in your group of authenticated Panel users. They can escalate their privileges if they get access to the Panel session of an admin user. Depending on your site, other JavaScript-powered attacks are possible.

Visitors without Panel access can only use this attack vector if your site allows SVG or XML file uploads in frontend forms and you don't already validate or sanitize uploaded SVG or XML files.

The attack requires user interaction by another user or visitor and cannot be automated.

Patches

Uploads in the Panel

The problem has been patched in Kirby 3.5.4 by validating uploaded SVG and XML files and rejecting potentially harmful files. Please update to this or a later version to fix the vulnerability.

Frontend upload forms

Frontend upload forms need to be patched separately depending on how they store the uploaded file(s). If you use File::create(), you are protected by updating to Kirby 3.5.4+.

Validate existing files

Already uploaded files are not automatically validated again. If you are not sure if you have been impacted by this vulnerability in the past, we recommend to run all site files through the validator classes after updating to Kirby 3.5.4. You can use the following test script by pasting it into a template or uploading it to your web root:

<?php

@include_once __DIR__ . '/kirby/bootstrap.php';

if (version_compare(kirby()->version(), '3.5.4', '<') === true) {
  die('This script requires Kirby 3.5.4+.');
}

$objects = [
  // the site itself
  site(),

  // all pages and drafts
  ...site()->index(true)->values(),

  // all users
  ...kirby()->users()->values()
];

$errors = false;
foreach ($objects as $object) {
  foreach ($object->files() as $file) {
    try {
      // validate the contents lazily
      // (if a validator exists)
      $file->validateContents(true);
    } catch (\Kirby\Exception\InvalidArgumentException $e) {
      echo $file->id() . ': ' . $e->getMessage() . "<br>\n";
      $errors = true;
    }
  }
}

if ($errors === false) {
  echo 'No validation errors found.';
}

You only need to run this validator script once as future uploads will automatically be validated. If the script prints "No validation errors found", you have not been impacted by the vulnerability so far.

Errors that it lists may or may not be critical as our validator classes also catch files with an invalid data structure or less harmful attacks like the "billion laughs" denial-of-service attack or the usage of external sources. We recommend to review and fix each listed error manually until the script no longer finds any validation errors.

Please delete the script again after you have used it.

Workarounds

If you cannot update to Kirby 3.5.4, you can disable the upload of SVG and XML files in your file blueprints and validate or replace your already uploaded files once.

Credits

Thanks to @sreenathr10 for reporting the problem.

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.

getkirby/cms Packagist
Ecosystem versions

Earlier releases before 3.5.4

Fixed in 3.5.4

76 explicitly affected versions

3.0.0, 3.0.1, 3.0.1-rc.1, 3.0.2, 3.0.2-rc.1, 3.0.3, 3.0.3-rc.1, 3.0.3-rc.2, 3.0.3-rc.3, 3.1.0, 3.1.0-rc.1, 3.1.1, 3.1.2, 3.1.2-rc.1, 3.1.3, 3.1.3-rc.1, 3.1.4, 3.1.4-rc.1, 3.2.0, 3.2.0-rc.1, 3.2.0-rc.2, 3.2.0-rc.3, 3.2.0-rc.4, 3.2.1, 3.2.1-rc.1, 3.2.2, 3.2.3, 3.2.3-rc.1, 3.2.4, 3.2.4-rc.1, 3.2.5, 3.2.5-rc.1, 3.2.5-rc.2, 3.3.0, 3.3.0-rc.1, 3.3.0-rc.2, 3.3.0-rc.3, 3.3.0-rc.4, 3.3.0-rc.5, 3.3.1, 3.3.1-rc.1, 3.3.2, 3.3.2-rc.1, 3.3.3, 3.3.3-rc.1, 3.3.4, 3.3.4-rc.1, 3.3.5, 3.3.5-rc.1, 3.3.6, 3.4.0, 3.4.0-rc.1, 3.4.0-rc.2, 3.4.0-rc.3, 3.4.1, 3.4.1-rc.1, 3.4.2, 3.4.3, 3.4.3-rc.1, 3.4.4, 3.4.4-rc.1, 3.4.5, 3.5.0, 3.5.0-rc.1, 3.5.0-rc.2, 3.5.0-rc.3, 3.5.0-rc.4, 3.5.0-rc.5, 3.5.0-rc.6, 3.5.0-rc.7, 3.5.1, 3.5.1-rc.1, 3.5.2, 3.5.2-rc.1, 3.5.3, 3.5.3.1

View affected-version evidence
{
  "ranges": [
    {
      "events": [
        {
          "introduced": "0"
        },
        {
          "fixed": "3.5.4"
        }
      ],
      "type": "ECOSYSTEM"
    }
  ],
  "versions": [
    "3.0.0",
    "3.0.1",
    "3.0.1-rc.1",
    "3.0.2",
    "3.0.2-rc.1",
    "3.0.3",
    "3.0.3-rc.1",
    "3.0.3-rc.2",
    "3.0.3-rc.3",
    "3.1.0",
    "3.1.0-rc.1",
    "3.1.1",
    "3.1.2",
    "3.1.2-rc.1",
    "3.1.3",
    "3.1.3-rc.1",
    "3.1.4",
    "3.1.4-rc.1",
    "3.2.0",
    "3.2.0-rc.1",
    "3.2.0-rc.2",
    "3.2.0-rc.3",
    "3.2.0-rc.4",
    "3.2.1",
    "3.2.1-rc.1",
    "3.2.2",
    "3.2.3",
    "3.2.3-rc.1",
    "3.2.4",
    "3.2.4-rc.1",
    "3.2.5",
    "3.2.5-rc.1",
    "3.2.5-rc.2",
    "3.3.0",
    "3.3.0-rc.1",
    "3.3.0-rc.2",
    "3.3.0-rc.3",
    "3.3.0-rc.4",
    "3.3.0-rc.5",
    "3.3.1",
    "3.3.1-rc.1",
    "3.3.2",
    "3.3.2-rc.1",
    "3.3.3",
    "3.3.3-rc.1",
    "3.3.4",
    "3.3.4-rc.1",
    "3.3.5",
    "3.3.5-rc.1",
    "3.3.6",
    "3.4.0",
    "3.4.0-rc.1",
    "3.4.0-rc.2",
    "3.4.0-rc.3",
    "3.4.1",
    "3.4.1-rc.1",
    "3.4.2",
    "3.4.3",
    "3.4.3-rc.1",
    "3.4.4",
    "3.4.4-rc.1",
    "3.4.5",
    "3.5.0",
    "3.5.0-rc.1",
    "3.5.0-rc.2",
    "3.5.0-rc.3",
    "3.5.0-rc.4",
    "3.5.0-rc.5",
    "3.5.0-rc.6",
    "3.5.0-rc.7",
    "3.5.1",
    "3.5.1-rc.1",
    "3.5.2",
    "3.5.2-rc.1",
    "3.5.3",
    "3.5.3.1"
  ]
}

References