Skip to content

Commit d0cab9a

Browse files
authored
[joiner] require link security for Joiner Entrust (openthread#13046)
This commit adds an explicit check in Joiner::HandleTmf<kUriJoinerEntrust> to verify that the received message has link-layer security enabled. According to the Thread specification, the Joiner Entrust message MUST be protected by link-layer security using the Key Encryption Key (KEK). Previously, this check was missing, allowing an unauthenticated attacker to send unsecured Joiner Entrust messages. Such messages could inject invalid network configuration, causing the device to fail to attach to the correct network after a reboot. By verifying IsLinkSecurityEnabled(), we ensure that the message was successfully decrypted using the KEK (since the network key is not yet known by the Joiner), thus authenticating the sender as the valid Commissioner or Joiner Router.
1 parent b45a1ad commit d0cab9a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/core/meshcop/joiner.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,8 @@ template <> void Joiner::HandleTmf<kUriJoinerEntrust>(Coap::Msg &aMsg)
421421
Error error;
422422
Dataset::Info datasetInfo;
423423

424-
VerifyOrExit(mState == kStateEntrust && aMsg.IsConfirmable(), error = kErrorDrop);
424+
VerifyOrExit(mState == kStateEntrust && aMsg.IsConfirmable() && aMsg.mMessage.IsLinkSecurityEnabled(),
425+
error = kErrorDrop);
425426

426427
LogInfo("Received %s", UriToString<kUriJoinerEntrust>());
427428
LogCert("[THCI] direction=recv | type=JOIN_ENT.ntf");

0 commit comments

Comments
 (0)