CVE-2024-27087: Kirby cross-site scripting (XSS) in the link field "Custom" type

Published Feb 26, 2024
·
Updated

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.

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.

Patches

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.

Credits

Thanks to Natwara Archeepsamooth (@PlyNatwara) for responsibly informing us about the javascript: attack vector.

Other sources

Kirby is a content management system. 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. This vulnerability is patched in 4.1.1.

NVD

Affected Software

2 affected componentsFixes available
composer/getkirby/cms>=4.0.0<4.1.1
4.1.1
getkirby Kirby>=4.0.0<4.1.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/getkirby/cms to a version that resolves this vulnerability.

    Fixed in 4.1.1
  2. Upgrade

    Upgrade kirby to a version that resolves this vulnerability.

    Fixed in 4.1.1
  3. Configuration

    If you cannot upgrade immediately, configure the Panel link field’s `options` property to limit acceptable link types (avoid enabling the “Custom” link type that allows the `javascript:` URL scheme).

    Kirby Panel link field options (limit acceptable link types) = Use the `options` field property to restrict link types to those that don’t allow `javascript:`
  4. Configuration

    Ensure the “Custom” link type in the Panel link field is not enabled; if you must enable it for advanced use cases, perform additional validation because it can otherwise allow `javascript:` and trigger XSS in the Panel session.

    Kirby Panel link field Custom link type = disabled by default

Event History

Feb 26, 2024
CVE Published
via MITRE·04:44 PM
Data Sourced
via MITRE·04:44 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 PM
RemedyAffected Software
Advisory Published
via GitHub·08:01 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-27087?

The severity of CVE-2024-27087 is classified as a medium vulnerability due to potential security risks associated with unvalidated links.

2

How do I fix CVE-2024-27087?

To fix CVE-2024-27087, you must upgrade to Kirby version 4.1.1 or higher to ensure proper validation and sanitization of the link field.

3

What software is affected by CVE-2024-27087?

CVE-2024-27087 affects Kirby CMS versions between 4.0.0 and 4.1.1.

4

Who is potentially affected by CVE-2024-27087?

Users of Kirby sites that utilize the new link field without implementing additional validation are potentially affected by CVE-2024-27087.

5

Is user interaction required for CVE-2024-27087 exploitation?

Yes, exploiting CVE-2024-27087 typically requires user interaction from another user or visitor.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203
CVE-2024-27087 - Kirby cross-site scripting (XSS) in the link field "Custom" type - SecAlerts