VYPR
Unrated severityNVD Advisory· Published Aug 16, 2021· Updated Aug 3, 2024

ZipSlip vulnerability in bblfshd

CVE-2021-32825

Description

bblfshd is an open source self-hosted server for source code parsing. In bblfshd before commit 4265465b9b6fb5663c30ee43806126012066aad4 there is a "zipslip" vulnerability. The unsafe handling of symbolic links in an unpacking routine may enable attackers to read and/or write to arbitrary locations outside the designated target folder. This issue may lead to arbitrary file write (with same permissions as the program running the unpack operation) if the attacker can control the archive file. Additionally, if the attacker has read access to the unpacked files, he may be able to read arbitrary system files the parent process has permissions to read. For more details including a PoC see the referenced GHSL-2020-258.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A ZipSlip vulnerability in bblfshd before commit 4265465 allows arbitrary file write/read via malicious tar archives with crafted symbolic links.

Vulnerability

bblfshd before commit 4265465b9b6fb5663c30ee43806126012066aad4 contains a ZipSlip vulnerability in the untar routine, which extracts tar archives. The routine attempts to guard against symbolic links pointing outside the target directory, but the check is insufficient. A malicious archive can create a chain of symbolic links that bypasses the validation, allowing links to escape the extraction root. This affects all versions prior to the fix [2][3].

Exploitation

An attacker must supply a crafted tar archive to the bblfshd server for extraction. The exploit uses two symbolic links: first, a link subdir/parent pointing to .. (which passes the check because subdir/.. resolves within the archive root), and then a link subdir/parent/escapes pointing to .. (which now resolves to the parent directory of the extraction target). This allows writing or reading files outside the intended folder [2].

Impact

Successful exploitation enables arbitrary file write with the permissions of the bblfshd process, potentially leading to code execution or privilege escalation. Additionally, if the attacker can read the unpacked files, they may read arbitrary system files that the parent process has permissions to access, resulting in information disclosure [2].

Mitigation

The vulnerability is fixed in commit 4265465b9b6fb5663c30ee43806126012066aad4, which adds a check using filepath.EvalSymlinks to resolve the true target of symbolic links before allowing extraction [1][3]. Users should update to a version containing this commit. No workaround is documented, and the issue is not listed on CISA's Known Exploited Vulnerabilities catalog.

AI Insight generated on May 27, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

2
  • bblfsh/bblfshdllm-create
    Range: < commit 4265465b9b6fb5663c30ee43806126012066aad4
  • bblfsh/bblfshdv5
    Range: < 4265465b9b6fb5663c30ee43806126012066aad4

Patches

0

No patches discovered yet.

Vulnerability mechanics

Root cause

"Missing symlink resolution before path-prefix validation in tar extraction allows symbolic links to escape the destination directory."

Attack vector

An attacker who can supply a malicious tar archive to bblfshd's unpacking routine can exploit the "zipslip" vulnerability. The archive contains a symbolic or hard link whose target, after being joined with the destination path, passes the naive prefix check but actually resolves (via `filepath.EvalSymlinks`) to a location outside the designated target folder. This enables arbitrary file write with the permissions of the bblfshd process, or arbitrary file read if the attacker has access to the unpacked files [ref_id=1].

Affected code

The vulnerability resides in the `untar` function within bblfshd's archive extraction logic. The code handles `tar.TypeLink` (hardlink) and `tar.TypeSymlink` (symlink) entries by joining the link target with the destination directory, but prior to the patch only performed a simple string prefix check (`strings.HasPrefix(target, dest)`) without resolving intermediate symbolic links. This allowed a crafted archive whose link target contained symlinks pointing outside the destination to bypass the path traversal guard.

What the fix does

The patch adds a call to `filepath.EvalSymlinks` on the resolved target path before the prefix check for both hardlinks and symlinks. If the symlink-resolved path does not start with the destination directory, the function returns an error. This closes the bypass because even if a link target passes the string-prefix test, the actual filesystem location reached after following any intermediate symlinks is validated against the destination boundary [ref_id=1].

Preconditions

  • inputAttacker must be able to supply a crafted tar archive to bblfshd's unpack routine.
  • configThe bblfshd process must have write permissions to the target extraction directory and read permissions to any files the attacker wishes to read.

Generated on May 25, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

3

News mentions

0

No linked articles in our index yet.