Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS02M2g0LXcyNWMtM3F2NM4AA5gk

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.

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.

Permalink: https://github.com/advisories/GHSA-63h4-w25c-3qv4
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS02M2g0LXcyNWMtM3F2NM4AA5gk
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 2 months ago
Updated: 2 months ago


CVSS Score: 4.6
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N

Identifiers: GHSA-63h4-w25c-3qv4, CVE-2024-27087
References: Repository: https://github.com/getkirby/kirby
Blast Radius: 11.9

Affected Packages

packagist:getkirby/cms
Dependent packages: 199
Dependent repositories: 378
Downloads: 310,487 total
Affected Version Ranges: >= 4.0.0, < 4.1.1
Fixed in: 4.1.1
All affected versions: 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.1.0
All unaffected versions: 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.3.5, 3.3.6, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 3.4.5, 3.5.0, 3.5.1, 3.5.2, 3.5.3, 3.5.4, 3.5.5, 3.5.6, 3.5.7, 3.5.8, 3.6.0, 3.6.1, 3.6.2, 3.6.3, 3.6.4, 3.6.5, 3.6.6, 3.7.0, 3.7.1, 3.7.2, 3.7.3, 3.7.4, 3.7.5, 3.8.0, 3.8.1, 3.8.2, 3.8.3, 3.8.4, 3.9.0, 3.9.1, 3.9.2, 3.9.3, 3.9.4, 3.9.5, 3.9.6, 3.9.7, 3.9.8, 3.10.0, 4.1.1, 4.1.2, 4.2.0