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

Server mode: from="localhost" in IQ replies confuses clients #159

Open
dequis opened this issue Jul 23, 2016 · 5 comments
Open

Server mode: from="localhost" in IQ replies confuses clients #159

dequis opened this issue Jul 23, 2016 · 5 comments
Labels

Comments

@dequis
Copy link

dequis commented Jul 23, 2016

"localhost" being the value of service.jid in the config, that is.

Pidgin:

(18:04:22) jabber: Sending
<iq type='get' id='purple56177e38'><query xmlns='jabber:iq:roster'/></iq>
[...]
(18:04:22) jabber: Recv (787):
<iq from="localhost" id="purple56177e38" to="rqsskek_narayananwitz_1450582457%tfbnw.net@localhost/uzeeytufhd" type="result"><query xmlns="jabber:iq:roster"><item jid="100010841476193@localhost" name="Ruth Alajhdadgfaic Riceman" subscription="both"><group>Buddies</group></item><item jid="100010849335141@localhost" name="James Alajhdicceada Chengescu" subscription="both"><group>Buddies</group></item><item jid="100010870422970@localhost" name="Mary Alajhgjdbbigj Seligsteinwitz" subscription="both"><group>Buddies</group></item><item jid="100010924566904@localhost" name="Susan Alajibdeffijd Sadanson" subscription="both"><group>Buddies</group></item><item jid="100010934405934@localhost" name="Nancy Alajicddjeicd Chaiman" subscription="both"><group>Buddies</group></item></query></iq>
(18:04:22) jabber: Received bogon roster push from localhost

From the pidgin source:

void jabber_roster_parse(JabberStream *js, const char *from,
                         JabberIqType type, const char *id, xmlnode *query)
{
    xmlnode *item, *group;

    if (!jabber_is_own_account(js, from)) {
        purple_debug_warning("jabber", "Received bogon roster push from %s\n",
                             from);
        return;
    }

jabber_is_own_account succeeds if "from" is either NULL (the attribute is missing, which is how things should be normally) or the users's own JID (this is probably for compatibility with some broken servers, a bug points at "studivz" behaving like that).

Similar issue, with gajim:

<!-- In Sat 23 Jul 2016 07:05:01 PM ART -->
<iq from="localhost" id="Gajim_18" to="rqsskek_narayananwitz_1450582457%tfbnw.net@localhost/dfwgxfszwm" type="result">
<query xmlns="http://jabber.org/protocol/disco#items"/>
</iq>

Debug output says:

07/23/2016 19:05:01 (I) gajim.c.p.caps Received Disco from unknown contact localhost

And for some reason I didn't quite figure out (but i'm betting it's related to this), it doesn't seem to load the contact list even though the roster processing code seems to succeed. I think gajim thinks the login isn't over.

@banexx
Copy link

banexx commented Jan 31, 2018

I am using version 2.0.5 and can confirm that problem.
Messages from Skype are coming through nicely as far as I can tell. Of course as the roster is empty pidgin throws a lot of messages a la

Got presence for unknown buddy xxxxxxx@localhost on account yyyyyy@localhost/ (0xabcdef12345)

Is this actually a spectrum or a Swiften problem?

@vitalyster
Copy link
Collaborator

Actually, there are two different issues: original issue is the purple-jabber problem, which doesn't follow RFC rules for IQ
While your issue is purple-skypeweb related: presences are generated before contacts actually received, and need more debugging to understand why.

@dequis
Copy link
Author

dequis commented Jan 31, 2018

Actually, there are two different issues: original issue is the purple-jabber problem, which doesn't follow RFC rules for IQ

@vitalyster hm, could you be more specific? jabber_is_own_account sounds correct going by point 3 of the link - it expects bare jid or nothing.

To be clear, the prpl used in spectrum in the original issue is facebook (not really relevant, anyway). purple-jabber is only involved as the XMPP client part of pidgin, but gajim also showed the same behavior.

@banexx
Copy link

banexx commented Jan 31, 2018

Hi @vitalyster,
thanks for the quick response.

I cross-checked the response to some public servers and this is the response
from spectrum

(23:40:58) jabber: Sending (xxxxxxxx@localhost/imdonybqus): <iq type='get' id='purplec67843de'><query xmlns='jabber:iq:roster'/></iq>
(23:40:58) jabber: Recv (4095): <iq from="localhost" id="purplec67843de" to="xxxxxxx@localhost/imdonybqus" type="result"><query xmlns="jabber:iq:roster"><item jid=....

from public server running ejabberd

(23:50:14) jabber: Sending (ssl) (xxxxxxxx@jabber.ccc.de/def): <iq type='get' id='purplec67843de'><query xmlns='jabber:iq:roster'/></iq>
(23:50:14) jabber: Recv (ssl)(1971): <iq xml:lang='en' to='xxxxxxx@jabber.ccc.de/def' from='xxxxxxxx@jabber.ccc.de' type='result' id='purplec67843de'><query xmlns='jabber:iq:roster'><item subscription=

Please correct me if I'm wrong, but if I ask the server for an info, which I do here, then it should generate a stanza on behalf of the client and should behave like described in point 3.

As for the presence, I guess there is another issue that I can comment on, so I won't spam this one.

@vitalyster
Copy link
Collaborator

Agreed, it's a spectrum server issue

@vitalyster vitalyster added the Bug label Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants