borgbackup is vulnerable to Path Traversal
30
Low Risk
The archive extraction code in borg builds output paths from names stored inside the archive without fully validating their parent components. A crafted archive whose entries contain embedded .. segments, symlinked or non-directory parent components, or hardlinks whose source path is unsafe can make borg act outside the intended extraction directory. This has two effects: files can be created, overwritten, or deleted at chosen locations on the filesystem of the account running the extraction (integrity), and a hardlink whose source resolves through a symlink or .. can link an arbitrary external file (for example /etc/shadow) into the extracted tree, exposing its contents (information disclosure, especially when restoring as root). The fix adds a _check_safe_parent() guard that rejects unsafe parent paths, validates the hardlink source before calling os.link(), and links with follow_symlinks=False where supported.
You are affected if you run a version in the vulnerable range and you extract an archive whose contents were produced or modified by an untrusted party with write access to the repository (and, for encrypted or authenticated repositories, the borg key and passphrase). Archives that borg itself created are safe because borg stores normalized relative paths and never follows symlinks; the risk is limited to restoring archives from a repository you do not fully control.
borgbackup is vulnerable to Path Traversal in versions 0.23.0 - 1.4.4.
Upgrade the borgbackup library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant