MediumGHSA-63h4-w25c-3qv4CVE-2024-27087

Kirby vulnerable to Cross-site scripting (XSS) in the link field "Custom" type

Published 26 Feb 2024 · Updated 10 Sept 2026

Is your project on an affected getkirby/cms?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Laravel or PHP apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

getkirby/cmsComposer
Affected
>=4.0.0 <4.1.1
Fixed in
4.1.1
Update to the fixed version for your release line, for example:composer require getkirby/cms:^4.1.1

Details

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.

Is GHSA-63h4-w25c-3qv4 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected getkirby/cms, and gives you the command that fixes it.

More advisories for getkirby/cms

  • MediumCVE-2026-75592Kirby: Access to image files outside of the site root via path traversal in the media handling · 2 Sept 2026
  • MediumCVE-2026-69127Kirby: System path exposure from error messages in the REST API · 1 Sept 2026
  • HighCVE-2026-71415Kirby: File upload permissions are not checked during processing of chunk data · 31 Aug 2026
  • HighCVE-2026-75594Kirby: Access to image files and limited access to JSON files outside of the site root via path traversal in the media handling · 31 Aug 2026
  • HighCVE-2026-54005Kirby: `pages.access` permission is not checked in the `site/find` REST API route · 18 Jun 2026
  • MediumCVE-2026-54004Kirby: Access to files of top-level drafts is not protected by permissions · 18 Jun 2026
All 51 advisories for getkirby/cms

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.