Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SASL2: Stable resource is used if no user-agent id is set. #4195

Open
mdosch opened this issue Apr 7, 2024 · 8 comments
Open

SASL2: Stable resource is used if no user-agent id is set. #4195

mdosch opened this issue Apr 7, 2024 · 8 comments

Comments

@mdosch
Copy link

mdosch commented Apr 7, 2024

Environment

  • ejabberd version: 24.02.17-messaging.one
  • Erlang version: unknown
  • OS: unix/linux 6.1.0
  • Installed from: unknown

@weiss might fill the gaps if necessary.

Configuration (only if needed): grep -Ev '^$|^\s*#' ejabberd.yml

unknown

Errors from error.log/crash.log

unknown

Bug description

Clients SHOULD also include a element, informing the server about the connecting client. The 'id' attribute is RECOMMENDED, and if present contains a unique stable identifier for the client installation. The contents of the 'id' attribute MUST be a UUID v4. This allows the server to provide functionality such as deriving stable resource identifiers (see Bind 2.0 (XEP-0386) [5]).
https://xmpp.org/extensions/xep-0388.html#initiation

Ejabberd is providing a stable resource although no id attribute is set in the user-agent element.

@prefiks
Copy link
Member

prefiks commented Apr 8, 2024

I fixed this recently in processone/xmpp@1b1418a

@mdosch
Copy link
Author

mdosch commented Apr 8, 2024 via email

@prefiks
Copy link
Member

prefiks commented Apr 8, 2024

This change is not yet available in ejabberd, it was added to library that ejabberd uses, but ejabberd uses version of that library from before that change was introduced.

And this change should also be triggered case where there is missing/empty id in user-agent

@weiss
Copy link
Member

weiss commented Apr 8, 2024

@mdosch, messaging.one now has the commit in question, just in case you'd like to test it. If things look fine, this issue could be closed I guess.

@mdosch
Copy link
Author

mdosch commented Apr 8, 2024

Seems to still set a stable resource in absence of user-agent id:

<authenticate xmlns='urn:xmpp:sasl:2' mechanism='SCRAM-SHA-1-PLUS'><initial-response>cD10bHMtZXhwb3J0ZXIsLG49bWRvc2NoLHI9ODk2OWQ3ZjcyOWQzOTRiZA==</initial-response><user-agent><software>go-sendxmpp</software></user-agent><bind xmlns='urn:xmpp:bind:0'><tag>go-sendxmpp</tag></bind></authenticate>
[…]
<success xmlns='urn:xmpp:sasl:2'><bound xmlns='urn:xmpp:bind:0'/><authorization-identifier>mdosch@messaging.one/go-sendxmpp.xuIUkF6Ve2</authorization-identifier><additional-data>dj1PdHVqU0dCSWo5WnUwMHJEWEh6NWFsWHljR3c9</additional-data></success>
<authenticate xmlns='urn:xmpp:sasl:2' mechanism='SCRAM-SHA-1-PLUS'><initial-response>cD10bHMtZXhwb3J0ZXIsLG49bWRvc2NoLHI9OGJiYzYxODE1NmM1ZmRlOA==</initial-response><user-agent><software>go-sendxmpp</software></user-agent><bind xmlns='urn:xmpp:bind:0'><tag>go-sendxmpp</tag></bind></authenticate>
[…]
<success xmlns='urn:xmpp:sasl:2'><bound xmlns='urn:xmpp:bind:0'/><authorization-identifier>mdosch@messaging.one/go-sendxmpp.xuIUkF6Ve2</authorization-identifier><additional-data>dj04NkV2OXlUYk1VckdDdjRmR1RXZGd6UWd4YlU9</additional-data></success>

@prefiks
Copy link
Member

prefiks commented Apr 8, 2024

Hm, i will see if i can reproduce that then, but from looking at what code does i though we should be skip code that does that without id.

@prefiks
Copy link
Member

prefiks commented Apr 8, 2024

Looks like i had a typo that didn't properly detect empty id - fixed in processone/xmpp@12a2e3f

@mdosch
Copy link
Author

mdosch commented Apr 8, 2024 via email

@badlop badlop added this to the ejabberd 24.xx milestone Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants