CVE-2021-3988 Cross-site Scripting (XSS) in janeczku/calibre-web

Medium 5.7 Published Updated

Attackers can execute arbitrary JavaScript via unsanitized input in book editing features, potentially stealing cookies.

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-3988?

CVE-2021-3988 is a medium-severity cross-site scripting vulnerability in janeczku/calibre-web, published on 15 Nov 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

A Cross-site Scripting (XSS) vulnerability exists in janeczku/calibre-web, specifically in the file `edit_books.js`. The vulnerability occurs when editing book properties, such as uploading a cover or a format. The affected code directly inserts user input into the DOM without proper sanitization, allowing attackers to execute arbitrary JavaScript code. This can lead to various attacks, including stealing cookies. The issue is present in the code handling the `#btn-upload-cover` change event.

Weakness: CWE-79

Which versions are affected by CVE-2021-3988?

3 open source packages ship an affected version, including calibreweb. It affects 1 product.

PackageAffectedFixed in
calibreweb PyPIAll versions0.6.15
calibreweb PyPIAll versions0.6.15
calibreweb PyPIAll versions0.6.15

Products include Janeczku Calibre-Web.

How do I fix CVE-2021-3988?

Upgrade calibreweb to 0.6.15 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-3988 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-3988 exists.

Sources

Also known as GHSA-r735-9gc6-2hvq, PYSEC-2026-1236.

Is CVE-2021-3988 in your software?

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

Check your SBOMs for free