CVE-2023-38491

CVE-2023-38491 is a medium-severity cross-site scripting (XSS) vulnerability in getkirby/cms (composer), affecting versions < 3.5.8.3. It is fixed in 3.5.8.3, 3.6.6.3, 3.7.5.2, 3.8.4.1, 3.9.6.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Cross-site scripting (XSS) from MIME type auto-detection of uploaded files

TL;DR

This vulnerability affects all Kirby sites that might have potential attackers in the group of authenticated Panel users or that allow external visitors to upload an arbitrary file to the content folder.

Your Kirby sites are not affected if they don't allow file uploads for untrusted users or visitors or if the file extensions of uploaded files are limited to a fixed safe list.

The attack requires user interaction by another user or visitor and cannot be automated.

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 Shankar Acharya (@5hank4r) for responsibly reporting the identified issue.

Impact

An editor with write access to the Kirby Panel could upload a file with an unknown file extension like .xyz that contains HTML code including harmful content like <script> tags. The direct link to that file could be sent to other users or visitors of the site. If the victim opened that link in a browser where they are logged in to Kirby and the file had not been opened by anyone since the upload, Kirby would serve the file with an incorrect MIME type of text/html. The browser would then run the script, which could for example trigger requests to Kirby's API with the permissions of the victim.

The issue was caused by the underlying Kirby\Http\Response::file() method, which didn't have an explicit fallback if the MIME type could not be determined from the file extension. If you use this method in site or plugin code, these uses may be affected by the same vulnerability.

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-2023-38491 has a CVSS score of 5.7 (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 (3.5.8.3, 3.6.6.3, 3.7.5.2, 3.8.4.1, 3.9.6); upgrading removes the vulnerable code path.

Affected versions

getkirby/cms (< 3.5.8.3) getkirby/cms (>= 3.6.0, < 3.6.6.3) getkirby/cms (>= 3.7.0, < 3.7.5.2) getkirby/cms (>= 3.8.0, < 3.8.4.1) getkirby/cms (>= 3.9.0, < 3.9.6)

Security releases

getkirby/cms → 3.5.8.3 (composer) getkirby/cms → 3.6.6.3 (composer) getkirby/cms → 3.7.5.2 (composer) getkirby/cms → 3.8.4.1 (composer) getkirby/cms → 3.9.6 (composer)

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 3.5.8.3, Kirby 3.6.6.3, Kirby 3.7.5.2, Kirby 3.8.4.1 and Kirby 3.9.6. Please update to one of these or a later version to fix the vulnerability.

In all of the mentioned releases, we have fixed the affected method to use a fallback MIME type of text/plain and set the X-Content-Type-Options: nosniff header if the MIME type of the file is unknown.

Frequently Asked Questions

  1. What is CVE-2023-38491? CVE-2023-38491 is a medium-severity cross-site scripting (XSS) vulnerability in getkirby/cms (composer), affecting versions < 3.5.8.3. It is fixed in 3.5.8.3, 3.6.6.3, 3.7.5.2, 3.8.4.1, 3.9.6. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
  2. How severe is CVE-2023-38491? CVE-2023-38491 has a CVSS score of 5.7 (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.
  3. Which versions of getkirby/cms are affected by CVE-2023-38491? getkirby/cms (composer) versions < 3.5.8.3 is affected.
  4. Is there a fix for CVE-2023-38491? Yes. CVE-2023-38491 is fixed in 3.5.8.3, 3.6.6.3, 3.7.5.2, 3.8.4.1, 3.9.6. Upgrade to this version or later.
  5. Is CVE-2023-38491 exploitable, and should I be worried? Whether CVE-2023-38491 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
  6. What actually determines whether CVE-2023-38491 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.
  7. How do I fix CVE-2023-38491?
    • Upgrade getkirby/cms to 3.5.8.3 or later
    • Upgrade getkirby/cms to 3.6.6.3 or later
    • Upgrade getkirby/cms to 3.7.5.2 or later
    • Upgrade getkirby/cms to 3.8.4.1 or later
    • Upgrade getkirby/cms to 3.9.6 or later

Other vulnerabilities in getkirby/cms

Stop the waste.
Protect your environment with Kodem.