CVE-2021-3988: Cross-site Scripting (XSS) - DOM in janeczku/calibre-web
6.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.15964%
CWE
Published
11/15/2024
Updated
11/19/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| calibreweb | pip | < 0.6.15 | 0.6.15 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The patch modifies the event handlers for #btn-upload-format and #btn-upload-cover change events to prevent XSS by using .text() instead of .html(). This indicates the code within these event handlers was vulnerable. Since these are anonymous functions, they don't have a specific name, but they are the primary points of vulnerability.
Vulnerable functions
cps/static/js/edit_books.js
The anonymous functions handling the change events for #btn-upload-format and #btn-upload-cover were directly inserting user input into the DOM using .html(), making them vulnerable to XSS. The fix involves using .text() to sanitize the input.