XSF Discussion - 2023-06-18


  1. edhelas

    Hi everyone, small topic regarding PEP and Pubsub node configurations.

  2. edhelas

    It seems that Movim didn't configured properly some PEP nodes while publishing things, linked with that ejabberd bug https://github.com/processone/ejabberd/issues/3044

  3. edhelas

    One of the way that I'm pushing to prevent that is to ensure server side that some of the PEP nodes have a fixed configuration, see https://github.com/movim/movim/wiki/Configure%20ejabberd#enforce-pubsub-configuration

  4. edhelas

    I have the feeling that trusting XMPP clients to configure each time correctly the nodes when publishing is kind of an illusion, you can have bugs, you can have "bad clients" etc...

  5. edhelas

    Wouldn't be wise to push those kind of "fixed server configuration", at least for all the config options that are defined as MUST in the XEPs ?

  6. pep.

    Fix clients and you wouldn't have these issues

  7. pep.

    Fix clients and you won't have these issues

  8. pep.

    Enforcing stuff at the deployment level will just contribute to hiding issues like this

    👍️ 1
  9. jonas’

    pep., as much as I like fixing clients, I deem enforcing this on the deployment level as a necessary defense-in-depth.

  10. jonas’

    publishing user bookmarks, for instance, because of a typo is Not Great.

  11. Zash

    we've considered and rejected this in prosody before

  12. jonas’

    and if servers protect against that (either by overriding defaults of the bookmark node _or_ by rejecting attempts to publish with access_model open), I very much elcome tat

  13. jonas’

    and if servers protect against that (either by overriding defaults of the bookmark node _or_ by rejecting attempts to publish with access_model open), I very much welcome that

  14. pep.

    jonas’: does that prevent fixing clients though

  15. jonas’

    I don't think it does :)

  16. edhelas

    > Enforcing stuff at the deployment level will just contribute to hiding issues like this I'm fine rejecting the configuration with an "error" if it doesn't fit, at least the client knows, and it's perfectly "pubsub compatible".

  17. edhelas

    Good and working clients will be OK, "bad clients" will have an error and can then know directly what to fix.

  18. MattJ

    The server can't protect against typos, e.g. in the node name

  19. edhelas

    XEPs MUST options are respected, and server admins will not be afraid to have "bad clients" misconfiguring nodes for some of their users.

  20. edhelas

    Everyone is happy and we can then fix our clients to make them fully compliants.

  21. edhelas

    You never know which weird client your users will use in the end.

  22. jonas’

    MattJ, arguably, node name typos are more easily discovered than access model typos

  23. jonas’

    you notice the former right away when doing interop testing with other clients

  24. jonas’

    the latter you only notice when someone finds bookmark notifications in their XML logs.

  25. MattJ

    It feels like it's shifting the responsibility to the server to protect an arbitrary and unbounded list of node names that are supposed to be opaque

  26. MattJ

    More sensible IMHO would be to e.g. default all PEP nodes to private by default, and require explicit configuration to make them open

  27. MattJ

    That might (almost certainly would) break a bunch of existing clients

  28. MattJ

    But I'd feel more comfortable with an arbitrary list of nodes we know should be open by default

  29. MattJ

    And update all those XEPs to require the client to include publish-options in the future

  30. edhelas

    Can be a solution yes

  31. edhelas

    Knowing that its a bit more than the access_model and publish_model

  32. edhelas

    But also the max_items and the item persistence

  33. MattJ

    Clients should configure it

  34. MattJ

    If they don't, they are already broken

  35. MattJ

    Hacky workarounds on the server are not the solution, especially if privacy/security is not at stake

  36. Zash

    And hardcoded lists in the server will get outdated since it's clients that know what nodes they use.

  37. MattJ

    ejabberd intentionally broke OMEMO for years by overriding PEP configuration

  38. MattJ

    I don't want to get into the game of intentionally or accidentally enforcing configuration that is supposed to be controlled by clients

  39. MattJ

    When the client publishes stuff, it knows what it is publishing and what the intended configuration for that data is

  40. MattJ

    The server does not know, and matching on node name is a hack

  41. MattJ

    If a XEP namespace gets bumped or whatever, everything breaks until all the servers update

  42. edhelas

    That's also why the PEP nodes have versions bookmarks:1

  43. MattJ

    It's very different to just "private by default" which is a sensible policy

  44. Zash

    or a new cool XEP is published, but since everyone is running the most ancient Ubuntu they don't get the new list for 5 years

  45. edhelas

    If you change the default node config, you bump the version

  46. Zash

    or a new cool XEP is published, clients rush to implement and deploy, but since everyone is running the most ancient Ubuntu they don't get the new list for 5 years

  47. MattJ

    Maybe we should just make publish-options mandatory

    👍️ 2
  48. MattJ

    At least for initial publishes

  49. Zash

    Maybe we should

  50. Zash

    and access model a required option that can't be left out

  51. MattJ

    For backwards compatibility I can then see us having a list of default configurations for existing widespread PEP node names

  52. MattJ

    But with the intention of deprecating that eventually

  53. Trung like private by default.

  54. edhelas

    > /me like private by default. I like it as well

  55. MattJ

    I'll try and draft some XEP PRs this week

  56. lovetox

    why does it need a XEP? Its simply a server config to define a default node configuration or not?

  57. Kev

    No, because 163 requires "presence" as the default.

  58. MattJ

    The core proposal would be to 1) have every XEP that uses PEP declare the recommended node configuration, and 2) make publish-options mandatory (at least a SHOULD) everywhere we reasonably can (that means at least all new PEP-based XEPs)

  59. MattJ

    And I would add text about this to the existing informational XEPs, at least

  60. Kev

    I don't really understand publish-options, as it seems to enforce a weird flow on the client, but it's where we are, so that seems sensible enough.

  61. lovetox

    what do you find weird about ? i tell the server what i want, it tells me this does not reflect whats actually is there, and then i go into a node config flow

  62. MattJ

    I agree it's an awkward flow (in the failure case), but it's a very common pattern (check-and-set) in distributed systems

  63. MattJ

    lovetox: one awkward thing is that if you simply do that, two clients can fight over the configuration in a loop

  64. Kev

    It opens you up to all sorts of fun race conditions that there's just no reason for.

  65. Zash

    xyrrset !

  66. MattJ

    I've not seen that happen so far, but I consider that mostly luck

  67. Kev

    <Client> Please publish with these options <Server> But those aren't the options I've got set <Client> ... <Client> Please set these options <Server> Certainly, Ma'am. <Client> Please publish with these options <Server> Okeydokey, no problem

  68. Kev

    Compare with <Client> Please publish with these options <Server> Ok, I'll set those options and then publish

  69. MattJ

    Okay, so you think it should overwrite the configuration instead of failing

  70. Zash

    But then you get no indication that two clients are flipping settings back and forth

  71. Zash

    Like the disagreement on whether OMEMO stuff should be public or presence

  72. Kev

    > Okay, so you think it should overwrite the configuration instead of failing I have no problem with publish-options having a flag saying "fail" or "change", if people have a need for failing instead, but I suspect that the standard client behaviour is to just blindly do the change as in my tongue-in-cheek exchange above, and in that case the server may as well have done it.

  73. Kev

    > But then you get no indication that two clients are flipping settings back and forth You don't anyway, because the clients are (most likely) going to just silently reconfigure the node and you'll have the same flap, but with more stanzas.

  74. lovetox

    yeah sure a overwrite flag is nice, but does not spare a client to implement the failure flow

  75. jonas’

    so you have an indication; in your data usage.

  76. lovetox

    so not really a gain

  77. Zash

    Wait none of this protects against a bad client that sets bad settings

  78. lovetox

    > lovetox: one awkward thing is that if you simply do that, two clients can fight over the configuration in a loop

  79. lovetox

    thats a spec issue

  80. jonas’

    what would be a solution to that issue?

  81. lovetox

    and probably a client developer experience issue

  82. jonas’

    I fail to come up with good ideas

  83. lovetox

    writing a good spec?

  84. lovetox

    if you say, hey max items in a node is undefined i leave this to whatever developers need

  85. lovetox

    yeah bad spec will lead to config fights

  86. lovetox

    should never get published into a spec ..

  87. jonas’

    lovetox, nevermind max items. how would a better flow look like for things like access_model on bookmark nodes?

  88. lovetox

    thats why for bookmarks we invented "max" setting :)

  89. lovetox

    jonas’, i never said the current flow is bad, so i dont have solutions for things where i see no problem

  90. lovetox

    you may ask the ones that think its bad

  91. pep.

    So we've moved away from "we should fix faulty clients" :p

  92. lovetox

    im not sure what the problem is, you found one more thing a client devleoper has to care about or otherwise privacy of the user is at risk

  93. lovetox

    is it possible with pubsub to discover open nodes on a contact?

  94. MattJ

    Yes

  95. lovetox

    funny info i just received, about security labels, seems there are at least 2 government agencies who use Gajim and depend on the security labels support

  96. mjk

    remove immediately and offer paid support!

  97. lovetox

    but .. then its like a job ... beside my other job

  98. Zash

    it wasn't already? :)

  99. lovetox

    until now its a relaxing freetime hobby

  100. mjk

    right... also, hard to make a living only offering support for a minor XEP

  101. Kev

    Feel free to remove it and send them to Isode ;p