diff --git a/docs/release-notes/release-notes-0.14.0.md b/docs/release-notes/release-notes-0.14.0.md index 7c2468dce..4e1b1ff74 100644 --- a/docs/release-notes/release-notes-0.14.0.md +++ b/docs/release-notes/release-notes-0.14.0.md @@ -150,6 +150,8 @@ A bug has been fixed that would cause `lnd` to [try to bootstrap using the currnet DNS seeds when in SigNet mode](https://github.com/lightningnetwork/lnd/pull/5564). +[A validation check for sane `CltvLimit` and `FinalCltvDelta` has been added for `REST`-initiated payments.](https://github.com/lightningnetwork/lnd/pull/5591) + ## Documentation The [code contribution guidelines have been updated to mention the new diff --git a/rpcserver.go b/rpcserver.go index 92d21cc1b..a15235b92 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -4339,6 +4339,14 @@ func (r *rpcServer) extractPaymentIntent(rpcPayReq *rpcPaymentRequest) (rpcPayme return payIntent, err } + // Do bounds checking with the block padding. + err = routing.ValidateCLTVLimit( + payIntent.cltvLimit, payIntent.cltvDelta, true, + ) + if err != nil { + return payIntent, err + } + return payIntent, nil }