Skip to content

Commit

Permalink
Disallow / in key names
Browse files Browse the repository at this point in the history
Signed-off-by: Nghia Tran <[email protected]>
  • Loading branch information
tcnghia committed Jan 24, 2025
1 parent ec48e30 commit 8f52674
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/apk/apk/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,12 @@ func parseRepositoryIndex(ctx context.Context, u string, keys map[string][]byte,
if len(keys) == 0 {
return nil, fmt.Errorf("no keys provided to verify signature")
}
// check that they key name aren't paths or URLs
for keyName := range keys {
if strings.Contains(keyName, "/") {
return nil, fmt.Errorf("invalid keyname %q", keyName)
}
}
buf := bytes.NewReader(b)
gzipReader, err := gzip.NewReader(buf)
if err != nil {
Expand Down

0 comments on commit 8f52674

Please sign in to comment.