CVE-2023-27489: Kiwitcms Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-2wcr-87wf-cf9j
CVSS 7.6
CWE-79
Published
Advisory Summary

CVE-2023-27489 is a HIGH (CVSS 7.6) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Kiwitcms libraries in the PyPI ecosystem. The issue involves kiwi tcms stored cross-site scripting via svg file. Remediation is available by upgrading affected packages to version 12.1.

CVE-2023-27489 at a Glance

CVE Identifier CVE-2023-27489
GHSA Identifier GHSA-2wcr-87wf-cf9j
Severity HIGH
CVSS v3.1 Base Score 7.6
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Kiwitcms
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2023-27489

To remediate this vulnerability, upgrade all affected Kiwitcms dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

kiwitcms fixed: 12.1
pip install kiwitcms>=12.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show kiwitcms

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2023-27489, inspect your installed packages using pip:

pip show kiwitcms

Analyze the terminal output to locate any version of Kiwitcms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 12.1), your application is affected.

Note: The pip show kiwitcms command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Kiwitcms, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Kiwi TCMS accepts SVG files uploaded by users which could potentially contain JavaScript code. If SVG images are viewed directly, i.e. not rendered in an HTML page, this JavaScript code could execute. ### Patches This vulnerability has been fixed by configuring Kiwi TCMS to serve with the Content-Security-Policy HTTP header which blocks inline JavaScript in all modern browsers. ### Workarounds Configure Content-Security-Policy header, see [commit 6617cee0](https://github.com/kiwitcms/Kiwi/commit/6617cee0fb70cc394b7be6bbc86ef84e6e9de077). ### References You can visit https://digi.ninja/blog/svg_xss.php for more technical details. Independently disclosed by [Antonio Spataro](https://huntr.dev/bounties/bf99001b-a0a2-4f7d-98cd-983bc7f14a69/) and [@1d8](https://huntr.dev/bounties/f8c73bcc-02f3-4c65-a92b-1caa4d67c2fd/).

CVE-2023-27489 Affected Kiwitcms Versions

1 component(s)
Fixed Versions:
12.1
Product / Package Ecosystem Affected Versions Fixed Version
kiwitcms
PyPI
< 12.1
12.1

References

Frequently Asked Questions

What is CVE-2023-27489?
CVE-2023-27489 is a security vulnerability in Kiwitcms involving Kiwi TCMS Stored Cross-site Scripting via SVG file under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Kiwitcms versions are affected?
Affected versions include releases prior to 12.1 across affected packages: kiwitcms.
What version fixes CVE-2023-27489?
Upgrading to 12.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is kiwitcms affected?
Yes, kiwitcms is affected in releases prior to 12.1. Upgrade your dependency to 12.1 or later.
What is the CVSS score of CVE-2023-27489?
CVE-2023-27489 has a CVSS v3.1 base score of 7.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2023-27489?
CVE-2023-27489 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check PyPI dependencies for CVE-2023-27489?
Run the dependency tree command: 'pip show kiwitcms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2wcr-87wf-cf9j",
  "modified" : "2023-03-30T20:18:29Z",
  "published" : "2023-03-30T20:18:29Z",
  "aliases" : [ "CVE-2023-27489" ],
  "summary" : "Kiwi TCMS Stored Cross-site Scripting via SVG file",
  "details" : "### Impact\nKiwi TCMS accepts SVG files uploaded by users which could potentially contain JavaScript code. If SVG images are viewed directly, i.e. not rendered in an HTML page, this JavaScript code could execute. \n\n### Patches\nThis vulnerability has been fixed by configuring Kiwi TCMS to serve with the Content-Security-Policy HTTP header which blocks inline JavaScript in all modern browsers.\n\n### Workarounds\nConfigure Content-Security-Policy header, see [commit 6617cee0](https://github.com/kiwitcms/Kiwi/commit/6617cee0fb70cc394b7be6bbc86ef84e6e9de077).\n\n### References\nYou can visit https://digi.ninja/blog/svg_xss.php for more technical details.\n\nIndependently disclosed by [Antonio Spataro](https://huntr.dev/bounties/bf99001b-a0a2-4f7d-98cd-983bc7f14a69/) and [@1d8](https://huntr.dev/bounties/f8c73bcc-02f3-4c65-a92b-1caa4d67c2fd/).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "kiwitcms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "12.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kiwitcms/Kiwi/security/advisories/GHSA-2wcr-87wf-cf9j"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-27489"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kiwitcms/Kiwi/commit/6617cee0fb70cc394b7be6bbc86ef84e6e9de077"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kiwitcms/Kiwi"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-30T20:18:29Z",
    "nvd_published_at" : "2023-03-29T19:15:00Z"
  }
}