CVE-2021-3988: Calibreweb Cross-Site Scripting Vulnerability
MODERATECVE-2021-3988 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Calibreweb libraries in the PyPI ecosystem. The issue involves cross-site scripting (xss) - dom in janeczku/calibre-web. Remediation is available by upgrading affected packages to version 0.6.15.
CVE-2021-3988 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2021-3988
To remediate this vulnerability, upgrade all affected Calibreweb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install calibreweb>=0.6.15
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show calibreweb
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2021-3988, inspect your installed packages using pip:
pip show calibreweb
Analyze the terminal output to locate any version of Calibreweb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.15), your application is affected.
Note: The pip show calibreweb 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 Calibreweb, 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
CVE-2021-3988 Affected Calibreweb Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
calibreweb
|
PyPI |
< 0.6.15
|
0.6.15
|
References
Frequently Asked Questions
What is CVE-2021-3988?
Which Calibreweb versions are affected?
What version fixes CVE-2021-3988?
Is calibreweb affected?
What is the CVSS score of CVE-2021-3988?
What CWE is associated with CVE-2021-3988?
How can I check PyPI dependencies for CVE-2021-3988?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r735-9gc6-2hvq",
"modified" : "2024-11-19T20:47:47Z",
"published" : "2024-11-15T12:31:44Z",
"aliases" : [ "CVE-2021-3988" ],
"summary" : "Cross-site Scripting (XSS) - DOM in janeczku/calibre-web",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "calibreweb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.6.15"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3988"
}, {
"type" : "WEB",
"url" : "https://github.com/janeczku/calibre-web/commit/7ad419dc8c12180e842a82118f4866ac3d074bc5"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/janeczku/calibre-web"
}, {
"type" : "WEB",
"url" : "https://huntr.com/bounties/fa4c8fd1-7846-4dad-9112-2c07461f0609"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-11-15T20:52:00Z",
"nvd_published_at" : "2024-11-15T11:15:06Z"
}
}