diff --git a/changelog/18951.txt b/changelog/18951.txt new file mode 100644 index 000000000..9617c0d49 --- /dev/null +++ b/changelog/18951.txt @@ -0,0 +1,3 @@ +```release-note:bug +core: Prevent panics in `sys/leases/lookup`, `sys/leases/revoke`, and `sys/leases/renew` endpoints if provided `lease_id` is null +``` diff --git a/vault/request_handling.go b/vault/request_handling.go index c31d543eb..1d56d488a 100644 --- a/vault/request_handling.go +++ b/vault/request_handling.go @@ -632,7 +632,7 @@ func (c *Core) handleCancelableRequest(ctx context.Context, req *logical.Request case "sys/leases/lookup", "sys/leases/renew", "sys/leases/revoke", "sys/leases/revoke-force": leaseID, ok := req.Data["lease_id"] // If lease ID is not present, break out and let the backend handle the error - if !ok { + if !ok || leaseID == nil { break } _, nsID := namespace.SplitIDFromString(leaseID.(string))