Skip to content
XSS Disclosed report Intermediate CVE-2021-3988

Cross-site Scripting (XSS) - DOM in janeczku/calibre-web

The edit_books.js file in calibre-web inserts user-supplied input into the DOM without sanitisation when editing book properties such as uploading a cover or format. An attacker could execute arbitrary JavaScript in a victim's browser, potentially stealing cookies.

janeczku/calibre-web

Originally disclosed on huntr

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.

From the GitHub Advisory Database (GHSA-r735-9gc6-2hvq, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the change handler for the cover upload button writes user-controlled values into the DOM using unsafe insertion rather than text-safe methods or sanitisation.

Impact

An attacker could run arbitrary JavaScript in a victim's browser and potentially steal cookies, though the text does not describe a full exploit chain or any defence that blocked it.

What the attacker needed

Ability to edit book properties; victim views the edited book

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you upload a book cover or format, the web page takes what you typed or uploaded and puts it straight into the page without cleaning it first. A malicious person could put JavaScript code in that input, and the browser would run it as if the site itself had written it. That lets the attacker do things like read the victim's cookies, which are small pieces of data that keep you logged in.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from janeczku/calibre-web

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.