CVE
Not assigned
CWE
CWE-59, CWE-61
Affected Surface
- Users of the Go package github.com/brig-sh/brig in versions earlier than 0.3.0 on macOS or Linux
- Teams that let brig-managed AI agents run with read-write access to repositories and later re-run those agents against writable subdirectories of the same tree
- Developer hosts where brig sandboxes could reach SSH keys, cloud credentials, shell startup files, other projects, or brig session state once a planted symlink was remounted
Endor Labs disclosed a high-severity path-handling flaw in github.com/brig-sh/brig on 28 September 2026. The bug is not a hypervisor break or a guest-kernel escape. It is a host-side mount validation failure. If an agent already had read-write access to a repository, it could replace a subdirectory with a symlink to another host path. A later brig run that targeted that subdirectory would then hand the unresolved path to the runtime, which mounted the symlink target read-write into the sandbox.
That distinction matters. The isolation layer is still there. The problem is that brig becomes the confused deputy that asks the runtime to export the wrong directory.
Affected package and version range
The affected package is the Go module:
github.com/brig-sh/brig
Affected and fixed versions from the public disclosure:
| Package | Affected versions | Fixed version |
|---|---|---|
github.com/brig-sh/brig | <0.3.0 | 0.3.0 |
The vulnerable behavior was introduced with brig’s named-project feature on 1 September 2026. The public fix was already present in v0.3.0, which the brig release notes published on 26 September described as:
wrap: reach the project by handle, refusing a planted link (05c22a2)
wrap: report the project brig resolved, not the path typed (92757a3)
Root cause
The report’s most useful code snippet is the one that shows the mistake in one place:
real, err := filepath.EvalSymlinks(abs)
// ... refuse only if real resolves to the filesystem root ...
c.Project = abs
c.GuestProject = GuestProject(abs)
filepath.EvalSymlinks(abs) resolved the path once for a narrow check, but brig then discarded the resolved value and stored abs, the path exactly as the operator typed it. The runtime adapter later used that unresolved string when constructing the mount specification.
That is enough for a two-run exploit:
- An agent gets a repository mounted read-write.
- Inside the sandbox, it replaces a writable subdirectory with a symlink to another host directory.
- The operator later runs brig against that subdirectory.
- Brig hands the unresolved path to the runtime.
- The runtime follows the symlink on the host and mounts the target back into the sandbox.
The sandbox did not discover a new primitive. It reused the mount that brig asked for.
Reproduction path
Endor’s reported sequence is short and realistic:
mkdir -p ~/lab/monorepo/frontend
echo 'console.log(1)' > ~/lab/monorepo/frontend/app.js
mkdir -p ~/escape-target
echo "HOST-PROOF-1 $(openssl rand -hex 32)" > ~/escape-target/proof.txt
brig run claude ~/lab/monorepo -d
brig sh claude sh -c "rm -rf /work/monorepo/frontend && ln -s $HOME/escape-target /work/monorepo/frontend"
brig run claude ~/lab/monorepo/frontend -d
brig sh claude sh -c 'cat /work/frontend/proof.txt'
brig sh claude sh -c 'echo "HOST-PROOF-2 written from inside the brig sandbox" > /work/frontend/proof2.txt'
Two facts make that sequence more dangerous than it looks at first glance:
- The symlink can be planted in one run and triggered in a later run.
- The agent never needs direct access to the target path during the planting step. The link can dangle inside the guest and become meaningful only when the host resolves it later.
Why the blast radius is larger than one repository
The disclosure tested both macOS microVM and Linux container-backed configurations. The same flaw held because the weak point was not backend-specific kernel isolation. It was the host path that brig handed to the backend.
Once the symlink target is mounted, the reachable data stops being “the repository” and becomes “whatever the user running brig can already read and write.” Examples from the public write-up include:
~/.ssh- cloud credentials such as
~/.aws - GitHub CLI config such as
~/.config/gh/hosts.yml - other local projects
- brig’s own session state
- shell startup files and other writeable paths that can turn file access into code execution
That last class is the operational issue. A sandbox escape that can write ~/.ssh/authorized_keys, a shell rc file, or another startup-controlled path is no longer only about data exposure.
What changed in v0.3.0
The fix in v0.3.0 is more useful than a one-line patch note because it shows the invariant brig actually needed. Endor describes the repair as a trusted-prefix descent:
- Find the first directory the invoking user can write.
- Open the non-writable prefix by name.
- Descend the writable portion one path component at a time.
- Refuse symlinks below that split point.
- Re-check identity as the path is opened and carried into the runtime handoff.
That is the correct shape here because a simple “last component must not be a symlink” check is too weak. The attacker can place the link on any component under the writable part of the project path.
The release notes also mention a second defensive change:
wrap: report the project brig resolved, not the path typed
That closes an operator-visibility problem as well. In the vulnerable path, the UI showed the path the user entered, not where the runtime actually mounted.
What to check if you ran brig before 0.3.0
Start with version scope:
brig version
Then look for symlinks inside repositories that brig-managed agents previously had mounted read-write, especially in directories operators later targeted as narrower project roots:
find /path/to/repo -type l -ls
If your workflow often narrows a run from a repository root to a subdirectory, review those transitions first. The exploit needs the second run.
For a fast inventory of potentially sensitive mount targets on developer workstations, focus on paths that an agent should never have been able to reach through a project mount:
ls -ld ~/.ssh ~/.aws ~/.config/gh "$HOME" 2>/dev/null
That command does not prove compromise. It tells you which high-value targets would have been in scope if a planted symlink had been remounted.
Response guidance
-
Upgrade brig to
v0.3.0or later. -
If you cannot upgrade immediately, resolve project paths before invoking brig:
brig run claude "$(cd /path/to/project && pwd -P)" -
Treat writable repository trees previously mounted into brig as untrusted input if an agent could modify them and an operator later reused nested paths from that tree.
-
If a vulnerable host handled credentials such as SSH keys, cloud credentials, or GitHub tokens during that period, assess whether those files could have been remounted and rotate them when the exposure path is plausible.
This issue is a good reminder that “sandboxed” is only as strong as the host-side path validation that feeds the sandbox. In brig’s pre-0.3.0 path, the code hardened one mount path carefully and left the other path with weaker rules. The attacker only had to wait for the weaker path to be used.
From research to remediation
Check whether this pattern exists in your codebase
Turn this research into a remediation workflow. Scan dependencies and package manifests for similar supply-chain risk, then prioritize fixes with reachability context.