diff --git a/vault/logical_cubbyhole.go b/vault/logical_cubbyhole.go index af8a21fbf..9e944f7c7 100644 --- a/vault/logical_cubbyhole.go +++ b/vault/logical_cubbyhole.go @@ -111,6 +111,10 @@ func (b *CubbyholeBackend) handleRead(ctx context.Context, req *logical.Request, path := data.Get("path").(string) + if path == "" { + return nil, fmt.Errorf("missing path") + } + // Read the path out, err := req.Storage.Get(ctx, req.ClientToken+"/"+path) if err != nil { @@ -147,6 +151,10 @@ func (b *CubbyholeBackend) handleWrite(ctx context.Context, req *logical.Request path := data.Get("path").(string) + if path == "" { + return nil, fmt.Errorf("missing path") + } + // JSON encode the data buf, err := json.Marshal(req.Data) if err != nil {