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

All vulnerabilities
GHSA-cq58-r77c-5jjwmedium5.4

Cross-site scripting (XSS) from image block content in the site frontend

Check your stack

The advisory, in context

Impact

Kirby's blocks field stores structured data for each block. This data is then used in block snippets to convert the blocks to HTML for use in your templates. We recommend to escape HTML special characters against cross-site scripting (XSS) attacks.

Cross-site scripting (XSS) is a type of vulnerability that allows to execute any kind of JavaScript code inside the site frontend or Panel session of other users. If the user is logged in to the Panel, a harmful script can for example trigger requests to Kirby's API with the permissions of the victim.

The default snippet for the image block unfortunately did not use our escaping helper. This made it possible to include malicious HTML code in the source, alt and link fields of the image block, which would then be displayed on the site frontend and executed in the browsers of site visitors and logged in users who are browsing the site.

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.

You are not affected if you don't use the blocks field or specifically the image block in any of your blueprints. You are also protected if you use a custom block snippet that either escapes the printed values or doesn't use them. The attack can only be performed by logged-in users and only surfaces in the site frontend (i.e. in your templates). The Panel itself is unaffected and will not execute JavaScript that was injected into the image block content.

Patches

We have patched the vulnerability in Kirby 3.5.8 by escaping special HTML characters in the output from the default image block snippet. Please update to this or a later version to fix the vulnerability.

Credits

Thanks to Azrul Ikhwan Zulkifli (@azrultech) from BAE Systems AI Vulnerability Research Team for responsibly reporting the identified issue.

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

From 3.5.0 before 3.5.8

Fixed in 3.5.8

15 explicitly affected versions

3.5.0, 3.5.1, 3.5.1-rc.1, 3.5.2, 3.5.2-rc.1, 3.5.3, 3.5.3.1, 3.5.4, 3.5.5, 3.5.5-rc.1, 3.5.6, 3.5.6-rc.1, 3.5.7, 3.5.7-rc.1, 3.5.7.1

View affected-version evidence
{
  "ranges": [
    {
      "events": [
        {
          "introduced": "3.5.0"
        },
        {
          "fixed": "3.5.8"
        }
      ],
      "type": "ECOSYSTEM"
    }
  ],
  "versions": [
    "3.5.0",
    "3.5.1",
    "3.5.1-rc.1",
    "3.5.2",
    "3.5.2-rc.1",
    "3.5.3",
    "3.5.3.1",
    "3.5.4",
    "3.5.5",
    "3.5.5-rc.1",
    "3.5.6",
    "3.5.6-rc.1",
    "3.5.7",
    "3.5.7-rc.1",
    "3.5.7.1"
  ]
}

References