Skip to content

Commit

Permalink
address uncleaned Dest from codeql
Browse files Browse the repository at this point in the history
  • Loading branch information
taigrr committed Jun 28, 2023
1 parent 722b7b3 commit 1f5b642
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pki/pki.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ func ListNKeysByType() types.KeysByType {
func RejectNKey(id string, nkey string) error {
defer ReloadNKeys()
newDest := filepath.Join(config.FarmerPKI, "sprouts", "rejected", id)
cleanDest := filepath.Clean(newDest)
if newDest != cleanDest {
return types.ErrSproutIDInvalid
}
fname, err := findNKey(id)
if nkey != "" && err == types.ErrSproutIDNotFound {
file, errCreate := os.Create(newDest)
Expand Down

0 comments on commit 1f5b642

Please sign in to comment.