CVE-2022-0767: Calibreweb Server-Side Request Forgery Vulnerability

CRITICAL
Advisory Identifier: GHSA-h65g-jfqg-2w6m
CVSS 9.9
CWE-918
Published
Advisory Summary

CVE-2022-0767 is a CRITICAL (CVSS 9.9) server-side request forgery vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Calibreweb libraries in the PyPI ecosystem. The issue involves server-side request forgery in calibreweb. Remediation is available by upgrading affected packages to version 0.6.17.

CVE-2022-0767 at a Glance

CVE Identifier CVE-2022-0767
GHSA Identifier GHSA-h65g-jfqg-2w6m
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Calibreweb
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.9

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:N/S:C/C:L/I:L/A:H).

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

How to Fix CVE-2022-0767

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.17
pip install calibreweb>=0.6.17
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-2022-0767, 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.17), 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-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. 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

calibreweb prior to version 0.6.17 is vulnerable to server-side request forgery (SSRF). This is a result of incomplete SSRF protection that can be bypassed via an HTTP redirect. An HTTP server set up to respond with a 302 redirect may redirect a request to `localhost`.

CVE-2022-0767 Affected Calibreweb Versions

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

References

Frequently Asked Questions

What is CVE-2022-0767?
CVE-2022-0767 is a security vulnerability in Calibreweb involving Server-Side Request Forgery in calibreweb under CWE-918: Server-Side Request Forgery (SSRF).
Which Calibreweb versions are affected?
Affected versions include releases prior to 0.6.17 across affected packages: calibreweb.
What version fixes CVE-2022-0767?
Upgrading to 0.6.17 (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.17. Upgrade your dependency to 0.6.17 or later.
What is the CVSS score of CVE-2022-0767?
CVE-2022-0767 has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:H.
What CWE is associated with CVE-2022-0767?
CVE-2022-0767 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check PyPI dependencies for CVE-2022-0767?
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-h65g-jfqg-2w6m",
  "modified" : "2022-03-15T21:52:59Z",
  "published" : "2022-03-08T00:00:31Z",
  "aliases" : [ "CVE-2022-0767" ],
  "summary" : "Server-Side Request Forgery in calibreweb",
  "details" : "calibreweb prior to version 0.6.17 is vulnerable to server-side request forgery (SSRF). This is a result of incomplete SSRF protection that can be bypassed via an HTTP redirect. An HTTP server set up to respond with a 302 redirect may redirect a request to `localhost`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "calibreweb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.17"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-0767"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/janeczku/calibre-web/commit/965352c8d96c9eae7a6867ff76b0db137d04b0b8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/janeczku/calibre-web"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/b26fc127-9b6a-4be7-a455-58aefbb62d9e"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-08T18:11:08Z",
    "nvd_published_at" : "2022-03-07T07:15:00Z"
  }
}