CVE-2026-82331: Apache BuildStream: tar source extraction escape
Improper link resolution before file access ('link following') vulnerability in the tar source plugin of Apache BuildStream running on Python < 3.12 allows malicious source tarballs to write files on the host, with the privileges of the user running BuildStream, via symlinks as part of source fetching. The impact of this issue is mitigated by:
BuildStream projects should only use trusted sources in their elements as otherwise the build output can also not be trusted Tracking a source tarball pins its SHA256 hash, which prevents MITM attacks of users that are fetching an already tracked project When running on Python >= 3.12, BuildStream >= 2.3.0 already makes use of the Python tarfile filter functionality, which blocks the symlink escape
Users are recommended to upgrade to version 2.8.1, which fixes this issue.
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Apache BuildStreamto a version that resolves this vulnerability.Fixed in 2.8.1 - Compensating control
Use only trusted sources in BuildStream elements.
- Compensating control
Track source tarballs so their SHA256 hashes are pinned, preventing MITM attacks when fetching an already tracked project.
Event History
Frequently Asked Questions
Who is most exposed to this issue?
Users running BuildStream with Python earlier than 3.12 are exposed when they fetch a malicious source tarball through the tar source plugin. The potential file writes occur with the privileges of the user running BuildStream.
What conditions are needed to exploit it?
An attacker needs a malicious source tarball containing symlinks that cause extraction to escape its intended destination. Projects that only use trusted sources reduce the practical risk, since untrusted sources also make build output untrustworthy.
Does source tracking reduce the risk?
Yes. Tracking a source tarball pins its SHA256 hash, preventing man-in-the-middle replacement of a tarball for users fetching an already tracked project. This does not make an originally tracked malicious tarball safe.
Are newer Python runtimes affected?
BuildStream 2.3.0 and later running on Python 3.12 or newer use Python tarfile filtering that blocks the symlink escape. The recommended remediation is to upgrade BuildStream to version 2.8.1.