CVE-2023-36811
JSON

4.7medium

Archive spoofing vulnerability in borgbackup

Severity
4.7medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.11% (higher than 1% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-8fjr-hghr-4m99PYSEC-2023-164

Description

borgbackup is an opensource, deduplicating archiver with compression and authenticated encryption. 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 and 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. The issue has been fixed in borgbackup 1.2.5. Users are advised to upgrade. Additionally to installing the fixed code, users must follow the upgrade procedure as documented in the change log. 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". There are no known workarounds for this vulnerability.

Affected

Product or packageVersionsReported by
borgbackup borg< 1.2.5, before 1.2.5CVE List, NVD
borgbackup (PyPI)before 1.2.5, before 3eb070191da10c2d3f7bc6484cf3d51c3045f884GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M4.7medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N
GitHub4.7medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
NVD4.7medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N
PyPA Advisory Database4.7medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N

Classification

CWE-347

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

borgbackup is an opensource, deduplicating archiver with compression and authenticated encryption. 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 and 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. The issue has been fixed in borgbackup 1.2.5. Users are advised to upgrade. Additionally to installing the fixed code, users must follow the upgrade procedure as documented in the change log. 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". There are no known workarounds for this vulnerability.

GitHub Advisory Database
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

NVD (es)

borgbackup es un archivador de duplicación de código abierto con compresión y cifrado autenticado. Una falla en el esquema de autenticación criptográfica en borgbackup permitió a un atacante falsificar archivos y potencialmente causar indirectamente la pérdida de datos de los respaldo en el repositorio. El ataque requiere que un atacante pueda: 1. insertar archivos (sin encabezados adicionales) en las copias de seguridad y 2. obtener acceso de escritura al repositorio. Esta vulnerabilidad no revela texto sin formato al atacante ni afecta la autenticidad de los archivos existentes. La creación de archivos falsos plausibles puede ser factible para archivos vacíos o pequeños, pero es poco probable para archivos grandes. El problema se solucionó en borgbackup 1.2.5. Se recomienda a los usuarios que actualicen. Además de instalar el código fijo, los usuarios deben seguir el procedimiento de actualización como se documenta en el registro de cambios. La pérdida de datos después de un ataque se puede evitar revisando los archivos (marca de tiempo y contenido válidos y esperados) después de cualquier "borg check --repair" y antes de "borg prune". No se conocen workarounds para esta vulnerabilidad.

References

https://github.com/borgbackup/borg/security/advisories/GHSA-8fjr-hghr-4m99advisory, vendor-advisory, web
https://github.com/borgbackup/borg/commit/3eb070191da10c2d3f7bc6484cf3d51c3045f884fix, patch, web
https://github.com/borgbackup/borg/blob/1.2.5-cvedocs/docs/changes.rst#pre-125-archives-spoofing-vulnerability-cve-2023-36811third-party-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZUCQSMAWOJBCRGF6XPKEZ2TPGAPNKIWV/
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5Q3OHXERTU547SEQ3YREZXHOCYNLVD63/
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XOZDFIYEBIOKSIEAXUJJJFUJTAJ7TF3C/
https://nvd.nist.gov/vuln/detail/CVE-2023-36811advisory
https://github.com/borgbackup/borgpackage
https://github.com/borgbackup/borg/blob/1.2.6/docs/changes.rst#pre-125-archives-spoofing-vulnerability-cve-2023-36811web
https://github.com/pypa/advisory-database/tree/main/vulns/borgbackup/PYSEC-2023-164.yamlweb
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5Q3OHXERTU547SEQ3YREZXHOCYNLVD63web
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XOZDFIYEBIOKSIEAXUJJJFUJTAJ7TF3Cweb

Sources

SourceRecordLicence
CVE ListCVE-2023-36811 changed 2025-02-13CVE Terms of Use
GitHub Advisory DatabaseGHSA-8fjr-hghr-4m99 changed 2024-09-13CC-BY-4.0
NVDCVE-2023-36811 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2023-164 changed 2023-11-08CC-BY-4.0