CVE-2021-29460 Cross-site scripting (XSS) from unsanitized uploaded SVG files

High 7.6 Published Updated

Attackers can upload malicious SVG files to execute scripts in admin sessions, enabling privilege escalation and account takeover in Kirby CMS.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-29460?

CVE-2021-29460 is a high-severity cross-site scripting vulnerability in getkirby kirby, published on 27 Apr 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

Kirby is an open source CMS. An editor with write access to the Kirby Panel can upload an SVG file that contains harmful content like `<script>` tags. The direct link to that file can be sent to other users or visitors of the site. If the victim opens that link in a browser where they are logged in to Kirby, the script will run and can for example trigger requests to Kirby's API with the permissions of the victim. This vulnerability is critical if you might have potential attackers in your group of authenticated Panel users, as 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. Visitors without Panel access can only use this attack vector if your site allows SVG file uploads in frontend forms and you don't already sanitize uploaded SVG files. The problem has been patched in Kirby 3.5.4. Please update to this or a later version to fix the vulnerability. Frontend upload forms need to be patched separately depending on how they store the uploaded file(s). If you use `File::create()`, you are protected by updating to 3.5.4+. As a work around you can disable the upload of SVG files in your file blueprints.

Weakness: CWE-79

Which versions are affected by CVE-2021-29460?

2 open source packages ship an affected version, including getkirby/cms. It affects 1 product.

PackageAffectedFixed in
getkirby/cms PackagistAll versions3.5.4
getkirby/cms PackagistAll versions3.5.4

Products include Getkirby Kirby.

How do I fix CVE-2021-29460?

Upgrade getkirby/cms to 3.5.4 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2021-29460 being exploited?

There is no known exploitation of CVE-2021-29460 in the wild and no public exploit code.

Public exploit code: 1 Exploit-DB entry.

Sources

Also known as GHSA-qgp4-5qx6-548g.

Is CVE-2021-29460 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free