Advisory

GHSA-8fjr-hghr-4m99

Also known as: CVE-2023-36811, PYSEC-2023-164

Summary

Archive spoofing vulnerability in borgbackup

Details

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

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2023-08-30 20:09 UTC
Modified
2024-09-13 15:06 UTC

Affected packages and fixes

borgbackup

PyPI · All systems

Affected

  • introduced 0, fixed 1.2.5 (ecosystem)

Fixed versions

1.2.5

Fix

  • Fixed version 1.2.5
    pip install --upgrade borgbackup==1.2.5

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences