-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent reception of unencrypted messages in an encrypted message exchange #8556
Prevent reception of unencrypted messages in an encrypted message exchange #8556
Conversation
@saurabhst do you have any review feedback? |
/rebase |
a26adbd
to
a2ef424
Compare
Size increase report for "gn_qpg-example-build" from 762a204
Full report output
|
Size increase report for "esp32-example-build" from 762a204
Full report output
|
Size increase report for "nrfconnect-example-build" from 762a204
Full report output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most of the reviewers agree that this is only a temporary solution. However, the prevailing thought seems to be this is fine to merge now and we can refine later.
I disagree. This does not address the fact that we have a model now that is essentially:
if (session is valid) {
inject incoming message into X context without authentication
}
It is not sufficient just to verify that an incoming message belongs to one of the open sessions. That's a recipe for privilege escalation. For the security model to survive, each exchange must map to a specific session.
Please see #8556 (comment) |
…sage exchange (project-chip#8556)" This reverts commit 51a9262. CI failure with core dump started on this PR.
…hange (project-chip#8556) * Prevent injection of unencrypted messages in an application message exchange * fix test
Problem
A malicious node can currently send unencrypted messages to an exchange that requires encrypted messages.
Change overview
Currently the only unencrypted messages a device should receive are session establishment messages.
This PR adds a flag to the exchange dispatch, which defines if encryption is mandatory for a message exchange. This flag is set to true by default for every exchange, except for session establishment message dispatch class.
Testing
Added a new unit test CheckUnencryptedMessageReceiveFailure that tries to send an unencrypted message to an exchange that requires encryption. The test expects that the message will be sent, but dropped by the receiver.