Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

net: enable extended master secret #432

Merged
merged 1 commit into from
Oct 11, 2023
Merged

Conversation

sam-golioth
Copy link
Contributor

Extended Master Secret is a DTLS extension that ensures the Master Secret is tied to the handshake parameters and is used to prevent certain Man in the Middle attacks.

Confirmed with wireshark that the extension is present from Client and Server during handshake and communication with Golioth proceeds as normal.

Screenshot 2023-10-04 at 5 02 30 PM

Closes golioth/firmware-issue-tracker#224

@github-actions
Copy link

github-actions bot commented Oct 4, 2023

Visit the preview URL for this PR (updated for commit 2ab7986):

https://golioth-zephyr-sdk-doxygen-dev--pr432-enable-extended-gyb3h862.web.app

(expires Wed, 18 Oct 2023 19:49:03 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a389eefadf4b4b68a539327b3459dd66c142cf49

@mniestroj
Copy link
Collaborator

Is this Extended Master Secret enforced by the client? What happens if server respond without this option, would client drop the connection as being potential man-in-the-middle attack?

@sam-golioth
Copy link
Contributor Author

Is this Extended Master Secret enforced by the client? What happens if server respond without this option, would client drop the connection as being potential man-in-the-middle attack?

Hmm, that's a good question. I did some searching around and I'm not sure. I hope it drops it, otherwise it's not a very good protection, but I can't confirm.

@mniestroj
Copy link
Collaborator

Is this Extended Master Secret enforced by the client? What happens if server respond without this option, would client drop the connection as being potential man-in-the-middle attack?

Hmm, that's a good question. I did some searching around and I'm not sure. I hope it drops it, otherwise it's not a very good protection, but I can't confirm.

The reason I ask is that I probably (90% sure) was about to enable this feature in the past, haven't done it because it was not enforced anyway, i.e. not improving security because of man-in-the-middle attack. I think I tested it with mbedTLS or aiocoap, but as I say, I am not sure about it right now. Maybe we had something on Jira related to that...

Copy link
Contributor

@hasheddan hasheddan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified that mbedTLS does not require that the server (in this case) support the extended master secret extension. However, turning on this extension earlier rather than later starts us on the path of being able to require it at the server in the future (even if it is not required at the client). On a parallel track, we can work on seeing whether mbedTLS is amenable to adding support for requiring extended master secret.

Note that if we eventually got to the point where we could turn on required extended master secret at the server, the fact that it was optional at the client would not be as consequential (i.e. we are still guarding against the triple handshake attack). However, it would be nice if we could enforce this at the client and not require at the server in order to maintain backwards compatibility.

@@ -12,6 +12,7 @@ config GOLIOTH
select MBEDTLS_DTLS if MBEDTLS_BUILTIN
select MBEDTLS_TLS_LIBRARY if NRF_SECURITY
select MBEDTLS_SSL_PROTO_DTLS if NRF_SECURITY
select MBEDTLS_SSL_EXTENDED_MASTER_SECRET
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far we have all the required features pointed out here with select ... statement. MBEDTLS_SSL_EXTENDED_MASTER_SECRET is not required. So we should either:

  • make it explicit in commit message why it is required from now on (e.g. by wanting to change Golioth backend policy and make it a requirement at some point),
  • use imply ... instead of select ... to allow customers to disable it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the commit message to indicate that Golioth may enforce the use of Extended Master Secret on the server side in the future.

Extended Master Secret is a DTLS extension that ensures the
Master Secret is tied to the handshake parameters and is used to
prevent certain Man in the Middle attacks. Golioth reserves the right
to enforce the use of Extended Master Secret on the server side in
the future, so this option must be enabled to ensure continued
compatibility with Golioth.

Signed-off-by: Sam Friedman <[email protected]>
@sam-golioth sam-golioth force-pushed the enable_extended_master_secret branch from f7074a3 to 2ab7986 Compare October 11, 2023 19:48
@sam-golioth sam-golioth merged commit c044461 into main Oct 11, 2023
10 checks passed
@mniestroj mniestroj deleted the enable_extended_master_secret branch October 12, 2023 13:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants