XSF Discussion - 2020-03-10


  1. rion is updating xep-0371 against updated ICE RFC. PR will be ready soon.

  2. Link Mauve

    jonas’, what are your plans wrt XEP-0390?

  3. Link Mauve

    Is it planned to stay compatible or do you want to change things?

  4. Link Mauve

    For a new client which doesn’t need to be compatible with anything else, can I require it instead of 0115?

  5. rion

    I remember we discussed some missing features in XEP-0390. Not sure if it went to mail-list

  6. jonas’

    Link Mauve, I think it needs some breaking changes

  7. jonas’

    though I don’t recall specifically what those were

  8. Link Mauve

    Ok.

  9. Link Mauve

    I’d like to become author for XEP-0284 btw.

  10. pep.

    You need an ack from the author? How does that work? Council if no reply from them after some time?

  11. pep.

    authors*

  12. jonas’

    pep., effectively

  13. pep.

    Link Mauve, can you PR?

  14. Link Mauve

    Sure.

  15. Link Mauve

    I have other changes to do too.

  16. pep.

    :)

  17. pep.

    Just that it's the best way to get things to move

  18. jonas’

    yeah, if we have a PR to look at, we can track the authors responsiveness, and if it is lacking, we can make you author

  19. Ge0rG

    And what do you do if you have an author, but you disagree with them on some important architectural points? Fork the XEP?

  20. pep.

    I guess that's up to the author to know what they want and accept/refuse new authors

  21. pep.

    And yeah you'd fork the XEP if you really wanted.. ?

  22. pep.

    Not sure where council would stand here

  23. moparisthebest

    Syndace: "GCM is not meant to handle larger amounts of data" what do you mean?

  24. Syndace

    moparisthebest: GCM mandates to not return any of the plaintext until the auth tag is verified. This means that conforming implementations have to keep the whole plaintext in ram

  25. moparisthebest

    I don't think so

  26. Daniel

    You can/are supposed to chunk the data I think

  27. Syndace

    See the Conversations thing that you just helped Daniel fix :D

  28. moparisthebest

    You can just split it into smaller chunks

  29. Daniel

    But it doesn't matter. The other two points are correct

  30. Daniel

    And more important

  31. Syndace

    Sure, you can also just use CBC

  32. moparisthebest

    The problem isn't solved by cbc

  33. moparisthebest

    Do you output unverified CBC decryption? You shouldn't

  34. Syndace

    We use HMAC

  35. moparisthebest

    Right, gcm is just hmac but built in so you can't use it incorrectly

  36. Syndace

    then consider that point of my mail as invalid

  37. moparisthebest

    The same restriction applies, you shouldn't use the result of the decryption unless the hmac is valid

  38. Link Mauve

    pep., jonas’, here: https://github.com/xsf/xeps/pull/904

  39. moparisthebest

    So you must keep that chunk in ram until you do, in both cases the solution is chunking

  40. moparisthebest

    The "single primitive" is still a good argument

  41. moparisthebest

    Just means you have to be super careful about the hmac...

  42. Syndace

    Also I think GCM impls are not known for being bug free and super compatible

  43. Daniel

    Well to be fair with gcm you have to be careful with the Auth tag

  44. Daniel

    And both old old omemo and http upload do it wrong

  45. Daniel

    I guess you always have to be careful with crypto

  46. moparisthebest

    I think aes-gcm is required for http2 TLS, pretty compatible

  47. moparisthebest

    If you use the correct length IV

  48. moparisthebest

    Which obviously isn't obvious :)

  49. moparisthebest

    Do you encrypt then hmac or hmac then encrypt, that's the real gotcha when not using authenticated encryption modes

  50. Syndace

    encrypt then hmac

  51. Syndace

    ...the same way it's done by double ratchet

  52. moparisthebest

    So you can verify the hmac before you even try to decrypt

  53. moparisthebest

    But that means for large data you still need chunked, because the hmac is at the end, so you buffer encrypted data before getting to it, verify, then decrypt

  54. Syndace

    yup, the description of the message decryption algorithm also lists the hmac verification before the decryption

  55. jonas’

    fun

  56. Syndace

    moparisthebest: well we encrypt stanzas so size limits apply

  57. Syndace

    pretty sure a single stanza can fit the ram

  58. moparisthebest

    Hehehe how sure are you :)

  59. jonas’

    moparisthebest, did you submit your updates on '368 already?

  60. moparisthebest

    No, still need to...

  61. jonas’

    alright, then I didn’t miss it

  62. Syndace

    > Hehehe how sure are you :) not sure enough. Noted as something we have to think/talk about again, thanks for the input.

  63. jonas’

    to play it safe, a Full Stanza Encryption implementation can’t generate stanzas over ~7 kiB (decrypted) either way

  64. Syndace

    I mean, stanzas are pretty damn certainly under 1 MiB in size, but still there are theoretical edge cases of IoT devices wanting to use OMEMO or something...

  65. Syndace

    Oh is that so? cool

  66. jonas’

    because 10 kiB is the minimum stanza limit defined in RFC 6120

  67. jonas’

    not that anyone enforces that

  68. jonas’

    I mean your average PEP-based avatar is way above that already

  69. jonas’

    s/ki/k/

  70. jonas’

    so my comment is pretty useless, but alludes to a general issue: there should be a limit or (cross-stanza) chunking (which then sounds awfully like sending stanzas via JET-encrypted IBB)

  71. Zash

    Anyone got stats on avatar sizes?

  72. jonas’

    Zash, I have for MUCs ;)

  73. jonas’

    (or, could have. I downscale)

  74. jonas’

    (or, could have. I scale them down on ingestion)

  75. jonas’

    Syndace, actually, how about implementing FSE as JET-encrypted IBB?

  76. Syndace

    I don't XMPP, what is IBB xD Heard of JET at least

  77. jonas’

    In-Band Bytestreams

  78. Syndace

    uh huh

  79. jonas’

    https://xmpp.org/extensions/xep-0047.html

  80. Syndace

    "sessions" looks like it's synchronous/requires both parties to be online

  81. jonas’

    ahh, right

  82. jonas’

    that’s gonna be a deal-breaker

  83. jonas’

    would’ve been fun tho

  84. jonas’

    so you need to either specify some kind of chunking (then the question: how to deal with missing chunks? see the vulnerabilities in IP fragmentation implementations to get an idea of why this question is important and non-trivial) or set an upper limit which is sane

  85. Syndace

    chunking is a big nope from my side

  86. Syndace

    so much complexity for such an edge case

  87. lovetox

    xmpp.net server test is soooooo slow

  88. Syndace

    servers are already encouraged to do stanza-too-big stuff

  89. jonas’

    Syndace, so we end up with Path-MTU discovery in XMPP :D

  90. jonas’

    lovely

  91. jonas’

    it is amazing how problems replicate on each layer of the stack

  92. lovetox

    it cant even take my request to check a new server

  93. moparisthebest

    I'm about 98% sure all clients would crash and burn if a server sent them too big of a stanza

  94. Syndace

    yeaj

  95. moparisthebest

    for some definition of too big

  96. Syndace

    yeah

  97. jonas’

    when I started aioxmpp, I asked, and people told me to trust the server on that one.

  98. jonas’

    and I think that’s a sane way to look at it

  99. jonas’

    obviously it shouldn’t allow you to RCE, and you may handle it more gracefully than OOMing, but what are you gonna do?

  100. moparisthebest

    *maybe*, but RFC-wise does anything really stop a server from just streaming stanzas around?

  101. Syndace

    I'm not sure that's on us to solve

  102. Link Mauve

    lovetox, it throttles a lot in order not to take down any server, no matter how underpowered it is.

  103. moparisthebest

    once you have who the stanza is addressed to, you don't really *need* to buffer it in memory anymore as a server right?

  104. moparisthebest

    just read a bit and send it right out the other end

  105. jonas’

    moparisthebest, you still need to do buffering to synchronise when multiple entities want to same to the same entity at the same time

  106. moparisthebest

    I suspect no servers in the wild are written this way, but they could be

  107. jonas’

    you also have to reject stanzas which are invalid XML

  108. jonas’

    (as per a MUST in RFC 6120)

  109. jonas’

    so you have to at least de- and re-serialise them

  110. moparisthebest

    hmm, well that does imply buffering entire stanzas then

  111. jonas’

    (of course, you can do this by simply streaming SAX events around, no need to build the full tree)

  112. jonas’

    ah yeah, you have to at least keep a copy

  113. lovetox

    damn xmpp.net server test cant do direct tls test ..

  114. lovetox

    can somebody test direct tls on movim.eu

  115. jonas’

    correct

  116. jonas’

    "test"?

  117. lovetox

    it does send invalid tls handshake for me, and i want to find out if thats my lib or a problem on the server

  118. jonas’

    s2s, c2s?

  119. lovetox

    c2s

  120. moparisthebest

    does it listen on 443? if so you can test the TLS bit with ssllabs.com

  121. lovetox

    no

  122. lovetox

    149.210.220.39:5223

  123. lovetox

    thats the address

  124. jonas’

    2020/03/10 18:58:09 failed to probe c2s to xmpp:movim.eu: tls: first record does not look like a TLS handshake

  125. jonas’

    lovetox, ^

  126. jonas’

    my blackbox exporter agrees

  127. jonas’

    openssl s_client agrees, too: 139993024365760:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../ssl/record/ssl3_record.c:331:

  128. jonas’

    yeah, that’s plain XMPP

  129. moparisthebest

    you can also do https://nl.movim.eu:5223/

  130. jonas’

    sending anything with ncat gives me a not-well-formed XMPP steram error

  131. jonas’

    do http:// instead

  132. moparisthebest

    won't let me, HSTS ?

  133. jonas’

    pity

  134. jonas’

    then use ncat :)

  135. moparisthebest

    but yes, mostly that works too :)

  136. jonas’

    it’s a plaintext XMPP port, not direct TLS

  137. moparisthebest

    yep that record is wrong, dino will likely fail to connect ever too

  138. moparisthebest

    (yet another reason TCP connect success should NOT be a criteria for not falling back to next SRV record)

  139. lovetox

    yes moparisthebest a user reported this today

  140. lovetox

    and now he cant connect, because i dont try the others ^

  141. moparisthebest

    who's responsible for movim.eu ? edhelas ?

  142. lovetox

    yeah i notified him

  143. lovetox

    but see moparisthebest nobody would find that error

  144. lovetox

    its a thin line to walk

  145. moparisthebest

    well, user would probably have preferred to just be connected though

  146. lovetox

    you dont want to shadow all errors, and you dont want to make your users mad

  147. moparisthebest

    you could maybe report connection errors anyway?

  148. lovetox

    yes, i agree in this case user wants to connect and does not care

  149. moparisthebest

    "hey we failed to connect to X so now we are connecting to Y" or something

  150. moparisthebest

    you won't hear any "UX is easy" arguments from me :)

  151. jonas’

    lovetox, it’s the operators responsibility to monitor

  152. jonas’

    the tools are there

  153. moparisthebest

    10 day TTL on that SRV record, so the fix needs to be make that a direct TLS port, not remove the SRV

  154. jonas’

    the first error I showed you is from a tool to monitor c2s/s2s connectivity on both direct TLS and STARTTLS. it can even do XMPP pings if you give it credentials. it’ll also check whether expected SASL mechanisms are there.

  155. jonas’

    hm

  156. jonas’

    maybe I should take the search.jabber.network domain corpus and scan all the SRV endpoints and notify operators about failures.

  157. jonas’

    or at least the corpus of domains affiliated with the top 100 or so rooms

  158. moparisthebest

    I was going to say, a tool is good, but you need another off-network server to be able to run it on for it to be real useful most of the time, not all admins have that I guess

  159. jonas’

    moparisthebest, not really

  160. jonas’

    most of the time, failures discovered by monitoring from the outside are not something you can fix either way

  161. moparisthebest

    if you only have 1 server, running the tool and xmpp server on the same machine isn't ideal

  162. jonas’

    it’s not ideal, but it would definitely have caught this problem

  163. moparisthebest

    certainly better than *nothing*, and yes

  164. jonas’

    it will also catch the issue when the server runs OOM

  165. jonas’

    and crashes

  166. jonas’

    it will catch most of the things you can fix locally

  167. jonas’

    it won’t catch when the entire box goes down, but chances are you’ll notice that either way

  168. jonas’

    (and you can ping-probe the up-ness of the box cheaply from the outside)

  169. jonas’

    also, maybe I should start offering XMPP probes to others. it’s cheap for me to do, sending emails on problems is cheap too

  170. moparisthebest

    on my giant todo list is still such a tool/service but also checking things like "is alpn required" and such

  171. jonas’

    moparisthebest, feel free to include basic checks in this: https://github.com/horazont/prometheus-xmpp-blackbox-exporter

  172. moparisthebest

    "is SNI required" as well, similar to ssllabs

  173. jonas’

    "is X required" kind of stuff isn’t interesting for continuous monitoring though

  174. jonas’

    (oftentimes)

  175. moparisthebest

    yep I agree, it's pretty helpful when setting up though

  176. jonas’

    true

  177. jonas’

    extending/rewriting xmpp.net would be the target for this type of efforts

  178. jonas’

    > I honestly don’t see the point in proving to the other side that you can do regular expressions on the user input. ahahaha

  179. jonas’

    > I honestly don’t see the point in proving to the other side that you can do regular expressions on the user input. ahahaha

  180. jonas’

    love that wording