jdev - 2023-11-04


  1. moparisthebest

    Another p2p contender enters the ring https://unsigned.io/website/sideband/ > It does not need a connection to a server

  2. moparisthebest

    But wait, what's this: > LXM Propagation Nodes offer a way to store and forward messages to users or endpoints that are not directly reachable at the time of message emission. Propagation Nodes can also provide infrastructure for distributed bulletin, news or discussion boards. Oh no! 🤣

  3. moparisthebest

    XMPP might be the only P2P network honest enough to call servers servers?

  4. edhelas

    > But wait, what's this: > > LXM Propagation Nodes offer a way to store and forward messages to users or endpoints that are not directly reachable at the time of message emission. Propagation Nodes can also provide infrastructure for distributed bulletin, news or discussion boards. > Oh no! 🤣 Laught in Pubsub

  5. MSavoritias (fae,ve)

    That sounds like a worse version of briar's mailbox. Which is itself a worse version of gnunet's way of store and forward. Oh well

  6. jonas’

    moparisthebest, the answer to the "what's this" is "marketing!"

  7. Zash

    > They are tricky and have been the source of countless security bugs that could have been entirely avoided with framing Objection. Hyperbole.

  8. moparisthebest

    Do you want a list of vulns or :)

  9. moparisthebest

    https://bugs.chromium.org/p/project-zero/issues/detail?id=2254 is the most recent that comes to mind

  10. moparisthebest

    Prosody running out of memory on unlimited length stanzas is another

  11. Zash

    Countless == 2? Now how many off-by-one and buffer over/underflow bugs have there been?

  12. moparisthebest

    You'd have both though, the belt and suspenders approach

  13. Zash

    There will be bugs either way.

  14. moparisthebest

    You'd have a buffer that's supposed to have exactly 1 stanza in it, then you check with your XML parser

  15. moparisthebest

    If it's not exactly 1 without leading or trailing bytes, bail out

  16. lovetox

    the biggest advantage is the simplicity of writing a client

  17. lovetox

    or a library

  18. lovetox

    it would then be on the same level as parsing a json payload

  19. moparisthebest

    Have any such bugs happened in websocket implementations which have framing?

  20. lovetox

    about what bug exactly are you talking? buffer overflow with websocket? i bet no client will write its websocket lib itself, the same as nobody starts to write a http lib

  21. moparisthebest

    Or confusing 1 stanza for 2

  22. lovetox

    is channelbinding data also available on websocket connections?

  23. Zash

    In theory yes. In practice web browsers won't let you access that.

  24. moparisthebest

    But for non browser clients it'd work

  25. lovetox

    ok but Gajim has nothing to do with a browser

  26. Zash

    Then it's no different than a regular XMPP TLS connection

  27. lovetox

    ok so it makes sense to add a feature request with my websocket lib

  28. Zash

    For browsers I think it may be possible to use the certificate hash one (server-end-point) if the client is supported by an addon that extracts that via https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/CertificateInfo

  29. singpolyma

    > about what bug exactly are you talking? buffer overflow with websocket? i bet no client will write its websocket lib itself, the same as nobody starts to write a http lib Should generally be the same with low level xmpp ideally

  30. moparisthebest

    It's not though because no off the shelf XML library is suitable for XMPP

  31. singpolyma

    Uhm, not true?

  32. singpolyma

    Almost all of them have event parsing mode

  33. singpolyma

    But even if it were true an xmpp library should have a solution already 🙂

  34. moparisthebest

    And almost all of them support not-XMPP XML with vulns

  35. cockroach

    hi there! I've been wondering: I'm using libstrophe for a small XMPP application that I'm writing and I'm trying to add a handler for message stanzas with *NO* type. has anyone done such a thing? or will I have to determine the message type in the handler itself and then decice what to do?

  36. singpolyma

    cockroach: message stanzas always have a type

  37. singpolyma

    If there is no type attribute it defaults to "normal"

  38. cockroach

    Syndace: RFC 6121 says the type attribute is optional

  39. cockroach

    but yes, it defaults to 'normal'

  40. cockroach

    singpolyma: sorry, I meant you

  41. singpolyma

    Yes. So no such thing as a message stanza with no type

  42. cockroach

    singpolyma: I'm not sure about that. The RFC says "Inclusion of the 'type' attribute is RECOMMENDED"

  43. singpolyma

    Yes. And if it's not present then it defaults to normal

  44. singpolyma

    So if you mean "message stanza which on the wire happened to have no type attribute" then look for type is normal

  45. cockroach

    indeed. but wouldn't that mean then I can very well get a message without the type and will then have to treat it as 'normal'?

  46. singpolyma

    Without a type attribute. Not without a type

  47. cockroach

    exactly. but libstrophe doesn't do that - if it comes without a type, the 'normal' handler won't catch it.

  48. cockroach

    right

  49. cockroach

    without a type attribute

  50. singpolyma

    Then libstrophe is broken and you should file a bug

  51. cockroach

    rgr

  52. singpolyma

    If there is no type attribute on the wire then the type is normal and the normal handler should definitely fire

  53. cockroach

    thanks for clarifying this

  54. lovetox

    is there a recovery for presence subscriptions when i lose my server and have to start new?

  55. lovetox

    the remote server would not know that i lost my database, and will send me presence from people which i was subscribed

  56. jonas’

    to which your server will reply "unsubscribed" so that the remote server stops doing that

  57. lovetox

    but they are now not anymore in my roster, so i basically receive presence from unknown contacts

  58. jonas’

    which is basically "you're screwed"

  59. lovetox

    no i receive those presences

  60. lovetox

    why would a server reply "unsubscribed"?

  61. lovetox

    to a normal presence

  62. pep.

    If you prepare it in advance you can probably remedy to that by not sending unsubscribed and subscribing to them automatically, for some time :x (keeping an eye on spam requests)

  63. jonas’

    lovetox, hm, indeed, the server should not reply unsubscribed, I had that wrong.

  64. pep.

    If you prepare it in advance you can probably remedy to that by subscribing to them automatically, for some time :x (keeping an eye on spam requests)

  65. lovetox

    i see this in my console, i get presence from all the contacts i had earlier in my roster, i am just interested as a client dev, what should i do with this, is there a way to gracefully recover somehow

  66. jonas’

    if you receive unsolicited presence, that's normally "directed presence"

  67. jonas’

    and shouldn't lead to automatic presence subscriptions

  68. jonas’

    but in your specific case you probably want to collect those over a few days and then send out subscriptions

  69. pep.

    https://modules.prosody.im/mod_unsubscriber.html something like the opposite of this :)

  70. pep.

    In spirit. I don't know if the code helps here

  71. lovetox

    or i simply show the user somehow, hey you received presence but this contact is not in your roster, would you like to add them

  72. jonas’

    lovetox, I'd probably do that only if (a) the user has a very low amount of entries in their roster && (b) more than one non-contact does this in a certain amount of time.

  73. jonas’

    and (c) ensure that this is not focus-stealing or anything, because otherwsie it's a great abuse vector

  74. lovetox

    yeah, previously we simply showed such contacts in the roster in a group "not in roster"

  75. jonas’

    lovetox, and then you can just send out type="subscribe" and type="subscribed" presences to that contact. if they still have you in their roster, their server will auto-reply with type="subscribed", otherwise they'll see a subscription request.

  76. jonas’

    though type="subscribed" is not sufficient to fully restore the state; this will cause a pre-approval instaed of actually registering a subscription :|

  77. lovetox

    ok now another weird issue i see

  78. lovetox

    when i quit the client, i send unavailable presence out before to MUCs

  79. lovetox

    basically im leaving the MUC

  80. lovetox

    this presence, is reflected normally, but i dont receive it anymore because i break the connection before.

  81. jonas’

    why are you explicitly leaving the MUC?

  82. jonas’

    that sounds superfluous

  83. lovetox

    im not sure about the details but it should not matter

  84. lovetox

    if i reconnect to the server, *without stream resumption*, ejabberd sends me this unavailable presence as the first stanza after bind

  85. jonas’

    that sounds like some ejabberd quirk then

  86. jonas’

    I mean it can happen if the MUC takes _that_ long to send that unavailable presence out

  87. lovetox

    yeah but presences are not stored for later delivery or? its not a message

  88. jonas’

    but if it happens consistently even if you are offline for a longer period (say, minutes), it shouldn't.

  89. jonas’

    exactly

  90. lovetox

    no i just tested, i quit the client, wait 10 full seconds

  91. jonas’

    but aside, don't send explict type="unavailable" to mucs on connection shutdown. your server will take care of hat.

  92. lovetox

    reconnect, i still get the presence

  93. jonas’

    but aside, don't send explict type="unavailable" to mucs on connection shutdown. your server will take care of that.

  94. jonas’

    lovetox, I'd take that one up with the ejabberd devs honestly.

  95. lovetox

    hm my info was wrong with me sending precences, it happens when i kill the app, so nothing is sent out on quit

  96. lovetox

    but then its even more weird that the MUC sends me unavailable

  97. jonas’

    lovetox, are you using the same resource string as before?

  98. jonas’

    and are you negotiation stream management?

  99. jonas’

    (even if you don't resume)

  100. pep.

    Shouldn't the server send unavailable presence to everything you're sent a direct presence to, when you become unavailable? (Re MUC)

  101. jonas’

    (yes)

  102. pep.

    Shouldn't the server send unavailable presence to everything you've sent a direct presence to, when you become unavailable? (Re MUC)

  103. jonas’

    lovetox, if the answer to both questions is "yes", then what happens is this: - you kill the app (no proper </stream:stream> sent from the app) - the server assumes you got disconnected from the network and keeps your session around (because you negotiated stream management) - you reconnect without resuming, but binding to the same resource. the server now assumes that you don't have the SM data to resume (correctly), and has to send unavailable presence from your previous session before letting you establish the new session with the same resource. - the MUC receives the type="unavailable" resulting from the termination of the previous session and reflects that type="unavailable" correctly. - you receive that type="unavailable" because it is received by the server from the MUC after replacing your session

  104. lovetox

    ah nice, so then it makes sense

  105. lovetox

    i didnt know about the unavailable thing when i bind to the same resource, which is the case