Found by the audit for #33 (comment on that issue).
Problem
The vault name check accepts . and .., and two commands do not call it at all: secret vault import and the vault part of a move between vaults (secret mv vault:name ...). Consequences:
vault import .. (or .) writes a public key, metadata and an unlocker into the state directory or any other existing directory.
A cross-vault move can copy a secret into any other location that holds a vault layout.
vault create . creates a vault inside vaults.d, whose secrets.d and unlockers.d then list as vaults.
No data is lost on these paths: a move deletes its source only after copying, and replaces an existing secret only with --force.
Definition of done
The vault name rule rejects "", ., .. and anything containing a path separator.
Every command that turns a user-supplied vault name into a path calls that one rule on the name as typed, before building the path: vault create, vault import, vault select, vault remove, and the vault part of mv.
Tests: each command with ., .. and a/b fails and leaves the state directory unchanged (record before and after, as in #65).
TODO.md updated in the same commit.
Model: opus-5-5
Found by the audit for https://git.eeqj.de/sneak/secret/issues/33 (comment on that issue).
## Problem
The vault name check accepts `.` and `..`, and two commands do not call it at all: `secret vault import` and the vault part of a move between vaults (`secret mv vault:name ...`). Consequences:
- `vault import ..` (or `.`) writes a public key, metadata and an unlocker into the state directory or any other existing directory.
- A cross-vault move can copy a secret into any other location that holds a vault layout.
- `vault create .` creates a vault inside `vaults.d`, whose `secrets.d` and `unlockers.d` then list as vaults.
No data is lost on these paths: a move deletes its source only after copying, and replaces an existing secret only with `--force`.
## Definition of done
- The vault name rule rejects `""`, `.`, `..` and anything containing a path separator.
- Every command that turns a user-supplied vault name into a path calls that one rule on the name as typed, before building the path: `vault create`, `vault import`, `vault select`, `vault remove`, and the vault part of `mv`.
- Tests: each command with `.`, `..` and `a/b` fails and leaves the state directory unchanged (record before and after, as in https://git.eeqj.de/sneak/secret/pulls/65).
- `TODO.md` updated in the same commit.
Model: opus-5-5
#93 adds the rule (no . or .. on top of the existing lowercase-letters, digits, ., -, _ set), states it in the error and README.md, and checks it as typed in vault create, vault import, vault select, vault remove and both vault names of mv.
Not covered, since it is outside this issue's list: shell completion of vault:secret still builds a read-only path from the typed vault name.
Model: opus-5-5
https://git.eeqj.de/sneak/secret/pulls/93 adds the rule (no `.` or `..` on top of the existing lowercase-letters, digits, `.`, `-`, `_` set), states it in the error and `README.md`, and checks it as typed in `vault create`, `vault import`, `vault select`, `vault remove` and both vault names of `mv`.
Not covered, since it is outside this issue's list: shell completion of `vault:secret` still builds a read-only path from the typed vault name.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found by the audit for #33 (comment on that issue).
Problem
The vault name check accepts
.and.., and two commands do not call it at all:secret vault importand the vault part of a move between vaults (secret mv vault:name ...). Consequences:vault import ..(or.) writes a public key, metadata and an unlocker into the state directory or any other existing directory.vault create .creates a vault insidevaults.d, whosesecrets.dandunlockers.dthen list as vaults.No data is lost on these paths: a move deletes its source only after copying, and replaces an existing secret only with
--force.Definition of done
"",.,..and anything containing a path separator.vault create,vault import,vault select,vault remove, and the vault part ofmv..,..anda/bfails and leaves the state directory unchanged (record before and after, as in #65).TODO.mdupdated in the same commit.Model: opus-5-5
#93 adds the rule (no
.or..on top of the existing lowercase-letters, digits,.,-,_set), states it in the error andREADME.md, and checks it as typed invault create,vault import,vault select,vault removeand both vault names ofmv.Not covered, since it is outside this issue's list: shell completion of
vault:secretstill builds a read-only path from the typed vault name.Model: opus-5-5