CVE-2023-36811: Borgbackup Archive Spoofing Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-8fjr-hghr-4m99
CVSS 4.7
CWE-347
Published
Advisory Summary

CVE-2023-36811 is a MODERATE (CVSS 4.7) archive spoofing vulnerability vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting Borgbackup libraries in the PyPI ecosystem. The issue involves archive spoofing vulnerability in borgbackup. Remediation is available by upgrading affected packages to version 1.2.5.

CVE-2023-36811 at a Glance

CVE Identifier CVE-2023-36811
GHSA Identifier GHSA-8fjr-hghr-4m99
Severity MODERATE
CVSS v3.1 Base Score 4.7
CWE Classification CWE-347: Improper Verification of Cryptographic Signature
Affected Product Borgbackup
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.7

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

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

How to Fix CVE-2023-36811

To remediate this vulnerability, upgrade all affected Borgbackup dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

borgbackup fixed: 1.2.5
pip install borgbackup>=1.2.5
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 borgbackup

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2023-36811, inspect your installed packages using pip:

pip show borgbackup

Analyze the terminal output to locate any version of Borgbackup in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.5), your application is affected.

Note: The pip show borgbackup command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-347: Improper Verification of Cryptographic Signature, where the product does not verify, or incorrectly verifies, the cryptographic signature for data. In Borgbackup, 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

### Impact A flaw in the cryptographic authentication scheme in borgbackup allowed an attacker to fake archives and potentially indirectly cause backup data loss in the repository. The attack requires an attacker to be able to 1. insert files (with no additional headers) into backups 2. gain write access to the repository This vulnerability does not disclose plaintext to the attacker, nor does it affect the authenticity of existing archives. Creating plausible fake archives may be feasible for empty or small archives, but is unlikely for large archives. Affected are all borgbackup releases prior to 1.2.5. Note: CVSS scoring model seemed to badly fit for this case, thus I manually set score to "moderate". ### Patches The issue has been fixed in borgbackup 1.2.5. But there was a bug in 1.2.5 upgrade instructions, thus 1.2.6 with an important fix in docs and code was released a day afterwards. Additionally to installing the fixed code, users must follow the upgrade procedure as documented in the latest version of the change log. ### Workarounds Data loss after being attacked can be avoided by reviewing the archives (timestamp and contents valid and as expected) after any "borg check --repair" and before "borg prune". ### References https://github.com/borgbackup/borg/blob/1.2.6/docs/changes.rst#pre-125-archives-spoofing-vulnerability-cve-2023-36811

CVE-2023-36811 Affected Borgbackup Versions

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

References

Frequently Asked Questions

What is CVE-2023-36811?
CVE-2023-36811 is a security vulnerability in Borgbackup involving Archive spoofing vulnerability in borgbackup under CWE-347: Improper Verification of Cryptographic Signature.
Which Borgbackup versions are affected?
Affected versions include releases prior to 1.2.5 across affected packages: borgbackup.
What version fixes CVE-2023-36811?
Upgrading to 1.2.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is borgbackup affected?
Yes, borgbackup is affected in releases prior to 1.2.5. Upgrade your dependency to 1.2.5 or later.
What is the CVSS score of CVE-2023-36811?
CVE-2023-36811 has a CVSS v3.1 base score of 4.7 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2023-36811?
CVE-2023-36811 is classified under CWE-347: Improper Verification of Cryptographic Signature (The product does not verify, or incorrectly verifies, the cryptographic signature for data.).
How can I check PyPI dependencies for CVE-2023-36811?
Run the dependency tree command: 'pip show borgbackup'. 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-8fjr-hghr-4m99",
  "modified" : "2024-09-13T14:35:53Z",
  "published" : "2023-08-30T20:09:33Z",
  "aliases" : [ "CVE-2023-36811" ],
  "summary" : "Archive spoofing vulnerability in borgbackup",
  "details" : "### Impact\nA flaw in the cryptographic authentication scheme in borgbackup allowed an attacker to fake archives and potentially indirectly cause backup data loss in the repository.\n\nThe attack requires an attacker to be able to\n\n1. insert files (with no additional headers) into backups\n2. gain write access to the repository\n\nThis vulnerability does not disclose plaintext to the attacker, nor does it affect the authenticity of existing archives.\n\nCreating plausible fake archives may be feasible for empty or small archives, but is unlikely for large archives.\n\nAffected are all borgbackup releases prior to 1.2.5.\n\nNote: CVSS scoring model seemed to badly fit for this case, thus I manually set score to \"moderate\".\n\n### Patches\nThe issue has been fixed in borgbackup 1.2.5.\nBut there was a bug in 1.2.5 upgrade instructions, thus 1.2.6 with an important fix in docs and code was released a day afterwards.\n\nAdditionally to installing the fixed code, users must follow the upgrade procedure as documented in the latest version of the change log.\n\n### Workarounds\nData loss after being attacked can be avoided by reviewing the archives (timestamp and contents valid and as expected) after any \"borg check --repair\" and before \"borg prune\".\n\n### References\n\nhttps://github.com/borgbackup/borg/blob/1.2.6/docs/changes.rst#pre-125-archives-spoofing-vulnerability-cve-2023-36811\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "borgbackup"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/borgbackup/borg/security/advisories/GHSA-8fjr-hghr-4m99"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-36811"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/borgbackup/borg/commit/3eb070191da10c2d3f7bc6484cf3d51c3045f884"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/borgbackup/borg"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/borgbackup/borg/blob/1.2.5-cvedocs/docs/changes.rst#pre-125-archives-spoofing-vulnerability-cve-2023-36811"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/borgbackup/borg/blob/1.2.6/docs/changes.rst#pre-125-archives-spoofing-vulnerability-cve-2023-36811"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/borgbackup/PYSEC-2023-164.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5Q3OHXERTU547SEQ3YREZXHOCYNLVD63"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XOZDFIYEBIOKSIEAXUJJJFUJTAJ7TF3C"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZUCQSMAWOJBCRGF6XPKEZ2TPGAPNKIWV"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-347" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-30T20:09:33Z",
    "nvd_published_at" : "2023-08-30T18:15:09Z"
  }
}