From 959a70e4a9a1e35df5829287dea0f5ef398e8a40 Mon Sep 17 00:00:00 2001 From: Vishal Nayak Date: Tue, 6 Nov 2018 14:08:55 -0500 Subject: [PATCH] Disallow writing to empty paths (#5702) --- vault/logical_passthrough.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vault/logical_passthrough.go b/vault/logical_passthrough.go index aacd2e0337..c971c44798 100644 --- a/vault/logical_passthrough.go +++ b/vault/logical_passthrough.go @@ -167,6 +167,10 @@ func (b *PassthroughBackend) GeneratesLeases() bool { } func (b *PassthroughBackend) handleWrite(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) { + if req.Path == "" { + return logical.ErrorResponse("missing path"), nil + } + // Check that some fields are given if len(req.Data) == 0 { return logical.ErrorResponse("missing data fields"), nil