ejabberd - Comments for "Ejabberd Issue - Anonymous user can send presence stanza to roster member" https://www.ejabberd.im/node/3956 en Check mod_filter example 4 https://www.ejabberd.im/node/3956#comment-55566 <div class="quote-msg"> <div class="quote-author"><em>adil</em> wrote:</div> <p>Ok, can you give me an idea of how to make this mod_filter. My criteria is to exchange presence on MUC but not outside. How can i enforce that?</p></div> <p>Check the <noindex><a href="/mod_filter" rel="nofollow" >mod_filter page</a></noindex>, specially the example 4 which I wrote specifically for your case. Download the module, install, configure.</p> Mon, 12 Apr 2010 10:50:45 +0000 mfoss comment 55566 at https://www.ejabberd.im I see https://www.ejabberd.im/node/3956#comment-55555 <div class="quote-msg"> <div class="quote-author">Quote:</div> <p>The second link is the authoritative RFC, that ejabberd must obey. As it has hundreds of pages, can you mark in what paragraph you read that "an anonymous user can't send a presence stanza to an internally-registered user"? In the whole RFC, the word 'anonymous' is never mentioned.</p></div> <p>Actually its the first para that got me confused "In order to protect the privacy of instant messaging users and any other entities, presence and availability information is disclosed only to other entities that the user has approved."</p> <p>You're right, it doesn't mean anon cannot send a presence to another user.</p> <p>Ok, can you give me an idea of how to make this mod_filter. My criteria is to exchange presence on MUC but not outside. How can i enforce that?</p> Sat, 10 Apr 2010 14:07:36 +0000 adil comment 55555 at https://www.ejabberd.im Are you sure the restriction was implemented in 2.0.0? https://www.ejabberd.im/node/3956#comment-55528 <p>The first is a forum link. It can be indicative, but not authoritative.</p> <p>The second link is the authoritative RFC, that ejabberd must obey. As it has hundreds of pages, can you mark in what paragraph you read that "an anonymous user can't send a presence stanza to an internally-registered user"? In the whole RFC, the word 'anonymous' is never mentioned.</p> <div class="quote-msg"> <div class="quote-author"><em>adil</em> wrote:</div> <p>What i meant to emphasize is that users outside the roster of a member cannot send them a presence. </p></div> <p>False. The RFC 3921 says: "a client MAY send directed presence information to another entity by including a 'to' address".</p> <p>I've verified this works both in ejabberd 2.1.3 and 2.0.1. That's the oldest version I can get to run, and I don't see any relevant change between 2.0.0 and 2.0.1.</p> <p>I configured similar to you. someone@anon.localhost/work logins, has an empty roster, and sends:</p> <pre> &lt;presence xml:lang='es' to='badlop@localhost/work'&gt; &lt;show&gt;away&lt;/show&gt; &lt;priority&gt;8&lt;/priority&gt; &lt;status&gt;asdasd&lt;/status&gt; &lt;/presence&gt; </pre><p> badlop@localhost/work receives the stanza, as described in RFC:</p> <pre> &lt;presence from='someone@anon.localhost/work' to='badlop@localhost/work' xml:lang='es'&gt; &lt;show&gt;away&lt;/show&gt; &lt;priority&gt;8&lt;/priority&gt; &lt;status&gt;asdasd&lt;/status&gt; &lt;/presence&gt; </pre><div class="quote-msg"> <div class="quote-author"><em>adil</em> wrote:</div> <p>That seems correct and isn't that the point of the roster anyway? </p></div> <p>Each concept has a purpose: a presence stanza carries presence information. A presence subscription indicates that a contact wants to get the user presence information and the user granted permission to do so. A roster is a list of roster items, which can have different presence subscriptions each.</p> <div class="quote-msg"> <div class="quote-author"><em>adil</em> wrote:</div> <p>It used to be in 2.0.0 that a logged-in anon user(user1234@public.socialnetwork.com/webchat) cannot send presence stanzas to the social network user (member1234@socialnetwork.com/webchat). </p></div> <p>Are you sure it was ejabberd 2.0.0 code who was blocking delivery of such stanzas? Maybe it was the client itself who implemented that restriction: Don't accepts incoming presence stanzas from users that aren't in my roster.</p> <div class="quote-msg"> <div class="quote-author"><em>adil</em> wrote:</div> <p>We allow anon guys to chat, and exchange presence, with social network users using MUC. Once the SN user has left the MUC, the anon chat user should not be able to send a presence stanza. This used to work as expected in v2.0.0 without any mods. Is this possible now? </p></div> <p>As I said, maybe mod_filter can be configured or customized to implement such restriction.</p> Fri, 09 Apr 2010 12:04:00 +0000 mfoss comment 55528 at https://www.ejabberd.im Anonymous Vhost and Member Vhost is different https://www.ejabberd.im/node/3956#comment-55515 <div class="quote-msg"> <div class="quote-author"><em>badlop</em> wrote:</div> <p>In other words: where did you read/infer that anonymous-authenticated accounts must not be able to send presence to another password-authenticated users?</p></div> <p><noindex><a href="http://stackoverflow.com/questions/1958763/how-can-anonymous-users-exchange-presence-information-with-valid-users-on-jabber" title="http://stackoverflow.com/questions/1958763/how-can-anonymous-users-exchange-presence-information-with-valid-users-on-jabber" rel="nofollow" >http://stackoverflow.com/questions/1958763/how-can-anonymous-users-excha...</a></noindex>. </p> <p>and</p> <p><noindex><a href="http://xmpp.org/rfcs/rfc3921.html#sub" title="http://xmpp.org/rfcs/rfc3921.html#sub" rel="nofollow" >http://xmpp.org/rfcs/rfc3921.html#sub</a></noindex> (Section 6)</p> <p>What i meant to emphasize is that users outside the roster of a member cannot send them a presence. That seems correct and isn't that the point of the roster anyway? </p> <p>Now, my site is setup to use two separate vhosts for chat. Their setup is as follows :</p> <div class="codeblock"><code> {hosts, [&quot;socialnetwork.com&quot;,&quot;public.socialnetwork.com&quot;]}. <p>{host_config, &quot;public.socialnetwork.com&quot;, [{auth_method, anonymous},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {allow_multiple_connections, false},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {anonymous_protocol, sasl_anon}]}.</p></code></div> <p>It used to be in 2.0.0 that a logged-in anon user(user1234@public.socialnetwork.com/webchat) cannot send presence stanzas to the social network user (member1234@socialnetwork.com/webchat). We allow anon guys to chat, and exchange presence, with social network users using MUC. Once the SN user has left the MUC, the anon chat user should not be able to send a presence stanza. This used to work as expected in v2.0.0 without any mods. Is this possible now?</p> Wed, 07 Apr 2010 13:35:53 +0000 adil comment 55515 at https://www.ejabberd.im adil wrote: I was under the https://www.ejabberd.im/node/3956#comment-55469 <div class="quote-msg"> <div class="quote-author"><em>adil</em> wrote:</div> <p>I was under the assumption that an anonymous user cannot send a presence stanza to a registered user without a roster subscription. But using Ejabberd 2.1.2 this is happening.</p></div> <p>First a user logins to an account in the XMPP server, for example testuser1@myserver. Then he can send stanzas (presence, message, iq).</p> <p>The server usually requires the user to provide a password to verify he owns the account testuser1. Alternatively, the server can be configured to relax this requirement: do not require any password at all, or accept any password as valid. In any case, once the user is authenticated in the server, why shouldn't he be able to use all the possibilities already offered by the server to password-verified accounts?</p> <p>In other words: where did you read/infer that anonymous-authenticated accounts must not be able to send presence to another password-authenticated users?</p> <div class="quote-msg"> <div class="quote-author"><em>adil</em> wrote:</div> <p>How do i stop anonymous users from sending presence stanzas to registered users?</p></div> <p>I think such restriction isn't configurable.</p> <p>There is a workaround. I assume you have now one vhost that uses mixed auth: internal+anonymous. You could split it in two vhosts: one for internal auth users, and other for anonymous users. And then, configure somehow that presence stanzas from vhost2 to vhost1 to be dropped. Maybe mod_filter or other small module can be configured or modified to do this.</p> Mon, 29 Mar 2010 12:06:26 +0000 mfoss comment 55469 at https://www.ejabberd.im Help Please https://www.ejabberd.im/node/3956#comment-55458 <p>Can somebody take a look at this question please.</p> Sun, 28 Mar 2010 11:12:11 +0000 adil comment 55458 at https://www.ejabberd.im