AddSecret validates names via isValidSecretName(), but GetSecret and GetSecretVersion in internal/vault/secrets.go do not validate the name parameter before constructing filesystem paths.
Impact
An attacker (or malformed input) could pass ../../etc/passwd as a secret name. The / → % replacement would prevent literal directory traversal, but .. is not blocked. A name like ..%2F..%2Fetc%2Fpasswd after round-tripping could cause unexpected behavior. More practically, names with .. components that don't contain / (e.g. ..) would directly traverse.
Fix
Call isValidSecretName(name) at the top of GetSecretVersion (which GetSecret delegates to). Return an error for invalid names.
Location
internal/vault/secrets.go — GetSecretVersion() around line 10-40
## Summary
`AddSecret` validates names via `isValidSecretName()`, but `GetSecret` and `GetSecretVersion` in `internal/vault/secrets.go` do **not** validate the `name` parameter before constructing filesystem paths.
## Impact
An attacker (or malformed input) could pass `../../etc/passwd` as a secret name. The `/` → `%` replacement would prevent literal directory traversal, but `..` is not blocked. A name like `..%2F..%2Fetc%2Fpasswd` after round-tripping could cause unexpected behavior. More practically, names with `..` components that don't contain `/` (e.g. `..`) would directly traverse.
## Fix
Call `isValidSecretName(name)` at the top of `GetSecretVersion` (which `GetSecret` delegates to). Return an error for invalid names.
## Location
`internal/vault/secrets.go` — `GetSecretVersion()` around line 10-40
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.
Summary
AddSecretvalidates names viaisValidSecretName(), butGetSecretandGetSecretVersionininternal/vault/secrets.godo not validate thenameparameter before constructing filesystem paths.Impact
An attacker (or malformed input) could pass
../../etc/passwdas a secret name. The/→%replacement would prevent literal directory traversal, but..is not blocked. A name like..%2F..%2Fetc%2Fpasswdafter round-tripping could cause unexpected behavior. More practically, names with..components that don't contain/(e.g...) would directly traverse.Fix
Call
isValidSecretName(name)at the top ofGetSecretVersion(whichGetSecretdelegates to). Return an error for invalid names.Location
internal/vault/secrets.go—GetSecretVersion()around line 10-40