fix(DB): validates db name for path traversal
This commit is contained in:
parent
3e3c55d0b6
commit
e806bd9046
4 changed files with 45 additions and 2 deletions
|
|
@ -51,6 +51,9 @@ func ParseKey(raw string, defaults bool) (KeySpec, error) {
|
|||
if strings.TrimSpace(rawDB) == "" {
|
||||
return KeySpec{}, fmt.Errorf("bad key format, use KEY@DB")
|
||||
}
|
||||
if err := validateDBName(rawDB); err != nil {
|
||||
return KeySpec{}, err
|
||||
}
|
||||
}
|
||||
|
||||
key := strings.ToLower(rawKey)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue