lnd: add AuxChannelNegotiator to AuxComponents
What changed, and why it matters
This commit adds a new optional component called AuxChannelNegotiator to LND's auxiliary components configuration. It is a small wiring change that lets optional custom channel implementations inject and process custom records in peer messages. There is no direct security bug visible in the diff itself; it is a feature/extension hook being added.
Review the implementation of lnwallet.AuxChannelNegotiator and how custom records are validated, serialized, and processed in peer messages. Ensure only trusted aux channel implementations can register and that custom records cannot bypass existing channel security checks. Treat this commit as a dependency of a larger feature review rather than a standalone security issue.
Security signals we found
New optional component hook for custom wire message records
Potential expansion of attack surface for custom channel implementations if negotiator is supplied by untrusted code
No input validation, parsing, or authorization logic visible in this commit
Evidence from the diff
The change extends the AuxComponents struct in config_builder.go with an optional AuxChannelNegotiator field (wrapped in fn.Option). The commit message states it is plugged into the server implementation config and provided to the peer config so custom records can be injected into channel-related wire messages. The diff only shows the struct field addition; no implementation of the negotiator or its use in message handling is visible here.
Changed components
config_builder.goAuxComponents structserver implementation configpeer configlnwallet.AuxChannelNegotiatorInspect captured patch +5 / −0
diff --git a/config_builder.go b/config_builder.go
index 6f9cb1f..d3ca5e2 100644
--- a/config_builder.go
+++ b/config_builder.go
@@ -213,6 +213,11 @@ type AuxComponents struct {
// AuxContractResolver is an optional interface that can be used to
// modify the way contracts are resolved.
AuxContractResolver fn.Option[lnwallet.AuxContractResolver]
+
+ // AuxChannelNegotiator is an optional interface that allows aux channel
+ // implementations to inject and process custom records over channel
+ // related wire messages.
+ AuxChannelNegotiator fn.Option[lnwallet.AuxChannelNegotiator]
}
// DefaultWalletImpl is the default implementation of our normal, btcwallet
Why this scored 17/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.