KevYeah, just get the Board member to mail me at my isode account please.
KevI thought all of Board knew how to contact me by now, sorry.
stpeterhas joined
stpeterhas left
alameyohas left
emusThanks, yeah I just checked your page
Alexhas joined
alameyohas joined
Andrzejhas joined
stpeterhas joined
stpeterhas left
alameyohas left
arcgoffi: when you're around, I'd love to talk about xep-0355
goffiarc: hi, I'm here
arcWhen you drafted this, did you consider using xpath instead of namespace plus attributes?
govanifyhas left
govanifyhas joined
arcOne thing that you have written here that I had not considered is client defined services. It is an interesting idea, though I am curious how you envision this being implemented in the real world
goffiinitially there was only namespace, the attribute has been added because it was the only to distinguish MAM for chat from MAM for Pubsub. XPath would probably complicate (and servers would need to have a handy xpath implementation available).
goffiNote that I would love to have xpath or at least simplified xpath in XMPP
arcXPath is certainly more complicated. But is also more versatile. One of the problems with XPath is modern implementations are rare and hard to come by.
KevAs a standards body we’re generally wary of xpath because of the burden it places on implementations.
MattJFWIW XPath is also being discussed as a solution for improving push notifications currently
MattJMaybe 2021 is the year to embrace XPath :)
ZashIs "simplified xpath" a thing?
MattJXMPPath
goffiI've written this years ago, so I need to refresh a bit my memory ^^. But the idea was basically that you if you want e.g. advanced PEP and your server doesn't offer that, you could have a third party implementation and ask yourself your server to redirect stanza there, without having to wait for admin or anything.
KevMattJ: Ah, interesting. Where’s the push notification discussion happening? I missed that if it was on list.
nycohas left
goffiZash: I don't know if it's already a thing, but just keeping the base of path and attribute matching, without all the methods could be useful and easy to implement.
KevI’m coming to the conclusion that we need two distinct models for push notifications - one for e2e and one for non-e2e.
KevAnd trying to address both with the same mechanism is likely to be painful.
Zashgoffi, so just a path like `/{xmlns}name/...`?
goffiZash: for instance yes, maybe with attribute matching. I don't know if this would be enough for our needs though.
arcNobody wants to work on lower level XML software. It's not sexy. It is easily overlooked as a resume filler. Nobody will pay for it. So that boils down to students or retired developers who love XML and take it on as a challenge.
KevTeensy bit of hyperbole there :)
ZashNo true Scotsman wants to work on XML! /s
KevZash: :D
nycohas joined
arcKev: is it? I mean certainly there are /some/ people working on it.
AndrzejKev, there was noting on the list about push notifications and xpath, but it was just an idea to allow client select what it wants to have in the push notifications payload (assuming it is encrypted) https://github.com/tigase/tigase-xeps/issues/4
Andrzejor just filter what is expected to send push notification and what is not
andrey.ghas joined
ZashIncluding a stanza "skeleton" was suggested at some point as well, ie stripping all content and attributes, leaving only `<name xmlns="">` of each tag.
ZashUh, with my server dev hat on, plz no XSLT in the server
AndrzejZash, that was just an idea, something else allowing to get some data out of stanza and trigger push notifications would be good as well
alameyohas joined
stpeterhas joined
stpeterhas left
arcI am certainly on board for discussing a limited XDM for use with a XMPP stream
Ge0rGI think the idea of stanza skeletons was that the skeleton gives the push server all required info for deciding whether to make a silent or a noisy push notification, without leaking any actual user data
Ge0rGSo this is a different use case from "send encrypted message payload over push"
arcNot sure I follow
ZashRight, giving the client everything it needs vs giving the push gateway everything it needs.
Andrzejafter online FOSDEM and Matrix usage I'm pretty sure that usage of Push & Fetch is a bad thing compared to pushing encrypted data (almost 30% of battery used by Element fetching data)
AndrzejI think that giving control to the client would allow them to evolve quicker with less changes on the server side
alameyohas left
florettahas joined
Ge0rGAndrzej: I'm not sure if FCM and APNS will be okay with carrying all your encrypted payloads.
stphas joined
AndrzejWhy not? there is a limit of 4KB but it would work
Ge0rGThat said, what you fundamentally want in that case is to initiate/terminate the xmpp client session on your app server and have a custom protocol that pushes over APNS to your client
Ge0rGbecause then you can optimize everything
Ge0rGAs long as you have the xmpp client connection terminated on the mobile device, it will have to reconnect to the server and to resume the 0198 session rather often
Andrzejevery 30-120s on iOS and most likely will be killed anyway
Ge0rGAndrzej: only if you receive something that warrants an ack
Andrzejthat is why I prefer to have offline client and pushes with notifications on which user can act (ie. open app)
govanifyhas left
Ge0rG"Your chat program received an XML stanza. Open app to see if it was something you care about"
govanifyhas joined
Andrzejas for APNS and encrypted push, they've created even example for doing that https://developer.apple.com/documentation/usernotifications/modifying_content_in_newly_delivered_notifications see Listing 1
AndrzejGe0rG, I was usable "content" in the notification and with encryption and XPath that could work quite well✎
Ge0rGAndrzej: well, I suppose you could use that to send an encrypted blob to the app
AndrzejGe0rG, I want usable "content" in the notification and with encryption and XPath that could work quite well ✏
pasdesushihas joined
AndrzejI'm already doing that in Tigase & Siskin and AFAIR in Prosody
Ge0rGAndrzej: so what you want from XEP-0357 is to pass the full stanza to the app server?
Andrzejno
ZashPass the parts you're interested in, encrypted, via the app server to the client?
Andrzejto allow client send "XSLT" to tranform stanza in "encrypted payload" opaque to the app servers
Ge0rGAndrzej: but the app server is under your control, so you can do arbitrary modifications ther✎
Andrzejthis transformation and encryption is done on the XMPP server side
Ge0rGAndrzej: but the app server is under your control, so you can do arbitrary modifications there ✏
Andrzejyes, but XMPP server is leaking user data to the app server in your example
Ge0rGAndrzej: that's a very significant effort for the xmpp server. What key should it use?
Ge0rGalso that means the xmpp server needs to have significant knowledge over the used client / app-server infrastructure
Andrzejclient with transformation would upload key, in my case AES128 key
Ge0rGWhy not an ec25519 key?
Ge0rGYou don't really need the server to be able to decrypt the payload, right ;)
Andrzejright, but it is aware of it anyway, so it can decrypt it
Ge0rGI am not sure if the trade-off of leaking the private data to the app server is a big thing.
AndrzejI'm not sure which algorithm is faster, I've assumed AES128 is good in this case
Ge0rGWell, encryption isn't the bottleneck; XSLT is
pasdesushihas left
ZashXSLT seems like overkill.
AndrzejAs I've said, it does not have to be XSLT, but could be list of fields + XPath to fetch then✎
AndrzejAs I've said, it does not have to be XSLT, but could be list of fields + XPath to fetch them ✏
Kev> Uh, with my server dev hat on, plz no XSLT in the server
M-Link has xslt to multiple reasons :|
> just an idea to allow client select what it wants to have in the push notifications
That seems sane at first thought.
arcAndrzej: I tend to use XPath as a generic term for XDM myself so this is no way a criticism, I'm just wondering if you are talking about XPath proper
pasdesushihas joined
AndrzejI'm not sure, I was thinking (as XSLT cannot be used) to create some XEP that would specify filteiring data and fetching them from existing XMPP schema in to some structure, basically transforming stanza into something else
Andrzejto filter and fetch data I was thinking about using XPath, but I could be wrong
pasdesushihas left
pasdesushihas joined
Ge0rGAndrzej: what about a whitelist of xml namespaces to retain in the <message> element? would that suffice?
Ge0rGsomething like https://hg.prosody.im/prosody-modules/file/64b7daa6c42c/mod_csi_battery_saver/mod_csi_battery_saver.lua#l105 but more formalized
Andrzejas we have 4KB hard limit, I think that might be not enough to just filter elements
Andrzejbut if clients could decide what should be included that would be a step forward
ZashNamespaces does seem like a plausible Good Enough, and is easy to implement.
jonas’4kb after base64, right?
Andrzejyes, correct, after base64
jonas’so in effect just about 1kB
Andrzejnot 3KB?
Zash`base64(encrypt(strip(<message/>)))`?
ZashDepending on how much we trust the app server to not be /too/ evil, we could stuff some compression in there too
AndrzejZash, I think this could be too big and in some cases it is more valuable to lose some of the message <body/> but deliver notification correctly
pasdesushihas left
ZashHow big are your messages?
arcXmpp does not implement full XML. Never did. It is a subset. So I don't see a problem with creating a subset of XDM
Ge0rGSo you end up encoding the limits of google and apple services into my server.
arcXPath and xquery both use XDM
jonas’right, 3kB, not just 1
jonas’Zash: with omemo, messages can get big quickly
ZashI was just thinking that, with omemo, the server can't do anything like ship half the <body>
Andrzejis server is aware of clients OMEMO device id it could filter out keys in the notification and notification could still work✎
jonas’XDM seems to be xpath 2.0, which afair lacks implentations and is may be overkill
Andrzejif server is aware of clients OMEMO device id it could filter out keys in the notification and notification could still work ✏
florettahas left
Wojtekhas joined
arcReferring back to my earlier statement about how nobody wants to work on XML stuff 😆
ZashYou can have all of XPath as long as it's only `/{xmlns}name/{otherns}foo@bar/` and nothing else.
mathieuiZash, and attribute matching!
ZashNope!
arcAt this point we're really talking about XPath 3.0 or quite possibly XPath 4.0
ZashProsody doesn't have that, so it doesn't exist!
arcGiven that everything in this community takes 10 years or more to come about
jonas’arc: who is "we"?
arcWe in this room right now, I would hope
arcAnd this community as in XML community. Given that we are still stuck with XPath/xslt/etc in browsers now in 2021
ZashI'd refer back to what Kev said
arcXSLT is perfectly fine stop hating on it 😋
stpeterhas joined
stpeterhas left
Andrzejarc, would exi work for transforming XML stanza into "payload" for the client?
Andrzejmaybe I should be thinking about EXI instead of XSLT
Steve Killehas left
Kevhas left
ZashI am, of course, referring to https://logs.xmpp.org/xsf/2021-02-11?p=h#2021-02-11-521589a72d0ff42a
Kevhas joined
Kevhas left
Kevhas joined
matkorhas left
matkorhas joined
arcNo. EXI is just an alternative representation of XML data. It does make XDM/XPath/Xquery/XSLT faster when written with it in mind. But all processing is generally faster with the EXI because string compare is just that much slower
Ge0rGI'm sure there is nothing wrong with executing attacker-provided XSLT on your XMPP server.
arcI never said processing XSLT provided by the user.
arcXSLT is a turing complete language. You can open a similar glaring security hole by running user provided python, or most languages for that matter.
Zash(XEP-0060 has references to XSLT 😱️)
Andrzejalso (as it was mentioned that I would like to "encoding the limits of google and apple services into my server"), I think that transformation and encoding is OK and would not impose limits on your server and if client would pass "limit" of the payload which it can receive, then server would just respect request from the client
stphas left
stphas joined
ZashSo, size constraint. How about an ordered-by-priority list of payloads you're interested in? Server strips anything not in that list, then if it's still too large, strips the lowest priority payloads until it's small enough?
ZashWhere "list of payloads" could be xpath or just namespaces or somesuch, details.
Andrzejthat "could" work
Adihas left
krauqhas left
arcAndrzej: this is a simplistic but valid way of thinking about EXI; within the root of a XMPP stream you typically only find about 6-10 elements; obviously your IQ, MESSAGE, and PRESENCE elements (capitalized only for clarity), stream: namespace stuff, and possibly session management.
krauqhas joined
arcText domain XML would have the xml parser run multiple passes over the data stream to find delimiters (space, brackets, quotes, etc), break the stream up into events, possibly create a minidom out of those events, and then pass qnames (namespaces, prefixes, element names, attribute names, etc) to the application typically as string pointers into the stream buffer. But increasingly for memory safety, memcpy all those strings into new buffers too.
arcAnd then no matter how the client or server handles stanza routing, it either ends up testing the qnames against a large list of qnames it's designed to pass to various functions, or it hashes the qnames and checks for a value on a hashmap. In every case there's thousands of machine instructions for every stanza.
arcGoing back to those, lets say always 15 or less possible elements found in a <stream:stream> root, EXI represents that as a binary number which typically is either bitpacked with only four bits used, or structured for later compression. In every case, you don't get "message", you just get the binary number 1. Which is much much simpler to parse.
arcIgnoring the stuff you can read up on if you ever wanted to implement it, that is EXI in a nutshell. And that is why it is not just 25x or more faster than text XML processing, it also takes far less memory and can be much more easily squeezed onto a microcontroller.
Andrzejok, I get it now, thanks
KevHas anyone tried doing EXI for S2S?
arcYes.
x51has joined
Andrzejhas left
KevHmm. Going from https://www.w3.org/XML/EXI/#Efficient_XML I find only one (commercial) EXI implementation for C/C++ that doesn’t claim to be alpha quality.
ZashSomeone did mention a lack of libraries earlier.
KevIndeed.
andrey.ghas left
arcTransforming stanzas between exi grammars is not difficult provided your grammar mapping is set up correctly
Kevarc: Was that responding to me? Because if so I don’t see how it relates :)✎
Kevarc: Was that responding to my lack of library comment? Because if so I don’t see how it relates :) ✏
stpeterhas joined
stpeterhas left
pasdesushihas joined
arcUsing it for s2s, you're typically going to be routing stanzas between grammars. So in the above example, a xmpp client might say a message=1, but you may route that stanza to a server using a grammar that says message=0
KevAh, my previous question, gottit, thanks.
pasdesushihas left
pasdesushihas joined
arcWith text domain xmpp you often don't have to modify the stanza. And when you do, only in small specific ways like changing the from= attribute. But with EXI S2S is also grammar conversion.
arcBut going back to the xpath discussion, XDM 3.0 was certainly designed with EXI in mind though it is not referenced directly. EXI does not solve any problems in this area, it only makes things faster and with less bandwidth.
KevAfter a few minutes of looking, I’ve come to the conclusion that there’s no implementation for C/C++ that doesn’t claim to be alpha/seem abandoned other than one commercial Windows-only one. And, as you asserted earlier, I don’t want to be working on an EXI parser :)
krauqhas left
arcThere are more, and yes they are commercial. Thankfully no one has released a free one that is ready to use or I would start having trouble paying my rent.
winfriedhas joined
pasdesushihas left
krauqhas joined
arcAnyways all that is simply different problem. It doesn't help with identifying stanzas for routing to external software, whether you want to call that microservices or not.
Ge0rGRe EXI I think we could have significant benefits on mobile / low bandwidth, if a client implementation creates a grammar of everything supported by the client, uploads it to the server in some secure way, and the server only ever uses elements within that grammar to the client, stripping everything unknown and dropping empty elements.
Ge0rGYour client doesn't support CSNs? It's omitted from the grammar, server strips out the element from messages, empty messages get dropped on the server, battery wins
pasdesushihas joined
pasdesushihas left
pasdesushihas joined
xeckshas left
jonas’except only proprietary implementations, so no chance there
xeckshas joined
emushas left
moparisthebesthas left
pasdesushihas left
pasdesushihas joined
derdanielhas left
derdanielhas joined
pasdesushihas left
pasdesushihas joined
Andrzejhas joined
Mikaelahas joined
pasdesushihas left
pasdesushihas joined
govanifyhas left
govanifyhas joined
pasdesushihas left
pasdesushihas joined
alameyohas joined
Ge0rGjonas’: implementations of EXI?
Ge0rGHow hard can it be?
jonas’how hard can a binary xml parser be?
stpeterhas joined
stpeterhas left
Steve Killehas joined
Steve Killehas left
Steve Killehas joined
KevI mean, you just take an XML parser and you change some strings to numbers, right? Job done ;)
Ge0rGit's not-fun, so let's call it NunXMPP. Will also make clear that it's neither fun nor sexxy.
alameyohas left
moparisthebesthas joined
LNJhas joined
pasdesushihas left
intosihas joined
florettahas left
antranigvhas left
stpeterhas joined
stpeterhas left
derdanielhas left
derdanielhas joined
pasdesushihas joined
derdanielhas left
derdanielhas joined
antranigvhas joined
derdanielhas left
derdanielhas joined
edhelashas left
edhelashas joined
intosihas left
derdanielhas left
derdanielhas joined
pasdesushihas left
pasdesushihas joined
pasdesushihas left
pasdesushihas joined
intosihas joined
derdanielhas left
derdanielhas joined
florettahas joined
Steve Killehas left
Steve Killehas joined
wladmishas left
nycohas left
wladmishas joined
pasdesushihas left
pasdesushihas joined
wladmishas left
wladmishas joined
Steve Killef
Steve Killef
Steve Killeignore me
Zash"push 'f' to pay respects"?
wladmishas left
wladmishas joined
wladmishas left
wladmishas joined
stpeterhas joined
stpeterhas left
papatutuwawahas joined
florettahas left
krauqhas left
nycohas joined
derdanielhas left
derdanielhas joined
krauqhas joined
papatutuwawahas left
wladmishas left
papatutuwawahas joined
florettahas joined
derdanielhas left
derdanielhas joined
alameyohas joined
Wojtekhas left
Andrzejhas left
pasdesushihas left
pasdesushihas joined
papatutuwawahas left
stpeterhas joined
stpeterhas left
Andrzejhas joined
wladmishas joined
Wojtekhas joined
lskdjfhas joined
wladmishas left
wladmishas joined
emushas joined
wladmishas left
derdanielhas left
derdanielhas joined
stpeterhas joined
stpeterhas left
pasdesushihas left
pasdesushihas joined
wladmishas joined
derdanielhas left
derdanielhas joined
pasdesushihas left
pasdesushihas joined
Danielhas left
pasdesushihas left
pasdesushihas joined
pasdesushihas left
derdanielhas left
pasdesushihas joined
derdanielhas joined
adiaholichas left
adiaholichas joined
chronosx88has left
chronosx88has joined
chronosx88has left
chronosx88has joined
serge90has left
wladmishas left
LNJhas left
serge90has joined
andyhas left
LNJhas joined
winfriedhas left
wladmishas joined
Adihas left
stpeterhas joined
stpeterhas left
wladmishas left
pasdesushihas left
pasdesushihas joined
Adihas joined
Danielhas joined
wladmishas joined
nycohas left
wladmishas left
wladmishas joined
nycohas joined
LNJhas left
LNJhas joined
LNJhas left
LNJhas joined
archas left
archas joined
matkorhas left
matkorhas joined
archas left
archas joined
archas left
archas joined
alameyohas left
alameyohas joined
Danielhas left
nycohas left
pasdesushihas left
pasdesushihas joined
matkorhas left
pasdesushihas left
pasdesushihas joined
matkorhas joined
alameyohas left
pasdesushihas left
pasdesushihas joined
nycohas joined
marekhas left
pasdesushihas left
pasdesushihas joined
derdanielhas left
derdanielhas joined
marekhas joined
derdanielhas left
derdanielhas joined
arcYou do not need to even parse. All you really need is some basic data structures. EXI is extremely easy to implement a reader and writer for.
neshtaxmpphas left
arcThe difficult part is generating grammar based on schema, then generating code based on grammar. And you'll see that for most cases, this is the part that is not provided
debaclehas left
arcI have seen some foss implementations that work fine, but require that you provide a grammar file. Or provide all the low level data structures and the header, but leave the application api to build your own EXI decoder/encoder.
moparisthebestwhat are the upsides? just that it's ever-so-slightly smaller?
jonas’moparisthebest, savings by EXI are more than just "ever so slightly". especially when base64’d stuff comes into play. my understanding is that you could transfer that in decoded form in EXI
moparisthebestwhich saves what, 33% only in the case of base64'd stuff?
jonas’that’s considerable on GPRS
jonas’and remember that all of OMEMO is base64’d
moparisthebestGPRS is dead though so who cares
jonas’you wish
derdanielhas left
moparisthebestactually I wish it wasn't, but that's beside the point :)
moparisthebestin the USA 2G has been gone awhile, most carriers dropped 3G last month, the rest will next year
neshtaxmpphas joined
moparisthebestis all EXI offers "better compression" then ? and if so, how does it compare to "just compressing" XML, and does it suffer from the same security vulnerabilities "just compressing" XML does ?
SamWhitedmoparisthebest: that doesn't mean 2G is dead, that means the major carriers dropped it and if you were in an area where it no longer exists you just don't have internet anymore unless you switch to a smaller local provider or use a slow wireless uplink. That's *more* of a reason to save bandwidth, not less.
chronosx88has left
chronosx88has joined
SamWhitedI make no comment on EXI in particular, just complaining because I'm always annoyed when I've lived somewhere where it's impossible to get fast internet and people say "what's the problem, everywhere has fast broadband now!"
moparisthebestI think we might have discussed this before, and I think the conclusion was EXI is probably as vulnerable to CRIME/BREACH as gzip is ?
moparisthebestSamWhited, yea I think it sucks, but it doesn't change the fact that in the USA (and soon everywhere else presumably), it's dead
moparisthebestI think next year for canada iirc
SamWhitedI don't thik that's true though, it's just dead if you use AT&T or T-Mobile, otherwise I believe smaller providers are still using it because it's what they can afford to do easily. Even if it is dead, that doesn't mean "we don't need to worry about a 33% bandwidth savings" because it being dead doesn't mean everyone gets upgraded to 4G
alameyohas joined
nycohas left
LNJhas left
moparisthebestright, I'm not saying EXI is good or bad, I'm asking what advantages it offers, how it compares to just running normal compression on XML etc
neshtaxmpphas left
SamWhitedMaybe I misunderstood "which saves what, 33% only in the case of base64'd stuff? / GPRS is dead though so who cares"
ZashI vaguely recall all of Sweden having some kind of GSM coverage at some point, but since recent-G networks, not so much. Not much profits in covering the Scandinavian mountain range in high-speed internet.
SamWhitedThat sounds like "we don't have to save bandwidth, everyone has fast internet now"
ZashAIUI you get rid of the parser and shuffle packed structs over the wire, instead of a text format that requires a proper parser.
marekhas left
moparisthebestthat sounds like a proper security nightmare to me
marekhas joined
ZashHow's HTTP/2 doing? How's all the ... binary Google format I don't remember the name of anymore.
moparisthebestso for sure EXI has downsides compared to compressed XML, like comparatively few libraries, no/much less security auditing, and such, does it have upsides?
Danielhas joined
andyhas joined
ZashCompression of the zlib variety has memory usage issues and security .. ickyness.
moparisthebesthow sure is anyone EXI doesn't have the same security problems ?
ZashI'm sure it's just as good as ASN.1 & co! 😛
LNJhas joined
Zashmoparisthebest, protocol buffers, was the thing I forgot the name of. I mentally included HPACK in "HTTP/2"
SamWhitedI don't remember much about EXI, but it negotiates the cmopression up front instead of constructing a dictionary that is reused across stanzas right? In that case I don't see how it could be possible for it to have the same issues as stream compression or TLS compression
moparisthebesteven HPACK acknowledges it's vulnerable to CRIME and friends https://tools.ietf.org/html/rfc7541#section-7.1.1
ZashCan't you ... not do that with EXI?
ZashJust do the binary packing stuff
ZashCRIME & co comes from compressing user/attacker data in the same context as other stuff, so if you just don't do that, things should be better
moparisthebestSamWhited, I realize current-xmpp-compression doesn't do this, but nothing stops you from designing a XEP such that each stanza is compressed separately right?
stpeterhas joined
stpeterhas left
Zashmoparisthebest: Correct, just need to write it down somewhere and get implementations to comply.
SamWhitedmoparisthebest: sure, I've worked plces that implemented it that way in the pas
SamWhitedt
moparisthebestso, that's *not* vulnerable to CRIME then ?
Steve Killehas left
moparisthebestthen the questions are: 1. is EXI vulnerable to CRIME ? 2. if not, how does it compare size-savings-wise to just doing the above with XML ?
jonas’I did some measurements on the impact of compressing stanzas individually some time ago, and it was "still worth it"
SamWhitedRight. Assuming you're not doing something weird with your stanzas where you're mixing secret data and non-secret data, but in the general sense that's right
jonas’I’m not sure if EXI contains any compression at all
Zashmoparisthebest, doing a full flush between each stanza? yes, that fixes CRIME (if I remember correctly what CRIME was about)
jonas’or if you have to use it
moparisthebestin theory it should get rid of basically all base64 overhead right?
neshtaxmpphas joined
ZashIIRC you only need to do a full flush when the sender changes.
Steve Killehas joined
alameyohas left
LNJhas left
ZashMight be interesting things you could do with CSI integration
neshtaxmpphas left
SamWhitedWe just did a full flush on stanza boundaries at HipChat. Probably could have saved more by being clever, but it was easy and it helped a lot. Dropped our network traffic by a factor of 0.58 and dropped CPU utilization by a factor of 0.60
LNJhas joined
SamWhited(with ZLIB)
ZashA big part of why we dropped compression completely from Prosody was memory usage tho.
moparisthebestmight even be better options today, it'd be interesting to see XMPP-wise how zstd and brotli compared
nycohas joined
SamWhitedYah, I didn't write down or publish our memory usage, but I assume it went up a bit. Don't remember it though, had to go look up those two numbers. It's been a while.
chronosx88has left
chronosx88has joined
ZashI'd be interested in fixed-dictionary compression
moparisthebestiirc that's what EXI is doing ^ ?
moparisthebestexcept it negotiates the dictionary, roughly
KevThat’s more or less what EXI is isn’t it?
KevHeh, beaten :)
ZashI though it was more like bit packing structs, not like zlib & co
moparisthebestbut that implies doing the same compression across all stanzas in a stream, which probably implies CRIME
ZashNot if you don't allow backreferences into user data, only into the dictionary
moparisthebestor possibly some other attack if you know the dictionary used, idk
moparisthebestisn't "xml element names used in the stanza" sometimes "user data" ?
ZashYou don't learn anything about the previous stanza sent by someone else
ZashIf you say "hello", then an attacker saying "hello" right after would be smaller because it can reference that previous "hello"
ZashBut if you build a static dictionary, that everyone involved already know, you don't leak user data from that.
ZashStatic dictionary would be something full of angle brackets and protocol stuff, no user data.
SamWhitedI've thoguht about doing that with zstd a couple of times. It has a training mode where you can give it a sample set and it builds a dictionary from that you can reuse later. Never actually tried to see how well it does with a big set of XML though.
nycohas joined
pasdesushihas left
pasdesushihas joined
winfriedhas joined
Andrzejhas left
serge90has left
benharrihas left
benharrihas joined
serge90has joined
paulhas left
Wojtekhas left
derdanielhas joined
paulhas joined
derdanielhas left
derdanielhas joined
antranigvhas left
derdanielhas left
derdanielhas joined
Adihas left
Adihas joined
Andrzejhas joined
antranigvhas joined
wladmishas left
archas left
archas joined
arcmoparisthebest: is more than a little compression. With xmpp it can transform the overhead of a <message> stanza from around 100-200 bytes (depending on jid length) to around 10.
moparisthebestarc, so is it vulnerable to CRIME, and how does that compare to simply compressing XML stanzas
arcWhere did you get that idea?
moparisthebestthat was a question, not a statement :) "is it"
arcI don't believe so, no. Because it is not compression. It would use the same number of bits regardless of the length of the qnames, jids, etc.
derdanielhas left
derdanielhas joined
arcEXI is a binary representation of XML. One of the functions is designed for is to then run it through a conventional compression such as DEFLATE
derdanielhas left
derdanielhas joined
derdanielhas left
derdanielhas joined
arcAnother option is to bitpack.
derdanielhas left
derdanielhas joined
moparisthebestis *that* vulnerable to CRIME
archttps://www.w3.org/TR/exi-primer/ goes into the higher level nitty gritty if you want to read more.
arcNo because it is constant width.
derdanielhas left
derdanielhas joined
derdanielhas left
derdanielhas joined
pasdesushihas left
pasdesushihas joined
derdanielhas left
derdanielhas joined
arcThe most you could probably learn from CRIME is encoding type. EXI supports four modes; byte packed, bit packed, precompressed, or compressed.
derdanielhas left
derdanielhas joined
arcAnd the letter two are basically the same except the compression is deflate added on top of precompressed
archttps://www.w3.org/TR/exi-primer/#compression explains how data in the stream is rearranged for better compression
moparisthebestso how does it do on a super simple message stanza like https://paste.rs/Oe6.xml ?
moparisthebestbrotli does surprisingly well here (no settings touched, just `brotli -c msg.xml > msg.xml.brot`)
arcBut you can basically ignore everything inside the XML brackets
moparisthebestnot the attribute values?
arcEverything inside the XML brackets
moparisthebestso, run some common examples maybe?
arcThere is an example in the primer
moparisthebestof what, say a normal chat client might use for a mode/grammar/whatever
Danielhas left
archttps://www.w3.org/TR/exi/#stringTable will take care of the jids
arc<message becomes one byte (except in bit packed), SE-MESSAGE
moparisthebest> The life cycle of a string table spans the processing of a single EXI stream.
moparisthebestso that likely makes it vulnerable to CRIME then ?
moparisthebestin fact, it certainly would right?
moparisthebestif you put JIDs in there anyhow
arcfrom= and to= are each AT, so one byte each since they are optional. The values come from the string value table
marekhas left
moparisthebestexcept they aren't because you can't do that and avoid CRIME
derdanielhas left
derdanielhas joined
moparisthebestso add them back in
marekhas joined
arcWhat is your obsession with CRIME? The string tables are a constant value. They are not susceptible
moparisthebestbecause you can't just go "maybe it's not vulnerable to breaking the stream encryption ¯\_(ツ)_/¯"
derdanielhas left
derdanielhas joined
moparisthebestit either is, or it is not
arcThe only thing you're going to get for information leak from the string table is the number of values in the table.
moparisthebestattackers can manipulate the JIDs that go across the stream right ?
Tobiashas left
Tobiashas joined
arcHow?
moparisthebesthow would any JID except the sending one be in the dictionary up front anyhow ?
Danielhas joined
moparisthebesthow will you know randomjid@randomdomain is going to message you?
moparisthebestmaybe EXI is only useful in closed deployments where you know the entire network up front ?
moparisthebest(and, maybe, don't care about TLS providing CRIME-proof security, still unknown on this one)
arcYou're right the length of jid could be leaked.
moparisthebestso if you cut that stanza down to essentially the bare minimum info that must be transmitted in it, and it's probably *too* cut down actually, you end up with something like https://paste.rs/aPt which is 86 bytes
mathijshas left
moparisthebestthat means EXI would have to fall somewhere between 86 and brotli's 101 to be useful at all
moparisthebestthat's a small range for improvement
Danieli think that's a very simplistic example
Daniellook at an omemo pre key bundle for example
Danielor generally anything with lots of nasted elements
moparisthebestsure, I suspect brotli would improve even more with anything base64'd though
Danielplus 184 requests 333 requests
Danieland all the other stuff we regulary put into messages
Danieland it should be easier on the cpu
moparisthebesthonestly regular compression's ratio should get better the bigger the stanza is right? so a small one like this is probably least fair
Danieli have a deployment where we would like to use compression but can’t because it's too expensive
pasdesushihas left
pasdesushihas joined
Danieland if implemented correctly exi can even be faster than string parsing
Danielwhere as compression is always slower
arcYou can add brotli on top of EXI. It works very well for that purpose.
moparisthebestI doubt that's always true (that compression is slower)
SamWhitedDaniel: are you sure about that? We had CPU usage drop on one machine because there were less TLS packets where most of the CPU was being taken up
arcBut again this is all based on the grammar.
DanielSamWhited, no
SamWhitedWorth measuring anyways if you haven't. If you're using a slow TLS cipher and a fast compression algorithm you might make some gains
moparisthebestI understand EXI should be able to be better than general compression in a closed system where you know every stanza that will ever be passed
moparisthebestthe question is, can EXI be better than general compression for a chat client in the public federated XMPP network
larmaany compression system that works on reusing user input is has issues the like of CRIME and similar. EXI could be fine if no string lookup table was used. However schema-based EXI is complicated and schema-less EXI is far from optimal✎
larmaany compression system that works by reusing user input has issues the like of CRIME and similar. EXI could be fine if no string lookup table was used. However schema-based EXI is complicated and schema-less EXI is far from optimal ✏
ti_gj06has left
SamWhitedI suspect the question is actually "assuming that EXI and GZIP flushing on stanza boundaries are both 'good enough', which one is easier to implement and deploy widely" (and the answer is probably normal stream compression), but of course I may be wrong.
moparisthebestyes roughly SamWhited , I think it's rather obvious general compression and regular XML is easier no ?
larmasomthing like exi would still be more efficient than gzip. also why would you think flushing on stanza boundaries is enough?
moparisthebestso it becomes 1. is EXI secure 2. is it better than that, and if so, better enough to justify the effort?
ZashCould do something in the direction of HPACK and/or WhatsApps FunXMPP compression scheme...
SamWhitedmoparisthebest: I suspect so, yes
arcmoparisthebest: again, EXI is not compression. It is a schema-aware binary representation of XML data. It is intended that you use compression on top of it.
arcWhen you're not using compression on top of it, typically you use bit packed mode.
adiaholichas left
adiaholichas joined
moparisthebestthen you'd have to show EXI+compression is better in terms of size+effort vs XML+compression ?
moparisthebestand additionally, ensure EXI doesn't introduce security bugs like CRIME
flowlarma> somthing like exi would still be more efficient than gzip. also why would you think flushing on stanza boundaries is enough?
honest question: why would you think that it is not enough?
arcActually as I'm thinking about it, it would make a lot of sense to pre-populate the values string table with the JIDs in your roster. And if you are worried about CRIME, you can also specify that padding is used to make all jids transfer as a fixed width
larmaflow, attackers can control certain content of stanzas even if it's not them sending
moparisthebestso then you can use than as an oracle to determine a user's roster
arcHow?
flowlarma, unfortunately I am appearantly missing pieces why this is relevant
larmaah maybe there is something that I have in mind that nobody else has. If we ever do some kind of efficient compression on stanzas, I'd want to also make use of it inside SCE. Then it's no longer transport encryption only, but also about end-to-end-encryption relevant. And if you assume the server as an attacker, they can easily modify IDs and similar to modify certain parts of your message to exfiltrate others.✎
larmaah maybe there is something that I have in mind that nobody else has. If we ever do some kind of efficient compression on stanzas, I'd want to also make use of it inside SCE. Then it's no longer transport encryption only, but also about end-to-end-encryption relevant. And if you assume the server as an attacker, they can easily modify IDs and similar to modify certain parts of your encrypted message to exfiltrate others. ✏
flowlarma, thanks, I probably need to think about this a little more (and with more sleep)
SamWhitedI still think that doesn't seem worth considering, the server has to be trusted, that's the whole model that we have. Trying to change that and doing complicated partial stanza encryption just seems like a waste of time. Let's just settle on compression that's "good enough" and in the occasional system where there's some high-security environment where the server isn't trusted, don't use it.
ZashDid anyone define "good enough"?
flowlarma, but it sounds like you are talking about an intermediate hop modifyin encrypted bytes, that shouldn't be possible, no?
SamWhitedZash: "better than no compression?"
arcI have to agree with Sam
arcHere's the thing; XMPP is low enough bandwidth and no one really cares except IoT, and maybe mobile.
emus(Different topic: Kev - there was a misunderstanding with Sam W., nevermind about the Twitter thing - I will just request the pinning via mail 😊️ )
larmaflow, no, certain parts are unencrypted, like message id. Also you very likely would want to be able to reply to unencrypted messages with encrypted messages without risking to actually leak the content of the encrypted message 😉
SamWhitedYah, sorry, I didn't realize Twitter required me to have a separate personal account
SamWhitedI'm still happy to help on the comms team as necessary though, someone just tell me what needs doing and I'll see what I can do.
flowlarma, ahh I think I got it now: values that are to-be encrypted are determined by the server
arcOn IoT these days we mostly care about making xml easy enough to use that we can fit it on a microcontroller and utilize less cpu and transmit size so that the battery lasts longer
flowthat is certainly interesting. I never considered compressing the encrypted bytes prior base64 encoding them and the implications of doing so
emusSamWhited if you read in the CommTeam MUC occasional or subscribe to the PR that should be fine. If you want, I can point you as reviewer there, too
arcEXI seems extremely complicated, but CPUs can process it with a minimum amount of code. A typical EXI compiled binary static library is around 8k.
flowFWIW, I believe EXI would also be able to avoid base64 for raw bytes (at least, that is what I remember being told ~5 years ago)
SamWhitedemus: can you invite me? I don't see the comms team muc listed on the website
emushttps://xmpp.org/newsletter.html here is a link if thats okay for you, I dont have you in my contact list so I guess thats quicker
SamWhitedthanks
Andrzejhas left
arcAnd when you're dealing with a microcontroller costing under $1, that only has like 16k-64k flash for all the software, the size of the software matters a lot. And when the manufacturer is budgeting the mAh battery, they care a lot about keeping the microcontroller in sleep and moreso keeping the transmitter powered down as much as possible when the cpu is awake.
inkyhas joined
arcBecause in the end, they don't care about anything else. They don't care about standards compliance. They don't care what technical solution is used. They don't care about CRIME or data security.
arcThey're making 10 million of these units, at minimum, so if they can save 10 cents that's a million dollar profit.
arcThey look at a big stack of money on one side, and a technician whining about standards compliance or user security on the other, they will choose the big stack of money every time.
arcThe only reason *some* of these manufacturers are using xml at all, and a very small number overall, is because exi can do the work with less code, less cpu, and less transmit power than message queues, which is what they would be using otherwise
neshtaxmpphas joined
moparisthebestright, I get why EXI is a win for bottom-of-the-barrel iot, still not sure if it's a win or not for generic federated xmpp chat client though
arcNobody is using it for general federated xmpp
moparisthebestyes but I'm wondering if it's worth pursing it for that though
Zashmoparisthebest, ~1MB chunks of XML sent to my phone something something would be nice if it was smaller
moparisthebestbut maybe regular compression solves it for you, and that's easy
arcHalf the time they just want http anyway. Because the software is free and HTTP is lightweight. And because their in-house developers already know it.
Zashbut then most of that consists of people sending presence to all the same MUCs that I'm in
arcZash, I agree with you. And it would likely turn the 1MB chunk into 1kb.
arcString tables are surprisingly efficient at jids
ZashFWIW this is with CSI buffering up unimportant stuff into larger chunks, that's how it gets so large.
moparisthebestarc, but "string tables" can't be used on public federated XMPP because they are vulnerable to CRIME, so they are out
fuanahas joined
arcI would say that you choose not to use it because you believe is impossible to implement with your security criteria in mind
Zashthe real question is, is CRIME really that bad?
arcAnd if I really cared I would have worked on it a long time ago
SamWhitedyah, honestly, after SASL is complete I'm not sure how much I care about CRIME-like vulnerabilities.
ZashIIRC you almost need to launch a DoS attack to get anything out of it, maybe just sprinkling some rate limits on top makes it all Good Enough
arcI am certain that there is an orchard full of hanging fruit for xmpp security, nobody will go through the effort
jonas’CRIME also gets less and less relevant with e2ee
jonas’(post-SASL that is)
ZashAnd good luck doing CRIME with SCRAM anyways
arcI mean, all the software that uses libxml2 should just be considered insecure by that very nature
moparisthebestmakes me pretty nervous to pretend CRIME isn't a threat... attacks only get better, never worse
arcGoogle was so certain of the fundamental insecurity of anything XML that they never even implemented encrypted S2S
ZashHuh. Source?
moparisthebestand actually I keep saying CRIME when BREACH is actually a better fit for what we are talking about https://en.wikipedia.org/wiki/BREACH
arcZash, source is the number of times I've had beer with Google developers
Zashmoparisthebest, C-ompression something something is easy to remember tho
fuanahas left
fuanahas joined
arcIn 2019 I had a drink with a few of the guys that previously worked on the gtalk/hangouts sre team, and I commented that it probably was a lot easier doing seculity with Go and it's brand new xml library. One of them shot his drink out his nose
arcThey apparently don't use XML internally anymore because of it
moparisthebestwell, google is well known for their poor decisions so :)
moparisthebestimagine taking advice from a company that created and killed 83 chat systems in the last 15 years
arcBut that's the thing, not once did they create one that actually works the way they wanted it to
arcAnd anything even remotely stable is just piled on mess over mess until they have to start over
SamWhitedThey are spot on with that one though, XML is absolute garbage in terms of being able to do a secure implementation. Way to big of an attack surface for something that should just be a way to transfer a tree…
SamWhitedNot that Google's dev practices or product management practices are always great, but they know their security.
StefanK$has joined
arcProtobuffs is wide open to attack too. They work around that with things like ucs4 and fixed length string entries
SamWhitedI'm not saying protobuf is perfect, I don't know much about them, just that they're not wrong about XML being bad.
moparisthebestXML is the worst except for everything else
SamWhitedNo, it's just worse than most other things. We're stuck with it for the base of XMPP, and I don't see anything else that works in a similar enough way to do a streaming protocol in as nice of a manner, but that doesn't mean it's not insecure garbage or that we shouldn't be *very* careful with it
arcXML is not bad by design. Is bad because nobody cares.
DebXWoodyhas joined
fuanahas left
Yagizahas left
SamWhitedI don't think that's true. Designs like hacking namespaces on and mixing them with attributes, adding things like proc insts, etc. are just bad.
arcI'm not saying that's not bad. I'm saying the XML suffers the same type of abandonment that led to heartbleed
papatutuwawahas joined
SamWhitedI mean, I'm sure nobody caring is a problem too, but I'd also say XML is just bad by design and therefore we need to be *very* careful about its use and not dismiss other peoples concerns about it so redily.
Andrzejhas joined
SamWhitedI just get mad every time somebody does the "it's just <> vs {}, why is HN so trendy?" or whatever in this room when realistically whatever they're complaining about is probably a serious problem that we should be addressing instead of being dismissive.
moparisthebestbut the "json is better than xml" people don't have any answers for all the ways in which json is worse
moparisthebestand you can s/json/anything/ there too
ZashMy langsec friend said something some time that I remember as "xml is okay, it's not made of length-prefixes and stuff"
SamWhitedSure, but that's not the problem, the problem is that we pretend that means XML is good somehow and then Go has the issue where namespaces can be manipulated and it's like the third time I've seen that in an XML decoder and somehow we just say "no, XML is fine, let's use more of it" every damn time
KevThe fundamental problem is that XML got so much stuff *right* that we’re stuck with the stuff it didn’t.
moparisthebest"bad libraries exist" is a thing
SamWhited"Every library is consistently bad in the same ways" is the actual problem.
arcOh I'm not dismissing anything. I'm just worn down by an industry that doesn't care until it nearly destroys them. I lead the Python xml-sig that produces code responsible for billion dollar industries. Those companies don't care. If the problem were made bluntly clear to them, they wouldn't fund anything. They would direct their technical teams to migrate to another language
moparisthebestbinary formats never have parsing vulnerabilities https://duckduckgo.com/?q=asn.1+parsing+vulnerabilities
SamWhitedBut I dunno, I just think XML is garbage in general outside of the security realm too and got next to nothing right. I accept it's the only thing we could use for a system like XMPP, but IMO we should literally never use more of it ever regardless of whether it's one of the parts that has consistent security issues or not
Zashasn1, the xml before xml, let's go back to it!
ZashIf only for the CRITICAL bit
mathijshas joined
ZashSamWhited, face it, everything we do is garbage held together with duct tape. That we haven't nuked/pandemic'd/burned ourselves into extinction yet is quite amazing. Probably because we invented duct tape 😀
SamWhitedyou're not wrong
arcThat and because we are hanging just above the low hanging fruit. Like vulnerabilities in cryptocurrency exchanges that allow people to steal millions of dollars in untraceable funds
StefanK$has left
ZashAt least it's our garbage. Our own! Our ... precious!
Zashpets pile of angle brackets.
arcSure people could attack xmpp. I imagine many of us could, knowing what we know. But there is no direct profit from doing so, and any scheme to profit from such an attack would be too complicated to pull off
moparisthebestI think this can be summarized as "computers are bad, formats don't matter" https://duckduckgo.com/?q=json+parsing+vulnerabilities https://duckduckgo.com/?q=xml+parsing+vulnerabilities
DebXWoodyhas left
DebXWoodyhas joined
Zashhttps://xkcd.com/2030/ comes to mind
SamWhitedThat's exactly the problem, "our entire field is bad" doesn't mean "so we should give up and use whatever we want and ignore the problems with specific formats because another one might also have problems or there might be an issue at some other layer of the stack"
moparisthebestbut, switching formats doesn't address the problem, you should just address the problem instead
Zash"our entire field" has existed for like half a century and usually doesn't directly kill people ... unless you count artillery trajectory calculations ... oh no
fuanahas joined
SamWhitedI didn't say we should switch formats, I said XML is what we've got and it's probably the only thing that works for XMPP but we shouldn't be dismissive when people point out problems with it and we shouldn't add more of it.
ZashSamWhited, and we shouldn't do what everyone else does and wrap it in JSON!
fuanahas left
fuanahas joined
ZashOh wait, oh no, https://xmpp.org/extensions/xep-0295.html
SamWhitedI mean, yah, we should definitely not implement XEP-02395 :)
SamWhitederr, 0295
APachhas left
APachhas joined
arcNo Sam. We should fix it. Here I'll put it on my giant stack of things I care about that will never earn a cent, will not improve my chances of getting hired, would take the rest of all of our lifetimes, and leave us living on the street.
fuanahas left
KevAlthough 295 was obviously a joke, I note that the first suggested encoding pretty much works, and actually avoids some of the security issues of XML ;)
ZashThe one that looks a bit like JSON-LD?
arcI do really care about these things. I'm not completely jaded. I think a lot of people really care about these things. I'm pointing out that we need to solve some lower-level fundamental problems first.
KevZash? Does it? Yes, anyway. The one that isn’t entirely stupid.
KevWhen I wrote it I didn’t think of it in terms of having benefit over the XML representation, but it *does* eliminate whole classes of security issues.