CVE-2021-4164: Calibreweb Calibre-web Is Vulnerable To Cross-Site Vulnerability

HIGH
Advisory Identifier: GHSA-wxr6-29pv-ch68
CVSS 7.6
CWE-352
Published
Advisory Summary

CVE-2021-4164 is a HIGH (CVSS 7.6) calibre-web is vulnerable to cross-site vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Calibreweb libraries in the PyPI ecosystem. The issue involves calibre-web is vulnerable to cross-site request forgery (csrf). Remediation is available by upgrading affected packages to version 0.6.15.

CVE-2021-4164 at a Glance

CVE Identifier CVE-2021-4164
GHSA Identifier GHSA-wxr6-29pv-ch68
Severity HIGH
CVSS v3.1 Base Score 7.6
CWE Classification CWE-352: Cross-Site Request Forgery (CSRF)
Affected Product Calibreweb
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability High (A:H)

How to Fix CVE-2021-4164

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.

calibreweb fixed: 0.6.15
pip install calibreweb>=0.6.15
Verify Direct and Transitive Dependencies

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-4164, 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-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. 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

calibre-web is vulnerable to Cross-Site Request Forgery (CSRF)

CVE-2021-4164 Affected Calibreweb Versions

1 component(s)
Fixed Versions:
0.6.15
Product / Package Ecosystem Affected Versions Fixed Version
calibreweb
PyPI
< 0.6.15
0.6.15

References

Frequently Asked Questions

What is CVE-2021-4164?
CVE-2021-4164 is a security vulnerability in Calibreweb involving calibre-web is vulnerable to Cross-Site Request Forgery (CSRF) under CWE-352: Cross-Site Request Forgery (CSRF).
Which Calibreweb versions are affected?
Affected versions include releases prior to 0.6.15 across affected packages: calibreweb.
What version fixes CVE-2021-4164?
Upgrading to 0.6.15 (or the latest patched release for your respective branch) resolves the vulnerability.
Is calibreweb affected?
Yes, calibreweb is affected in releases prior to 0.6.15. Upgrade your dependency to 0.6.15 or later.
What is the CVSS score of CVE-2021-4164?
CVE-2021-4164 has a CVSS v3.1 base score of 7.6 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H.
What CWE is associated with CVE-2021-4164?
CVE-2021-4164 is classified under CWE-352: Cross-Site Request Forgery (CSRF) (The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.).
How can I check PyPI dependencies for CVE-2021-4164?
Run the dependency tree command: 'pip show calibreweb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wxr6-29pv-ch68",
  "modified" : "2022-01-19T14:24:33Z",
  "published" : "2022-01-21T23:44:17Z",
  "aliases" : [ "CVE-2021-4164" ],
  "summary" : "calibre-web is vulnerable to Cross-Site Request Forgery (CSRF)",
  "details" : "calibre-web is vulnerable to Cross-Site Request Forgery (CSRF)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H"
  } ],
  "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-4164"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/janeczku/calibre-web/commit/785726deee13b4d56f6c3503dd57c1e3eb7d6f30"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/janeczku/calibre-web"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/2debace1-a0f3-45c1-95fa-9d0512680758"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-352" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-19T14:24:33Z",
    "nvd_published_at" : "2022-01-17T13:15:00Z"
  }
}