Summary
Kirby vulnerable to Cross-site scripting (XSS) in the link field "Custom" type
TL;DR
This vulnerability affects Kirby sites that use the new link field and output the entered link without additional validation or sanitization.
The attack commonly requires user interaction by another user or visitor.
The link dialog of the writer field is not affected as the writer field content is automatically sanitized by the Kirby backend code. You are also already protected if you limit the acceptable link types with the options field property.
Introduction
Cross-site scripting (XSS) is a type of vulnerability that allows to execute any kind of JavaScript code inside the Panel session of the same or other users. In the Panel, a harmful script can for example trigger requests to Kirby's API with the permissions of the victim.
Such vulnerabilities are 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.
Credits
Thanks to Natwara Archeepsamooth (@PlyNatwara) for responsibly informing us about the javascript: attack vector.
Impact
The new link field introduced in Kirby 4 allows several different link types that each validate the entered link to the relevant URL format. It also includes a "Custom" link type for advanced use cases that don't fit any of the pre-defined link formats.
As the "Custom" link type is meant to be flexible, it also allows the javascript: URL scheme. In some use cases this can be intended, but it can also be misused by attackers to execute arbitrary JavaScript code when a user or visitor clicks on a link that is generated from the contents of the link field.
Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.
CVE-2024-27087 has a CVSS score of 4.6 (Medium). The vector is network-reachable, low privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (4.1.1); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
The problem has been patched in Kirby 4.1.1. Please update to this or a later version to fix the vulnerability.
In the patch release, we have updated the link field to hide the "Custom" link type by default and added a warning to our documentation that this link type should only be enabled if additional validation is performed or no protection against XSS attacks is needed.
Frequently Asked Questions
- What is CVE-2024-27087? CVE-2024-27087 is a medium-severity cross-site scripting (XSS) vulnerability in getkirby/cms (composer), affecting versions >= 4.0.0, < 4.1.1. It is fixed in 4.1.1. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
- How severe is CVE-2024-27087? CVE-2024-27087 has a CVSS score of 4.6 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of getkirby/cms are affected by CVE-2024-27087? getkirby/cms (composer) versions >= 4.0.0, < 4.1.1 is affected.
- Is there a fix for CVE-2024-27087? Yes. CVE-2024-27087 is fixed in 4.1.1. Upgrade to this version or later.
- Is CVE-2024-27087 exploitable, and should I be worried? Whether CVE-2024-27087 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2024-27087 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2024-27087? Upgrade
getkirby/cmsto 4.1.1 or later.