applier: AtomicWrite clobbers a symlinked LICENSE #33

Closed
opened 2026-06-08 16:38:27 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-06-08 16:38:27 +00:00 (Migrated from github.com)

Found during full-codebase review (see docs/review/01-write-path-safety.md).

[MED] internal/applier/applier.go (~283): source files are safe (enumerate skips symlinks), but managed LICENSE/LICENSES/*.txt are written with no symlink check, so os.Rename converts a symlink into a regular file.

Fix: detect a symlinked target and refuse (or resolve) rather than replacing it.

Found during full-codebase review (see docs/review/01-write-path-safety.md). **[MED]** `internal/applier/applier.go` (~283): source files are safe (enumerate skips symlinks), but managed `LICENSE`/`LICENSES/*.txt` are written with no symlink check, so `os.Rename` converts a symlink into a regular file. Fix: detect a symlinked target and refuse (or resolve) rather than replacing it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/license-tool#33