XSF Discussion - 2021-04-14


  1. moparisthebest

    when confronted with a too-big stanza as a server, what would the implications be if the server just silently dropped the stanza and carried on instead of terminating the stream with an error ?

  2. moparisthebest

    maybe this answer is different for s2s vs c2s

  3. jonas’

    moparisthebest, if it can do that, it should instead bounce the stanza properly

  4. jonas’

    then there are no (new) implications, beyond what you already get when servers make decisions about which stanzas to deliver

  5. moparisthebest

    what if it can drop it, but can't parse it

  6. jonas’

    unlikely, I think

  7. jonas’

    to bounce a stanza, you only need the startElement SAX event

  8. jonas’

    (or equivalent)

  9. jonas’

    I think you already need that + endElement + magic to determine the stanza boundaries anyway

  10. jonas’

    I guess dropping would be similar to s2s-closing (without stream management), so there’s not much of a difference there, except that deliverability of other stanzas will be improved (as they don’t get lost in s2s TCP buffers when the stream is killed)

  11. moparisthebest

    I'm determining stanza boundaries by counting tags and don't have an XML parser

  12. jonas’

    how are you counting tags?

  13. jonas’

    (to count tags, you already need something like an XML parser ;))

  14. jonas’

    enough of an XML parser to add only a shim layer to extract the attributes out of the tags anyway

  15. jonas’

    enough of an XML parser to add only a shim layer to extract the attributes out of the attributes needed for bouncing anyway

  16. moparisthebest

    roughly, incrementing on < and decrementing on /> or </ so a stanza boundary is when the counter hits 0

  17. jonas’

    <![CDATA[ < ]]>?

  18. moparisthebest

    hopefully no one sends that :D seems to have worked so far

  19. jonas’

    it is valid though

  20. jonas’

    and: what stops you from catching the slice from the first < to the first > and parsing that as attributes? you can drop all namespace-related stuff as that’s not needed on stanzas anyway, just plain key/value

  21. moparisthebest

    hrm maybe, so you think that'd be valid? sending an error response on too-big-stanzas and just skipping them otherwise? but not terminating the stream?

  22. jonas’

    yes

  23. jonas’

    <policy-violation/> would be an appropriate stanza error I think

  24. jonas’

    or maybe <resource-constraint/>

  25. jonas’

    https://tools.ietf.org/html/rfc6120#section-4.9.3.14

  26. jonas’

    look at that, policy-violation has stanza size limit as an example

  27. jonas’

    oh, that’s the stream error, sorry

  28. moparisthebest

    antranigv in this MUC has an avatar that makes a stanza bigger than 262,144 bytes for instance

  29. jonas’

    but I think the stanza error is as valid

  30. jonas’

    and bouncing individual stanzas with whatever errors you feel like is the right of a server; clients need to cope with that

  31. jonas’

    dropping on the other hand is tricky because it may be seen as violation of the "MUST reply to IQ requests" clause of RFC 6120

  32. flow

    > moparisthebest> antranigv in this MUC has an avatar that makes a stanza bigger than 262,144 bytes for instance One of the reasons that make me believe that servers should be very conservative about the sizes of stanzas they accept. Someting in the range of 10 KiB to 64 KiB seems appropriate

  33. flow

    I also think that with larger stanza sizes you get easily into scheduling issues, as in, a single stanza can dominate the link while it is transferred

  34. flow

    This is turn means, that you should probably bounce to big stanzas at the first hop, and close the stream on all following hops as soon as the limit is reached

  35. flow

    This is turn means, that you should probably bounce too big stanzas at the first hop, and close the stream on all following hops as soon as the limit is reached

  36. jonas’

    good point about hogging the link

  37. flow

    Unfortunately, I believe that the major parts of the ecosystem would break if we do that

  38. flow

    But I really hope that we get the ecosystem towards a reasonable sized stanza limit in the future

  39. flow

    Of course, this requires, things like RSM on disco#(info|item) responses

  40. flow

    Of course, this requires things like RSM on disco#(info|item) responses

  41. jonas’

    servers already do that :(

  42. dwd

    I wonder if MAM-like responses on disco might make more sense. Or additional sense.

  43. jonas’

    ;)

  44. flow

    Furthermore, if we talk about techniques that split large content into multiple stanzas, then we have to be aware that it's not easy for the generating entity to assess the resulting stanza size

  45. jonas’

    just found this https://github.com/horazont/muchopper/commit/7affc581a8539eebc190371d95539bed1fb8bd7c#diff-6d5dca6e6e9b9db00d48d0bb6b748f7302f6b941e4bcee48427a54ff74122c46R48

  46. jonas’

    just found this https://github.com/horazont/muchopper/commit/7affc581a8539eebc190371d95539bed1fb8bd7c#diff-6d5dca6e6e9b9db00d48d0bb6b748f7302f6b941e4bcee48427a54ff74122c46R53-R59

  47. flow

    But probably a pramgatic approach like, "aim for 10KiB stanzas, but limit at 32KiB" is good enough here

  48. flow

    jonas’, is https://github.com/horazont/muchopper/commit/7affc581a8539eebc190371d95539bed1fb8bd7c#diff-6d5dca6e6e9b9db00d48d0bb6b748f7302f6b941e4bcee48427a54ff74122c46R53 fixed today?

  49. jonas’

    I did not check again since that commit

  50. moparisthebest

    it's ok I'm 99% sure I found an ejabberd bug while looking at this too, are `<features xmlns="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required/></starttls></features>` and `<stream:features><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required/></starttls></stream:features>` the same or not?

  51. moparisthebest

    prosody, dino, gajim, and conversations are ok with either, ejabberd requires the second

  52. jonas’

    they are the same in XML 1.0 with Namespaces

  53. jonas’

    but yeah, ejabberd is picky

  54. moparisthebest

    odd failure mode too, it just hangs for 90 seconds and then sends `<stream:error><connection-timeout xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>Idle connection</text></stream:error>` and hangs up

  55. jonas’

    yep, probably the parser doesn’t read it as belonging to the stream namespace and then drops it

  56. jonas’

    moparisthebest, but note the interop note in https://tools.ietf.org/html/rfc6120#section-4.8.5

  57. jonas’

    > Implementations are advised that using a prefix other than 'stream' for the stream namespace might result in interoperability problems.

  58. moparisthebest

    ah, nice

  59. flow

    moparisthebest, sounds like you have a new(?) project, what is it? :)

  60. moparisthebest

    flow, reverse proxy https://github.com/moparisthebest/xmpp-proxy still super early, just started dogfooding it on my server recently :)

  61. flow

    moparisthebest, so you are competing with dwd now? :)

  62. dwd

    Competition always welcome.

  63. dwd

    Especially as I've not had any time for Metre recently.

  64. jonas’

    I think metre doesn’t do c2s, does it?

  65. dwd

    It does not, no.

  66. dwd

    Going to go out on a limb and suggest that xmpp-proxy doesn't do S2S, it's just a connection proxy, too.

  67. moparisthebest

    https://github.com/surevine/Metre ? quite a bit different I guess

  68. moparisthebest

    xmpp-proxy does c2s and s2s, and multiplexes both along with starttls + direct tls all on the same port(s), but also limits stanza sizes

  69. dwd

    But inbound only if I follow this right?

  70. moparisthebest

    correct, inbound only, and provides TLS

  71. dwd

    And that StanzaFilter looks scary. :-)

  72. Kev

    How does it cope with presenting the client cert to the server?

  73. Kev

    Or is there a ‘I have verified trust, just do external’ flag being passed to the server-proper somehow?

  74. dwd

    Kev, Yeah, doesn't seem to be any support for that.

  75. Kev

    Probably more applicable to C2S where client certs are uncommon than to S2S then, I guess?

  76. moparisthebest

    no support for client cert auth, server just trusts connections from it is encrypted implicitly (also for the PROXY header)

  77. Kev

    Although I guess it probably gets in the way of -PLUS too?

  78. dwd

    It'd break channel bindings, yes. Also I think the start-tls handling makes me cry.

  79. moparisthebest

    yes I agree the StanzaFilter is scary haha

  80. moparisthebest

    these are all correct reactions I think

  81. Kev

    I keep getting tempted to write one of these for M-Link, but I keep deciding it needs to be more than a naive proxy because of the interactions between TLS and auth.

  82. Kev

    (Also because I’d like to use it as a mechanism for seamless upgrades).

  83. moparisthebest

    (personal opinion for my use-cases only incoming) interactions between TLS and auth are dead, let them lie

  84. dwd

    Funnily enough, I thought about adapting the Metre code into an Openfire C2S connection manager.

  85. dwd

    moparisthebest, I think that's not true given channel bindings especially.

  86. moparisthebest

    do they work with TLS 1.3 yet ?

  87. Kev

    moparisthebest: You might not like channel binding, but surely you’re not opposed to S2S strong auth?

  88. dwd

    moparisthebest, Thanks to Sam, yes.

  89. moparisthebest

    will they work with QUIC

  90. dwd

    moparisthebest, Your xmpp-proxy doesn't work with QUIC, so somewhat irrelevant, but I think they should given they're simply based on an exported key.

  91. moparisthebest

    unfortunately if the web doesn't use them, we can't rely on them being supported anywhere

  92. dwd

    moparisthebest, Except key exports *are* used and seem well supported, so Sam's approach seems much more likely to be generally available.

  93. moparisthebest

    and QUIC is the future so I wouldn't call it irrelevant, still a hair early though, we'll see

  94. dwd

    moparisthebest, Sure. I expect we'll have XMPP over QUIC at some point. But I don't think key exporting is affected by QUIC versus TLS/TCP, so everything should "just work".

  95. dwd

    moparisthebest, Obviously there's very much a place for xmpp-proxy as a bridge to uplift existing servers and services with QUIC etc support though.

  96. jonas’

    moparisthebest, so that effectively forces use of dialback? or what?

  97. dwd

    moparisthebest, I think your StanzaFilter works for idiomatic XMPP XML, but I'm not entirely sure it'll work correctly in some edge cases. I suspect if I'm sufficiently abusive I can at least sneak a closing stream tag past it.

  98. jonas’

    I’ll just say CDATA

  99. dwd

    jonas’, Oh, yeah, good point, that too.

  100. moparisthebest

    also '< stream:stream' and a few other things, probably ok, it accomplishes it's goal

  101. dwd

    moparisthebest, And '<str:stream', and all sorts. Likely it'll work in all non-abusive cases. But yeah, I can get it to terminate the session without the XMPP server thinking its over, and I can get the XMPP server to close it without xmpp-proxy to work. And any server advertising -PLUS basically won't allow auth. Hopefully. But as I say, it'll mostly work and it's a useful tool for a number of cases.

  102. Kev

    dwd: The server needs to know there’s a TLS terminator in the way anyway, so presumably should not present any auth mechs that don’t proxy in any case.

  103. moparisthebest

    yep I agree, it was written in a bit of a hurry for one specific use-case which it accomplishes, I'll elaborate more later, and in the meanwhile think about if it can support CDATA sanely without bringing in an XML parser :/

  104. Kev

    I would be inclined to bring in an XML parser, personally.

  105. Kev

    Well, let me rephrase that.

  106. Kev

    If I wanted this to be generally useful, I would bring in an XML parser.

  107. dwd

    Kev, Oh, I think it *is* generally useful, but possibly limited to testing out deployment strategies you'd then incorporate into server mainline code.

  108. Kev

    If it just needs to meet a use case and it meets it, *shrug*.

  109. moparisthebest

    I only hesitate because historically XML parsers have been known to have worse bugs than "closes connection wrongly sometimes"

  110. Kev

    That is not unfair.

  111. dwd

    moparisthebest, This is true, but I can smell the faint odour of a DoS attack there somewhere.

  112. moparisthebest

    I think yes, but only in terms of killing s2s connections ?

  113. Kev

    Killing S2S is probably less bad than *not* killing S2S

  114. Kev

    (I have no idea if such an issue can present)

  115. flow

    moparisthebest, jxmpp has a XmlSplitter, which probably does something similar to yours. It doess not contain a full blown XML parser, but is a little bit more robust as yoursI think

  116. flow

    I guess what I am trying to say is, that there exists probably a middle ground between having a full blown XML parser and too trivial parsing for things like that

  117. moparisthebest

    flow, thanks, I'll have a look https://github.com/igniterealtime/jxmpp/blob/master/jxmpp-core/src/main/java/org/jxmpp/xml/splitter/XmlSplitter.java

  118. mathieui

    So… it has come to my attention that profanity is essentially using 140-chars ids for every stanza

  119. mathieui

    was there any rationale for not limiting the length of the id attributes? we do cap the size of JID, afair

  120. flow

    mathieui, sadly the length restriction of JID parts is the

  121. flow

    exeception, not the rule

  122. flow

    we do not limit pubsub IDs either

  123. mathieui

    indeed :/

  124. mathieui

    but as far as I understand it, the only properties we want for identifiers is "we can fit something non-guessabled and non-bruteforceable in it, and all the better if we can write some arbitrary data for testing"

  125. mathieui

    but going over 30 or 50 characters seems overkill in every case

  126. jonas’

    https://modules.prosody.im/mod_client_proxy.html would like to have a word with you ;)

  127. flow

    mathieui, yes, I think you are mixing two aspects here: the missing length restriction for many ID things in XMPP *and* the question what a sufficiently long ID is

  128. flow

    that said, 140 chars is way to long

  129. mathieui

    flow: true, but one could influence the other

  130. flow

    not really

  131. flow

    just because a random ID can be shorter, there may be very well use cases for long IDs which carry some semantics

  132. flow

    arguably, this may not be likely for stanza IDs, but very true for e.g. pubsub IDs

  133. flow

    and I am not sure if it isn't true in some case for stanza IDs

  134. flow

    in any way, we should point the profanity guys to https://www.grc.com/haystack.htm

  135. dwd

    Every now and then, I wonder about translation to a UUID in all cases. Mostly for the database efficiency.

  136. edhelas

    dwd +1

  137. Zash

    36 octets for 122(?) bits of entropy feels inefficient, plus they don't help with sort order

  138. dwd

    Yes, you need both a sequential id and a uuid in the database. But cheap to lookup a 128 bit number in an index.

  139. larma

    Also UUIDs can be compressed on wire if octet optimization is what you aim for

  140. jonas’

    something about https://github.com/ulid/spec

  141. dwd

    I mean, if we wer etalking XMPP 2.0, I'd be saying stanza ids are alwasys UUIDv4 and any duplications detected cause immediate session termination.

  142. Kev

    Of course, even a 128bit integer in string form is less than 140 characters :D

  143. Zash

    Profanity with their signed IDs?

  144. mathieui

    the worst part of the profanity thing is that the id is a base64 of some form of humongous uuid in string form

  145. mathieui

    so it’s like thrice the size for no entropy gain

  146. Zash

    Uuid + hmac(key, uuid) IIRC

  147. mathieui

    but why

  148. dwd

    So you can detect forged responses and bounces, I imagine.

  149. Ge0rG

    Except nobody does it.

  150. Ge0rG

    I've looked into that source code before. But then I erased my memories with alcohol.

  151. dwd

    But it seems to me that the most interesting attacks based around forging responses would be based around witnessing an existing outbound and just copying the ID, which isn't affected by whether or not the id is signed.

  152. Ge0rG

    Yeah.

  153. Ge0rG

    IIRC I did a benchmark of "who does the longest message IDs" on my server, and #1 was bifrost, which stuck whole XMPP messages into the ID, for reasons nobody can anticipate, and #2 was profanity

  154. jonas’

    what

  155. edhelas

    time to to XMPP stanza over XMPP messages ids

  156. edhelas

    *do

  157. dwd

    Years ago, a security audit on some stuff I did decided the id space was a side-channel attack. (As were arbitrary XML attributes etc).

  158. dwd

    I mean, it's fair enough, but in cases where that matters you need a protocol break anyway.

  159. mdosch

    https://github.com/profanity-im/profanity/issues/1520

  160. mdosch

    > Our brilliant plan to make Profanity famous among the XMPP community was a huge success. > Profanity became a constant hit for discussions in the community. Everybody was and is talking about its huge IDs. > Now that we have achieved making people aware of Profanitys existence it's time to make them love Profanity. > So let's have shorter IDs.

  161. Zash

    "If you want an answer on the Internet, post the wrong answer first."

  162. edhelas

    the community manager of Profanity Inc. is a genius

  163. edhelas

    i propose that the XSF hire him

  164. DebXWoody

    #1520 \o/ We will be seen by movim :-)

  165. Kev

    Certainly the best issue I’ve read today.

  166. deuill

    Another one for XMPP2

  167. jubalh

    Hi guys

  168. Zash

    👋️

  169. jubalh

    Profanity actually used UUIDs before. We later added an identifier (instance id + barejid) and hashed that together with an uuid and take a base64 from it. The reason for this was that we didn't have any database and we used this to filter messages in MUCs.

  170. Ge0rG

    that sounds like insanity

  171. jubalh

    And yeah I just used a UUID instead of a shorter value to hash together because I was lazy and the XEP didn't forbid it :)

  172. Zash

    The XEP‽

  173. jubalh

    I mean no rfc or XEP said anything (to my knowledge) about the length of an ID

  174. Zash

    Maybe every RFC and XEP should have the text "Use your common sense." somewhere.

  175. mathieui

    jubalh, I am curious though, apart from the hack with the hmac, what is the base64 for?

  176. Ge0rG

    mathieui: because base-16 is not sufficiently inefficient

  177. Ge0rG

    so it needs to be wrapped

  178. jubalh

    Zash: it was not about common sense. It was about having few time and solving an issue quickly ;)

  179. jubalh

    mathieui: I don't remember right now. Maybe it had to do with using barejid or something and the allowed values? Not sure anymore.

  180. jubalh

    I'll read the code in the next days and change that. We also have a DB now so we could actually check in there if we send the message ourselves.

  181. jubalh

    And the part about making Profanity famous is half-true too :) Because I knew (and more people brought it to my attention) pretty long value and devs will notice ;)

  182. Ge0rG

    I noticed.

  183. jubalh

    Hahaha

  184. Ge0rG

    Other people noticed too.

  185. jubalh

    I love you too Ge0rG :)

  186. mathieui

    Ge0rG, you did not complain hard enough!

  187. Ge0rG

    I even spent ~half an hour trying to understand what devil has ridden you for doing it this way

  188. moparisthebest

    > Zash: it was not about common sense. It was about having few time and solving an issue quickly ;) amen brother

  189. Ge0rG

    mathieui: I did, but probably in the wrong place

  190. mathieui

    But having the messages not display in movim because the DB field for the ID is too short was certainly more fun

  191. Zash

    Don't trust remote IDs?

  192. jubalh

    Isn't having a limit length for IDs in the DB even more wrong? :) There is no max length defined AFAIK

  193. moparisthebest

    a way to send messages that only display in certain clients you say mathieui ? nice attack

  194. mathieui

    jubalh, edhelas trusted "common sense", and having an index on a TEXT column is meh

  195. Ge0rG

    also relevant here: https://dev.mysql.com/doc/refman/8.0/en/innodb-limits.html#:~:text=The%20index%20key%20prefix%20length,REDUNDANT%20or%20COMPACT%20row%20format.

  196. jubalh

    i never trust common sense. I have seen all kinds of IDs so our DB doesnt limit it for example. There are some clients that start from 1 and increase their IDs upon each message. If you restart they start from 1 again. I think Pidgin did something funny too (at one point)

  197. mathieui

    jubalh, is it still the case though? (for the increasing onces) I though every client switched to some kind of uuid

  198. Ge0rG

    jubalh: yeah, that was funny.

  199. Ge0rG

    mathieui: BWAHAHAHA

  200. Ge0rG

    sorry.

  201. mathieui

    let me dream Ge0rG

  202. mathieui

    you evil man

  203. Zash

    Why did I even click a link to MySQL docs‽

  204. jubalh

    mathieui: I'm not sure. I just remember seeing it. And I think Profanity was using the increasing IDs too. And one of my first contributions was to switch it to UUIDs if I remember correctly.

  205. Ge0rG

    there was a "nice" bug in bifröst, where its xmpp backend de-duplicated stanzas based on their ID, and presence stanzas that didn't have an ID got into the same deduplication slot and were dropped

  206. Ge0rG

    smack will use $random_prfix-$autoincrement

  207. Kev

    ids do have a max length, BTW.

  208. Zash

    Kev, ~10MB?

  209. Ge0rG

    Kev: where is it defined? In XML?

  210. jubalh

    Kev: which is? And where is it written?

  211. Kev

    Because a stanza is allowed to have a max length of anything down to 10k, it means an id can’t be longer than that, less the rest of the stanza ;)

  212. jubalh

    you see guys. So Profanity is all good. Maybe we should stay as is then :)

  213. Kev

    I’d say you had a bit more room to play with, even.

  214. jubalh

    I'll think of something

  215. Zash

    (unique stream-id + counter), Ge0rG? Like the thing we keep mentioning as The Best Thing? 🙂

  216. Ge0rG

    Kev: there is no upper limit on the upper limit for stanza sizes, so technically it's unbounded.

  217. Kev

    hmac(base64(stanza))?

  218. Ge0rG

    Zash: not quite.

  219. mathieui

    jubalh, tbh if you get the binary uuid & hash and encode it in ascii85 (instead of picking the ascii repr and growing it with base64) you would fit easily into most lower limits without losing information :p

  220. Zash

    Almost

  221. Ge0rG

    Zash: https://github.com/igniterealtime/Smack/blob/48f5e349b9a318ba2a1d82aef9fa069e62da10bb/smack-core/src/main/java/org/jivesoftware/smack/packet/id/StandardStanzaIdSource.java#L30

  222. Zash

    Ge0rG, so, per process?

  223. Ge0rG

    Zash: yes

  224. deuill

    Perhaps the there can/should be an XEP that provides some sort of best practice for ID generation? There's been a number of advances over UUID algorithms that avoid clashes while retaining sortability.

  225. Zash

    deuill, are you volunteering? 😉

  226. deuill

    Twitter Snowflake IDs were, I think, the first of their kind, but others have emerged since.

  227. Ge0rG

    deuill: yes, and that XEP should be RFC6120'

  228. Zash

    I looked at those. Also LUID and various variants of concat(timestamp, random)

  229. jonas’

    ITYM ULID

  230. Zash

    [IDLU]{4} 🤷️

  231. mathieui

    IIII

  232. deuill

    Actually, maybe that's a good way for me to contribute. What I can't tell is why the original RFC says stanzas SHOULD have a unique ID assigned (not MUST?). I need to re-read those passages.

  233. Zash

    For fire-and-forget, who cares what the ID is

  234. deuill

    I think some of these algorithms assume Infinite computational power as well, or at least cycles to spare.

  235. deuill

    Conversations apparently tries to de-dup based on ID (even empty IDs)? People's definition of fire-and-forget may vary lol

  236. Zash

    Here's a start: ``` xeps$ pandoc -t ./tools/2xep.lua >inbox/best-id.xml <<. > % Best practices for stanza IDs > > Use UUIDv4. > . ```

  237. Zash runs away and hides `base64url(random.bytes(12))`

  238. deuill

    Co-Authored-By: Alex P

  239. deuill

    Thanks Zash

  240. Ge0rG

    jonas’: I didn't make a github PR for the CVE formatting back then, but I'd still love to move forward with it.

  241. Ge0rG

    jonas’: with your Editor hat on, what do you suggest me to do next?

  242. jonas’

    Ge0rG, remove the background color, make a PR?

  243. Ge0rG

    jonas’: but I like the background color!

  244. Zash

    Does anyone know offhand where it says that 128 bit IDs should be enough until the end of time, for use as reference?

  245. Zash

    (UUID is less because version numbers and stuff tho)

  246. jonas’

    Ge0rG, I don’t, it makes for a lack of contrast. And if even *I* find the contrast lacking, any a11y tool will throw it in your face.

  247. jonas’

    Zash, we use 128 bit strength for cryptography, suggesting that you cannot reasonably brute-force a 128 bit thing

  248. Zash

    jonas’, cargo cult?

  249. deuill

    (Tangentially related but this was an interesting comparison of GUID algorithms, albeit all implemented in Go: https://blog.kowalczyk.info/article/JyRZ/generating-good-unique-ids-in-go.html)

  250. jonas’

    Zash, https://crypto.stackexchange.com/a/48669/16902

  251. Ge0rG

    jonas’: you only disliked the contrast to the links, right? Can I make the links red-colored in the cve box to satisfy you?

  252. jonas’

    Ge0rG, no

  253. jonas’

    also the text<->background was lacking IMO

  254. jonas’

    but I may be misremembering

  255. jonas’

    you could refresh my memory with a screenshot

  256. Ge0rG

    jonas’: https://op-co.de/tmp/xep-template.html#example-1

  257. jonas’

    so red-on-red would definitely make this worse

  258. jonas’

    and yeah, weave is contrast-error marking all of that

  259. jonas’

    ok, the black-on-red not, but green-on-red it doesn’t like

  260. Ge0rG

    jonas’: I've reduced contrast of the red, can you shift+reload

  261. Ge0rG

    maybe you still have my old version cached

  262. Zash

    jonas’, IIRC even counting to 2⁶⁴ in boil-the-oceans levels, but for IDs it's more about the chances of accidentally generating the same ID twice during the lifetime of the scope.

  263. jonas’

    Ge0rG, same

  264. jonas’

    z https://en.wikipedia.org/wiki/Birthday_attack#Mathematics

  265. Zash

    jonas’, IIRC even counting to 2⁶⁴ is boil-the-oceans levels, but for IDs it's more about the chances of accidentally generating the same ID twice during the lifetime of the scope.

  266. jonas’

    Zash, https://en.wikipedia.org/wiki/Birthday_attack#Mathematics

  267. Ge0rG

    jonas’: maybe it's because the default text color is #444

  268. Zash

    Oh look, it has a table

  269. jonas’

    Ge0rG, it’s complaining about the coloured text, not about the grayscale text

  270. Ge0rG

    jonas’: another shift-reload?

  271. jonas’

    I don’t see the link as link anymore

  272. jonas’

    looks black to me

  273. jonas’

    (but weave is happy about the contrast… which is pointless though)

  274. jonas’

    welcome to the world of making an accessible thing.

  275. Ge0rG

    jonas’: is your monitor calibrated?

  276. jonas’

    do I need a calibrated monitor to read XEPs?

  277. Ge0rG

    jonas’: you need a calibrated monitor to complain about lack of contrast ;)

  278. jonas’

    no, I don’t

  279. Ge0rG

    jonas’: I *really* want that reddish background, because without it just looks naked

  280. jonas’

    sorry for your loss

  281. jonas’

    I won’t accept a reddish background just because you prefer it if it renders XEPs less readable for people with visual deficiencies or under bad lighting conditions or whatever

  282. jonas’

    I took great care during the XEP redesign to avoid such pitfalls, I’m not going to let you ruin that ;P

  283. Ge0rG

    said the person who uses #444 instead of black for text.

  284. Ge0rG

    jonas’: shift-reload again for the naked box.

  285. Daniel

    > said the person who uses #444 instead of black for text. That's better than #666

  286. jonas’

    Ge0rG, LGTM

  287. Ge0rG

    Le Sigh.

  288. Ge0rG

    now how do I add a huge red warning sign there?

  289. jonas’

    but I knew that already, I tested your design with background-color disabled and was immediately happy

  290. Ge0rG

    so we can't both be happy, right?

  291. jonas’

    yes

  292. Ge0rG

    well, I can be happy if that box has a huge red ⚠️ in the left, but I don't know how to make it

  293. jonas’

    Ge0rG, you need to do something with <img/> or background-image

  294. Kev

    Why should we be making these things prominent anyway?

  295. jonas’

    to get a warning sign without disturbing a11y tools

  296. Kev

    Security considerations aren’t, for example.

  297. Sam

    Yah, this seems like something to be aware of but not something that you absolutely definitely must see at all costs (as opposed to security considerations which are that)

  298. Sam

    These are just non-normative examples of what can go wrong.

  299. jonas’

    and examples of where the security considerations have been ignored, so placing them really prominently is something I’d deem useful

  300. Ge0rG

    What jonas’ said

  301. Sam

    Prominent placement is fine, but it's not important to specifically draw the users attention to them over other things like the security considerations

  302. Ge0rG

    let's add a red background to the security considerations then!

  303. jonas’

    and make them blinking /s

  304. Ge0rG

    jonas’: at least it won't complain about contrast then!

  305. Zash

    `<blink><marquee>🚨️ ⚠️ ACHTUNG!</blink></marquee>`

  306. jonas’

    so my opinion is roughly: If you don’t read the security considerations, you are a bad developer. No matter how emphasized they are compared to other sections. But there’s nothing wrong with us pointing out and highlighting exceptional cases where there are documented, wide-spread exploits because of such neglect with extra emphasis.

  307. Kev

    This is not a hill for me to die on, but I don’t understand why we would say the most important thing about a XEP is a section saying someone once got it wrong.

  308. Sam

    +1 ^

  309. jonas’

    do you have other proposals to improve the situation that people clearly ignore security considerations?

  310. Kev

    Accept that it’s not the spec author’s responsibility, nor is it within their ability, to make implementors read the spec?

  311. Ge0rG

    write shorter specs.

  312. Ge0rG

    also: write specs that are harder to implement in insecure ways.

  313. Kev

    Focus on writing clear specs that are easy to get right.

  314. jonas’

    Kev, that’s not an improvement to the situation, only to your (our) perception of it

  315. Sam

    What Ge0rG said.

  316. jonas’

    but we can’t fix e.g. carbons and such

  317. Ge0rG

    XMPP 2.0!

  318. Sam

    I don't think this will do what you think you're doing either though. This is just a distraction that may or may not actually have anything to do with the security considerations and may or may not actually contain anything of value that's likely to be repeated.

  319. Sam

    It's a nice thing to have, it just doesn't seem like the thing we want to drag users eyes to (and possibly away from other important normative things like security considerations)

  320. Sam

    Everyone only reads the examples and not the normative text, let's not also make them only read the CVEs and not the security considerations.

  321. jonas’

    Sam, but they’re *already* not reading the security considerations.

  322. Sam

    So don't make it worse.

  323. Sam

    It's a separate problem is what I'm saying

  324. MattJ

    I don't have full context here, and don't have time to review the entire conversation, but if this is about relevant CVEs being highlighted in XEPs, that's definitely a thing we should do

  325. Sam

    Add CVEs, that's a good idea I think. If you want to make people read the security considerations, highlight that, not the new non-normative may or may not exist or be relevant examples.

  326. Ge0rG

    MattJ: it's about the format of that: https://op-co.de/tmp/xep-0280.html#security

  327. Sam

    I have no strong feelings about how this should be formatted, FWIW, I just want to suggest that adding more and more stuff isn't doing what you think it's doing.

  328. Sam

    On first impressions the one Ge0rG just linked looks great to me and is enough extra formatting.

  329. Kev

    Especially without context.

  330. MattJ

    Ok, if it's just about bikeshed formatting, I definitely have other things to do... :)

  331. MattJ

    Oh no, but I can't help it... FWIW I would group all the CVEs into a single box with "The following security vulnabilities have previously been found in some implementations of this specification:"

  332. Ge0rG

    MattJ: that can be achieved by different XSLT, I'm sure.

  333. Kev

    MattJ: This isn’t all CVEs though, Jonas’ said it’s only those that were widely applicable.

  334. jonas’

    "worth highlighting" for whatever definition of that

  335. MattJ

    I didn't say "all", did I?

  336. Kev

    Oh, and exploited widely, in fact.

  337. Kev

    You didn’t, but just saying “here are some CVEs” implies it’s somewhat more exhaustive than CVEs that have been widely exploited.

  338. MattJ

    Then insert "notable" somewhere, or something. Or don't :)

  339. Kev

    Anyway, if we’re only talking about vulnerabilities that were widely exploited (which has been precisely 0 vulneralibilities that I can remember), my concerns about them being overemphasised are probably overblown.

  340. jonas’

    Kev, sorry, I didn’t mean to say "exploited"

  341. jonas’

    but widely exploitable with simple-enough PoCs

  342. jonas’

    but I am also fine with less strict constraints

  343. flow

    listing related CVEs is probably fine, but not like https://op-co.de/tmp/xep-0280.html#security please

  344. flow

    the text of the security considerations is more improtant than the related CVEs. but the currently proposed visualization puts the focus on the CVEs

  345. jonas’

    flow, see above for my rationale for that

  346. flow

    jonas’, not sure if I looked at the right rationale, at least I fail to see how this counters my argument

  347. jonas’

    > so my opinion is roughly: If you don’t read the security considerations, you are a bad developer. No matter how emphasized they are compared to other sections. But there’s nothing wrong with us pointing out and highlighting exceptional cases where there are documented, wide-spread exploits because of such neglect with extra emphasis.

  348. flow

    that is what I read. But I don't interpret this as something that argues in favor of making the CVEs visually more prominent than the security considerations

  349. flow

    if anything, be sparse with visual effects

  350. jonas’

    -ENOTIME

  351. flow

    It feels like Ge0rG had the changelog of a software in mind when he designed this

  352. Sam

    What flow says. I don't have strong feelings about the current formatting, but we definitely shouldn't do much more than this (stop signs and big red backgrounds and whatever was being discussed before). And even as is now I still think it will be just like examples where users automatically read the shiny things and ignore the text assuming the examples (or CVEs) cover all the things they need to know.

  353. Ge0rG

    Sam: if the people read the CVE, that's a huge win already.

  354. Sam

    I kind of doubt it in most cases, especially if it comes at the cost of ignoring the text, but maybe.

  355. Ge0rG

    Sam: as jonas’ said before, the text is already being ignored

  356. flow

    I am not sure if adding big red boxes under the text being ignored helps with that

  357. Sam

    Ge0rG: right, and this won't fix it and could make it worse.

  358. Sam

    And now the only thing they maybe look at is some random examples that may or may not actually be a good representation of the actual problems and weren't actually a part of the XEP process.

  359. flow

    If anything, a short, potentially visually featured, sentenced at the beginning of the xep that states "This XEP has Security Considerations, make sure to read them", would be better IMHO

  360. flow

    If anything, a short, potentially visually featured, sentence at the beginning of the xep that states "This XEP has Security Considerations, make sure to read them", would be better IMHO

  361. Ge0rG

    well, if they read the CVE text, the chances are higher that they'll come to the same conclusion that's implied in the security considerations

  362. Sam

    I doubt it. I'd bet most of them end up with one or two things that are mostly unrelated, or only cover one tiny part of the security considerations.

  363. Ge0rG

    Well, the list of CVEs is evidence that the current aproach does *not* work. Let's try the alternative suggestion as an A/B test then

  364. Sam

    If that's actually the problem you're trying to solve, flow's alternative seems better.

  365. Zash

    A/B tests \o/

  366. Sam

    (FWIW if we had a way to actually A/B test this that would be great, but I don't think we do)

  367. Ge0rG

    let's bikeshed A/B testing infrastructure then!

  368. Daniel

    > Well, the list of CVEs is evidence that the current aproach does *not* work. Let's try the alternative suggestion as an A/B test then Do we have evidence that the clients effected by the CVE ever read the xeps?

  369. jonas’

    how would the know how to enable carbons if not?

  370. Daniel

    The developers of those clients

  371. Ge0rG

    Daniel: are you saying that you can implement a XEP without reading it?

  372. Daniel

    jonas’: gajim XML console

  373. jonas’

    Daniel, please no

  374. Daniel

    Looking at other implementations

  375. jonas’

    please no.

  376. jonas’

    I’m going to get dinner now

  377. moparisthebest

    reading the xeps don't even matter, what clients/servers send/accept in practice is what matters :D

  378. jonas’

    because I can’t take that

  379. Daniel

    I'm fairly convinced that this is how a lot of those clients were developed

  380. flow

    ahh, the thought of XMPP devs not even looking briefly at XEPs when implementing them

  381. flow

    enough xsf@ for today

  382. jonas’ cries

  383. Kev

    I *know* there have been implementations of features done by looking at sent/received protocol, and not the XEPs.

  384. Kev

    That’s not even hypothetical :)

  385. Daniel

    That's how I implemented <session/>

  386. moparisthebest

    aren't there plenty of things that are well known not to even be implementable looking at XEPs ? just "shared knowledge" stuff ?

  387. Daniel

    Didn't know what it was. Just knew that sending this magic made things work

  388. Sam

    I'd be willing to be that between what Daniel said, looking at the XEP but only at the examples, and copy/paste from Stack Overflow you'd cover over 99% of all XMPP development. I don't think I'm joking when I say that I'd put money on this.

  389. moparisthebest

    if a client dev implemented OMEMO from the XEP today they'd probably be pretty sad when they couldn't interop with a single other client ?

  390. Sam

    *bet

  391. Sam

    And I'd bet that the other <1% are 99% people in this room :)

  392. moparisthebest

    there is a massive difference between what client/servers *should* accept/handle and what they actually *will* accept/handle in practice, you can't get that from looking at XEPs

  393. Ge0rG

    moparisthebest: that's actually also a statement about the horrible state of the OMEMO XEP

  394. moparisthebest

    same situation with RFCs, and everything in web-land too

  395. moparisthebest

    computers: they bad

  396. mathieui

    Sam, knowing ex-coworkers who have worked on XMPP for a client website project, that probably sums up 99% of all private-sector XMPP development for people not familiar with standards, yes

  397. mathieui

    "I just loaded xmpp.js, why doesn’t it work!"

  398. moparisthebest

    when I implemented XEP-0368 in Conversations I didn't know the XSF or XEPs existed

  399. Sam

    mathieui: indeed, I was specifically thinking of a colleague at HipChat who asked me a question about the protocol and I wasn't sure off the top of my head so I said "Here, pull up RFC 6120" and their response was "wait, you actually read these things?"

  400. Sam

    Although as far as libraries go, "I just loaded <library>, it should work" seems reasonable.

  401. moparisthebest

    my reasoning was roughly: email clients are fine doing direct-tls instead of starttls without any formal specification, why not XMPP

  402. Sam

    I mean, assuming they actually called it somehow, you know what I mea.n

  403. mathieui

    Sam, well, except you need to at least know some part of the semantics and how they relate with what you want to do

  404. Kev

    I think there’s multiple things here. * People understanding how they should learn what to do * People being willing to do stuff properly * People being competent to do stuff properly * Doing stuff properly being possible to do * Doing stuff properly being easy to do

  405. Kev

    And probably others.

  406. mathieui

    Most certainly others, yes.

  407. Sam

    mathieui: yah, I feel like that's a library design problem though. For most people I suspect they want to call conn = xmpp.Connect("domain.com"); conn.SendMessage("Hi") or something. I really want to eventually get my own stuff to that point

  408. Zash

    Do we need to stick "The Official XMPP $Language SDK" sticker on some libraries?

  409. Kev

    I think it’s unduly naive to think we can have much influence over some of those, and showing that people aren’t getting it Right doesn’t, in itself, mean that if we just shout at them louder it’ll get better.

  410. Sam

    What Kev said.

  411. Kev

    OTOH, some of them (particularly the last two, but also the first) are entirely within our remit.

  412. mathieui

    Sam, well, if I remember correctly it was something like they did not expose bosh or websocket in their ejabberd container

  413. Sam

    Fair; ops is hard no matter what.

  414. moparisthebest

    and don't get me wrong XEPs are super valuable and we should cram all the relevant info needed in them, if only for a place to point to other than "look what client X does" which sucks

  415. moparisthebest

    still, many times you have to dig into what X does, and assume many/most people use this instead of XEPs on how to learn it

  416. moparisthebest

    TLS had the same problem with people hardcoding version numbers right?

  417. moparisthebest

    "it works for the current input" not realizing it'd break on 1.3, 1.3 ended up working around it entirely

  418. moparisthebest

    https://mastodon.xyz/@nextcloud/106058947562901204 :)