# GHSA-RXWP-Q2QG-98VW: veans init follows repo symlinks when writing files

- Database: GitHub
- Severity: CVSS 3.3 (Low)
- Published: 2026-10-22
- Modified: 2026-10-22

## Affected versions

- code.vikunja.io/veans (Go): through 0.0.0

## Description

Affects all veans versions (veans has no tagged release yet).

## Summary
A hostile repo ships symlinks so that `veans init` writes outside the repo. The attacker can't control the content, so the result is file destruction or a stray global hook, not code execution. Three variants:
- `.veans.yml` → `~/.bashrc`: the target is overwritten on "y"; a dangling link's target is created with no prompt.
- `.claude` → `~/.claude`: a hook is added to the global `settings.json`.
- `.opencode` → a global plugin is installed.

## Details
There is no `Lstat`, `O_NOFOLLOW` or `EvalSymlinks` in `veans/internal`. The writes are at `veans/internal/config/config.go:151-154` and `veans/internal/bootstrap/hooks.go:231-234,269-281`, and the overwrite check uses link-following `os.Stat` (`veans/internal/bootstrap/bootstrap.go:320`).

## Impact
Loss of a user file reachable via symlink, or veans hooks/plugins installed globally for every agent session. Requires the victim to run `veans init` in the hostile checkout.

## Fix
veans is on Go 1.27, so use `os.OpenRoot(repoRoot)` once and route writes through `root.MkdirAll`/`root.WriteFile` with repo-relative paths. Route the preceding reads through it too: the `settings.json` merge read, and `os.Stat` → `root.Lstat`. Test that outside targets error and stay untouched, and that an in-repo link still works. `credentials/file.go` (global XDG) is out of scope.

This is unrelated to the planned veans trust gate, because the user chose to run init in that repo.

_Found via internal security review (deep #34)._

## References

- https://github.com/go-vikunja/vikunja/security/advisories/GHSA-rxwp-q2qg-98vw

Page: https://cve.now/GHSA-RXWP-Q2QG-98VW

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
