Skip to content

Commit 92f0718

Browse files
Ignore DNSSECQuery OMs with unexpected context
Prior to this commit we would allow DNSSEDQuery onion messages that were sent over blinded paths that were created for other purposes. This could be used to correlate identities and unblind a path, so disallow this. For consistency we also add a log on receipt of a DNSSECProof message with a missing context.
1 parent e050044 commit 92f0718

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lightning/src/onion_message/messenger.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -1956,6 +1956,14 @@ where
19561956
let responder = reply_path.map(Responder::new);
19571957
match message {
19581958
DNSResolverMessage::DNSSECQuery(msg) => {
1959+
if context.is_some() {
1960+
log_trace!(
1961+
logger,
1962+
"Ignoring DNSSECQuery onion message with unexpected context: {:?}",
1963+
context.unwrap()
1964+
);
1965+
return;
1966+
}
19591967
let response_instructions =
19601968
self.dns_resolver_handler.handle_dnssec_query(msg, responder);
19611969
if let Some((msg, instructions)) = response_instructions {
@@ -1965,7 +1973,13 @@ where
19651973
DNSResolverMessage::DNSSECProof(msg) => {
19661974
let context = match context {
19671975
Some(ctx) => ctx,
1968-
None => return,
1976+
None => {
1977+
log_trace!(
1978+
logger,
1979+
"Ignoring DNSSECProof onion message due to missing context"
1980+
);
1981+
return;
1982+
},
19691983
};
19701984
self.dns_resolver_handler.handle_dnssec_proof(msg, context);
19711985
},

0 commit comments

Comments
 (0)