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

mod_pubsub_serverinfo should check before publishing domains #332

Open
guusdk opened this issue Mar 14, 2024 · 2 comments
Open

mod_pubsub_serverinfo should check before publishing domains #332

guusdk opened this issue Mar 14, 2024 · 2 comments

Comments

@guusdk
Copy link
Contributor

guusdk commented Mar 14, 2024

mod_pubsub_serverinfo implements XEP-0485: PubSub Server Information. The mod publishes the names of domains with which it federates.

The XEP contains this privacy consideration:

When multiple domains publish their connections to named remote domains, an information leak occurs: by collecting these public statistics, behavioral data of those remote domains can be deduced. To prevent undesired privacy-sensitive information leaks, a domain MUST NOT publish the name of a remote domain, unless that domain advertises support for this XEP (...)

The implementation of mod_pubsub_serverinfo does not perform this check: it always publish the name of a the remote domains.

A modification should be made so that the name attribute of a remote-domain element is added only after support the XEP has been detected. Support can be detected by performing a disco/info query to the remote domain, and check for the presence of the feature urn:xmpp:serverinfo:0 (as specified here)

prefiks added a commit that referenced this issue Apr 8, 2024
@prefiks
Copy link
Member

prefiks commented Apr 8, 2024

This should be fixed by a3265f5

@prefiks prefiks closed this as completed Apr 8, 2024
@guusdk
Copy link
Contributor Author

guusdk commented May 6, 2024

Hi @prefiks - apologies for the late response. It took me a while to test this. I believe that this change is over-doing it. The pub/sub data published by this version of the module now excludes domains that do not support the feature completely. That's undesired. Instead, we'd like to still have remote-domain elements for every connection, but those elements should only have a name attribute when the remote supports our protocol.

With your changes, this is logged on a server that has many server-to-server connections (note that it shows only one connection, to a remote domain that supports the feature):

<message to="xmppnetwork.goodbytes.im/networkinfocrawler" from="pubsub.example.org" type="headline">
    <event xmlns="http://jabber.org/protocol/pubsub#event">
        <items node="serverinfo">
            <item id="current">
                <serverinfo xmlns="urn:xmpp:serverinfo:0">
                    <domain name="example.org">
                        <federation>
                            <remote-domain name="igniterealtime.org">
                                <connection type="incoming"/>
                            </remote-domain>
                        </federation>
                    </domain>
                </serverinfo>
            </item>
        </items>
    </event>
</message>

Instead, we expect to see something like this (manually crafted example, excuse any error):

<message to="xmppnetwork.goodbytes.im/networkinfocrawler" from="pubsub.example.org" type="headline">
    <event xmlns="http://jabber.org/protocol/pubsub#event">
        <items node="serverinfo">
            <item id="current">
                <serverinfo xmlns="urn:xmpp:serverinfo:0">
                    <domain name="example.org">
                        <federation>
                            <remote-domain name="igniterealtime.org">
                                <connection type="incoming"/>
                            </remote-domain>
                            <remote-domain>
                                <connection type="incoming"/>
                            </remote-domain>
                            <remote-domain>
                                <connection type="incoming"/>
                            </remote-domain>
                            <remote-domain>
                                <connection type="incoming"/>
                            </remote-domain>
                            <remote-domain>
                                <connection type="incoming"/>
                            </remote-domain>
                            <remote-domain>
                                <connection type="incoming"/>
                            </remote-domain>
                        </federation>
                    </domain>
                </serverinfo>
            </item>
        </items>
    </event>
</message>

@weiss weiss reopened this May 16, 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

3 participants