Skip to content

v0.1.1 — save_key hardening

Choose a tag to compare

@HiroAlleyCat HiroAlleyCat released this 29 May 03:43

Lifts two defenses from Muninn v1.11.1's save_key so every tool using gungnir inherits them.

Added

  • KeyFileSymlinkError — raised by save_key() when the target key file is a symlink, closing a redirect-to-arbitrary-file vector.
  • save_key() creates the file with O_CREAT|O_TRUNC at mode 0o600 atomically. Previously the file existed briefly at the umask default before chmod tightened it.

Compatibility

  • API surface unchanged for callers that aren't writing key files.
  • save_key() callers that didn't catch the new exception will see it bubble up where v0.1.0 silently followed the symlink. Treated as a defect fix.

Used by