---
id: CVE-2021-3988
aliases:
  - GHSA-r735-9gc6-2hvq
  - PYSEC-2026-1236
title: Cross-site Scripting (XSS) - DOM in janeczku/calibre-web
summary: Cross-site Scripting (XSS) - DOM in janeczku/calibre-web
severity: medium
cvss: 6.1
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'
vendor: calibreweb
product: calibreweb
ecosystem: pip
affected:
  - calibreweb < 0.6.15
patched:
  - calibreweb 0.6.15
published: '2024-11-15'
updated: '2026-07-07'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-r735-9gc6-2hvq'
references:
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2021-3988'
  - url: >-
      https://github.com/janeczku/calibre-web/commit/7ad419dc8c12180e842a82118f4866ac3d074bc5
  - url: 'https://github.com/janeczku/calibre-web'
  - url: 'https://huntr.com/bounties/fa4c8fd1-7846-4dad-9112-2c07461f0609'
tags:
  - osv
  - pip
epss: 0.00364
epssPercentile: 0.27472
ingestedAt: '2026-07-08T18:25:52.667Z'
---

## Overview

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.

## Affected packages

- `calibreweb < 0.6.15`

## Remediation

Upgrade to a patched release:

- `calibreweb 0.6.15`
