Stop OTR from leaking network availability#2166
Conversation
ea08c10 to
035d856
Compare
Signed-off-by: techmetx11 <techmetx11@disroot.org>
|
There seems to be missing context here. Could you expand a bit what on what is happening and how? Also I think there are people that want to chat using OTR and don't grant subscription to the roster to the other party. So this PR might need redoing. Probably a setting will be needed for But let's hear more about the original concern first. |
Spammers have been abusing OTR presumably to figure out if users are online, because OTR will inject a message upon receiving a handshake message ( What also makes this worse is that if the attacker doesn't use monocles.chat fixed this issue somehow. It doesn't respond to OTR handshakes from strangers |
|
I'm curious what other clients do. But I think not many even still support OTR at this point, right? |
|
Ok I think I understood the problem now well enough. |
|
@techmetx11 please take a look at #2168. |
I think that's better than what I did here. LGTM! |
`cb_is_logged_in()` incorrectly returned `PRESENCE_ONLINE` for contacts not in the roster or without a presence subscription. According to libotr API documentation, returning 1 informs the library that it is safe to send automated background traffic (heartbeats or handshake responses). Because of this, when spammers sent an initial OTR query (`?OTR?v23?`), we would automatically inject a handshake response, confirming the users network availability. This violates XMPP Presence Privacy best practices defined in RFC 6121 Section 4.1, which states that presence information must not be revealed to entities without explicit authorization. Fixes: profanity-im#2166 Signed-off-by: Michael Vetter <jubalh@iodoru.org>
In Profanity, OTR can be abused to leak the user's network availability, without a subscription request and with just their bare JID. This may have been exploited in the wild by malicious users and spammers.
This PR will stop
libotrfrom injecting messages if the recipient doesn't have a subscription