No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0287.xml 17KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Spim Markers and Reports</title>
  10. <abstract>This document defines an XMPP protocol extension that enables XMPP entities to interact with spim filters by marking unsolicited or suspicious XMPP stanzas.</abstract>
  12. <number>0287</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. <spec>XEP-0001</spec>
  20. <spec>XEP-0030</spec>
  21. </dependencies>
  22. <supersedes/>
  23. <supersededby/>
  24. <shortname>NOT_YET_ASSIGNED</shortname>
  25. <author>
  26. <firstname>Evgeniy</firstname>
  27. <surname>Khramtsov</surname>
  28. <email></email>
  29. <jid></jid>
  30. </author>
  31. <revision>
  32. <version>0.1</version>
  33. <date>2010-10-04</date>
  34. <initials>psa</initials>
  35. <remark><p>Initial published version.</p></remark>
  36. </revision>
  37. <revision>
  38. <version>0.1</version>
  39. <date>2010-09-13</date>
  40. <initials>evk</initials>
  41. <remark><p>Initial version.</p></remark>
  42. </revision>
  43. </header>
  44. <section1 topic='Introduction' anchor='intro'>
  45. <p>There are various spim protection methods exist in XMPP: &xep0016;, &xep0158;, &xep0191;, &xep0268; and &xep0275;. But they may not be sufficient enough:</p>
  46. <ul>
  47. <li>&xep0016; and &xep0191; define blocking mechanism only which is not always appropriate.</li>
  48. <li>&xep0158; interacts badly with automated software such as gateways.</li>
  49. <li>&xep0268; implies trusted network of servers.</li>
  50. <li>&xep0275; concentrates on ranking only.</li>
  51. </ul>
  52. <p>Service administrators might want to deploy server-based spim recognition software to fill in the gaps. However, every automated spim recognition suffers from <em>false positives</em> - situations where a stanza incorrectly qualified as spim. To avoid them, a spim filter doesn't block suspicious stanza, but marks it and sends to a client in a regular manner. A client software doesn't need to interrupt a user when processing such marked stanzas: for example, it may put them silently in "SPAM" folder, so a user can look through them at any time later. Furthermore, a spim filter may take user's experience into account. When a user receives an unsolicited stanza, he or she can mark it as spim. In this case a client software sends an automatic complaint to a server-based spim filter. This specification deals with both cases. Thus, in contrast to &xep0159;, it doesn't introduce any spim blocking techniques. Also, the various spim recognition procedures that may be employed by the server are beyond the scope of this document.</p>
  53. </section1>
  54. <section1 topic='Requirements' anchor='reqs'>
  55. <p>An implementation compliant with this document MUST support spim markers as described in <link url='#spim-marker'>Spim Marker</link> use case. Support for spim reports, as described in <link url='#spim-report'>Spim Report</link> use case, is RECOMMENDED.</p>
  56. </section1>
  57. <section1 topic='Glossary' anchor='glossary'>
  58. <p>The following terms are used throughout this document:</p>
  59. <dl>
  60. <di><dt>Filtering Entity</dt><dd>An XMPP entity which performs spim recognitions, blocks or marks suspicious stanzas and accepts spim reports. Example: a server or an external component with built-in spim recognition module.</dd></di>
  61. <di><dt>Receiving Entity</dt><dd>An XMPP entity which directly receives marked stanzas and sends spim reports. Example: a client or a conference (&xep0045;).</dd></di>
  62. </dl>
  63. </section1>
  64. <section1 topic='Use Cases' anchor='usecases'>
  65. <section2 topic='Spim Marker' anchor='spim-marker'>
  66. <p>The filtering entity marks abusive stanza by adding &lt;mark/&gt; child element qualified by the 'urn:xmpp:spim-marker:0' namespace. The element MUST possess the 'filter' attribute whose value MUST be a full jid of the filtering entity. The &lt;mark/&gt; element MAY contain character data which SHOULD be a human-readable description of the reason to mark. The filtering entity MUST NOT add more than one &lt;mark/&gt; element and MUST delete all other &lt;mark/&gt; elements matching itself before adding a new one. The filtering entity MAY remove any &lt;mark/&gt; elements matching itself even if it doesn't add a new one.</p>
  67. <example caption="User's Server Marked Abusive Message"><![CDATA[
  68. <message from=''
  69. to=''
  70. id='spam1'>
  71. <body>Love pills - 75% OFF</body>
  72. <mark xmlns='urn:xmpp:spim-marker:0'
  73. filter=''/>
  74. Unsolicited advertising
  75. </mark>
  76. </message>
  77. ]]></example>
  78. <example caption="Several Services Marked Abusive Message"><![CDATA[
  79. <message from=''
  80. to=''
  81. id='spam1'>
  82. <subject>You won $1,000,000!</subject>
  83. <body>Visit</body>
  84. <mark xmlns='urn:xmpp:spim-marker:0'
  85. filter=''>
  86. Blocked by too many DNSBLs
  87. </mark>
  88. <mark xmlns='urn:xmpp:spim-marker:0'
  89. filter=''/>
  90. </message>
  91. ]]></example>
  92. <p>Processing rules of marked stanzas taken by the receiving entity are beyond the scope of this document. One possible solution is to put such stanzas silently in so-called "SPAM" folder.</p>
  93. </section2>
  94. <section2 topic='Spim Report' anchor='spim-report'>
  95. <p>If the filtering entity wishes to receive abuse report for the stanza, it MUST add &lt;report/&gt; child element qualified by the 'urn:xmpp:spim-report:0' namespace and MUST possess the 'key' and the 'filter' attributes. A value of the 'key' attribute is arbitrary, but SHOULD have at least 128 bits of randomness. The 'key' attribute is needed to match the corresponding complaint (if any) with the sender. The value of the 'filter' attribute MUST be a full jid of the filtering entity. The filtering entity MUST NOT add more than one &lt;report/&gt; element and MUST delete all other &lt;report/&gt; elements matching itself before adding a new one. The filtering entity MAY remove any &lt;report/&gt; elements matching itself even if it doesn't add a new one.</p>
  96. <example caption="Multiple Filters Wishes to Receive Abuse Report"><![CDATA[
  97. <presence type='subscribe'
  98. from=''
  99. to=''
  100. id='spam2'>
  101. <report xmlns='urn:xmpp:spim-report:0'
  102. key='571c9641d8442920'
  103. filter=''/>
  104. <report xmlns='urn:xmpp:spim-report:0'
  105. key='b258acbcb4bb8e66ac'
  106. filter=''/>
  107. </presence>
  108. ]]></example>
  109. <p>The receiving entity MAY complain by sending an IQ-set containing the &lt;query/&gt; child element qualified by the 'urn:xmpp:spim-report:0' namespace. A value of the 'filter' attribute MUST be copied in the 'to' attribute of the IQ-set stanza. The element MUST possess 'key' attribute copied from the original stanza.</p>
  110. <p>The receiving entity MUST ignore any &lt;report/&gt; elements generated by untrusted filtering entities. If there are more than one &lt;report/&gt; element matching the same filtering entity, all of them MUST be ignored.</p>
  111. <example caption="Receiver Sends Complaint"><![CDATA[
  112. <iq type='set'
  113. from=''
  114. to=''
  115. id='complaint1'>
  116. <query xmlns='urn:xmpp:spim-report:0'
  117. key='571c9641d8442920'/>
  118. </iq>
  119. <iq type='set'
  120. from=''
  121. to=''
  122. id='complaint2'>
  123. <query xmlns='urn:xmpp:spim-report:0'
  124. key='b258acbcb4bb8e66ac'/>
  125. </iq>
  126. ]]></example>
  127. <p>The filtering entity MUST respond with an empty IQ-result stanza upon successful completion of the request:</p>
  128. <example caption="Complaint Was Accepted"><![CDATA[
  129. <iq type='result'
  130. from=''
  131. to=''
  132. id='complaint1'/>
  133. <iq type='result'
  134. from=''
  135. to=''
  136. id='complaint2'/>
  137. ]]></example>
  138. </section2>
  139. </section1>
  140. <section1 topic='Business Rules' anchor='rules'>
  141. <p>A filtering entity SHOULD only add &lt;mark/&gt; or &lt;report/&gt; elements and a receiving entity SHOULD only process those elements if the corresponding stanza envolves an interaction with a human user: subscription requests, messages, conference invites, voice calls, etc. For example, it doesn't make a lot of sense to mark &xep0232; stanzas.</p>
  142. <p>To avoid obvious false positives and user confusions, a filtering entity SHOULD NOT add &lt;mark/&gt; or &lt;report/&gt; elements to a stanza and a receiving entity SHOULD ignore &lt;mark/&gt; and &lt;report/&gt; elements of a stanza if:</p>
  143. <ul>
  144. <li>The receiving entity has the sender's subscription information of the type "both", "from" or "to".</li>
  145. <li>The receiving entity has pending subscription to the sender, i.e. subscription of type "none" and ask='subscribe'.</li>
  146. <li>The receiving entity has sent direct presence to the sender.</li>
  147. </ul>
  148. </section1>
  149. <section1 topic='Determining Support' anchor='support'>
  150. <p>If an entity supports the spim markers, it MUST report that by including a service discovery feature of "urn:xmpp:spim-marker:0" in response to a &xep0030; information request. If an entity supports the spim reports, it MUST report that by including a service discovery feature of "urn:xmpp:spim-report:0" in response to a &xep0030; information request:</p>
  151. <example caption="Service Discovery Information Request"><![CDATA[
  152. <iq type='get'
  153. from='juliet@capulet.lit/balcony'
  154. to='capulet.lit'
  155. id='disco1'>
  156. <query xmlns=''/>
  157. </iq>
  158. ]]></example>
  159. <example caption="Service Discovery Information Response"><![CDATA[
  160. <iq type='result'
  161. from='capulet.lit'
  162. to='juliet@capulet.lit/balcony'
  163. id='disco1'>
  164. <query xmlns=''>
  165. ...
  166. <feature var='urn:xmpp:spim-marker:0'/>
  167. <feature var='urn:xmpp:spim-report:0'/>
  168. ...
  169. </query>
  170. </iq>
  171. ]]></example>
  172. </section1>
  173. <!--
  174. <section1 topic='Implementation Notes' anchor='impl'>
  175. <p>OPTIONAL.</p>
  176. </section1>
  177. <section1 topic='Accessibility Considerations' anchor='access'>
  178. <p>OPTIONAL.</p>
  179. </section1>
  180. <section1 topic='Internationalization Considerations' anchor='i18n'>
  181. <p>OPTIONAL.</p>
  182. </section1>
  183. -->
  184. <section1 topic='Security Considerations' anchor='security'>
  185. <section2 topic='CAPTCHA challenges' anchor='captcha-challenges'>
  186. <p>Care should be taken if a receiving entity chooses to generate a CAPTCHA challenge (&xep0158;) in response to a marked stanza. A spim recognition system rarely has more than 5-10% of false positives. Thus, producing CAPTCHA images or audio/video samples is likely a waste of system resources and also may overload the receiving entity at high rate of spim stanzas.</p>
  187. </section2>
  188. <section2 topic='Fake &lt;mark/&gt; element' anchor='fake-mark-element'>
  189. <p>A rogue server may add fake &lt;mark/&gt; elements to compromise filtering entities: a user may decide to remove such entities from the trusted list because, for example, he or she thinks they produce too many false positives. To avoid such situation, a filtering entity MUST remove any &lt;mark/&gt; elements matching itself before adding new &lt;mark/&gt; element as described in <link url='#spim-marker'>Spim Marker</link> use case. Also, a filtering entity MAY remove any &lt;mark/&gt; elements matching itself even if it doesn't add a new one.</p>
  190. </section2>
  191. <section2 topic='Fake &lt;report/&gt; element' anchor='fake-report-element'>
  192. <p>An attacker may add fake &lt;report/&gt; element. For example, it may do that for checking an activity of the user. To avoid such situation, a receiving entity MUST send spim reports to the trusted filtering entities only as desribed in <link url='#spim-report'>Spim Report</link> use case.</p>
  193. </section2>
  194. <section2 topic='Multiple fake &lt;report/&gt; elements' anchor='multiple-fake-reports'>
  195. <section3 topic='Single filtering entity' anchor='multiple-reports-single'>
  196. <p>An attacker may add thousands of fake &lt;report/&gt; elements matching the single trusted filtering entity in one stanza. A poorly written receiving entity may generate a complaint for all of them. As an effect, a distributed DoS attack on the filtering entity is performed if there are multiple receiving entities envolved. To avoid such situation, a receiving entity MUST ignore multiple &lt;report/&gt; elements matching the same filtering entity as desribed in <link url='#spim-report'>Spim Report</link> use case.</p>
  197. <p>In its turn, a filtering entity MUST remove any &lt;report/&gt; elements matching itself before adding new &lt;report/&gt; element as described in <link url='#spim-report'>Spim Report</link> use case. Thus, it is guaranteed that the element will not be ignored by the receiving entity.</p>
  198. </section3>
  199. <section3 topic='Several filtering entities' anchor='multiple-reports-several'>
  200. <p>An attacker may gain an information about user's trusted filtering entities. In this case he or she may add the &lt;report/&gt; element per every such entity in one stanza. If there are too many filtering entities in the list, a user may generate enormous traffic when generating spim reports. Although this attack is not very effective, a client software MUST not generate spim reports without user's acknowledgement.</p>
  201. </section3>
  202. </section2>
  203. <section2 topic='Fake IQ-set report' anchor='fake-iq-set-report'>
  204. <p>An attacker may try to mark an innocent user as a spimmer by producing several IQ-set stanzas qualified by "urn:xmpp:spim-report:0" containing different value of the 'key' attribute each (so-called "dictionary attack"). As a protection, sanity checks MUST be performed when processing such reports. For example, if a filtering entity doesn't store any information about a receiving entity, the value of the 'key' attribute SHOULD have at least 128 bits of randomness.</p>
  205. </section2>
  206. </section1>
  207. <section1 topic='IANA Considerations' anchor='iana'>
  208. <p>This document requires no interaction with &IANA;.</p>
  209. </section1>
  210. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  211. <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
  212. <p>This specification defines the following XML namespaces:</p>
  213. <ul>
  214. <li>urn:xmpp:spim-marker:0</li>
  215. <li>urn:xmpp:spim-report:0</li>
  216. </ul>
  217. <p>Upon advancement of this specification from a status of Experimental to a status of Draft, the &REGISTRAR; shall add the foregoing namespace to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.</p>
  218. </section2>
  219. </section1>
  220. <section1 topic='XML Schema' anchor='schema'>
  221. <section2 topic='urn:xmpp:spim-marker:0' anchor='schema-marker'>
  222. <code><![CDATA[
  223. <?xml version='1.0' encoding='UTF-8'?>
  224. <xs:schema
  225. xmlns:xs=''
  226. targetNamespace='urn:xmpp:spim-marker:0'
  227. xmlns='urn:xmpp:spim-marker:0'
  228. elementFormDefault='qualified'>
  229. <xs:annotation>
  230. <xs:documentation>
  231. The protocol documented by this schema is defined in
  232. XEP-xxxx:
  233. </xs:documentation>
  234. </xs:annotation>
  235. <xs:element name='mark'>
  236. <xs:complexType>
  237. <xs:simpleContent>
  238. <xs:extension base='xs:string'>
  239. <xs:attribute
  240. name='filter'
  241. type='xs:string'
  242. use='required'/>
  243. <xs:attribute
  244. name='reason'
  245. type='xs:string'
  246. use='optional'/>
  247. </xs:extension>
  248. </xs:simpleContent>
  249. </xs:complexType>
  250. </xs:element>
  251. </xs:schema>
  252. ]]></code>
  253. </section2>
  254. <section2 topic='urn:xmpp:spim-report:0' anchor='schema-report'>
  255. <code><![CDATA[
  256. <?xml version='1.0' encoding='UTF-8'?>
  257. <xs:schema
  258. xmlns:xs=''
  259. targetNamespace='urn:xmpp:spim-report:0'
  260. xmlns='urn:xmpp:spim-report:0'
  261. elementFormDefault='qualified'>
  262. <xs:annotation>
  263. <xs:documentation>
  264. The protocol documented by this schema is defined in
  265. XEP-xxxx:
  266. </xs:documentation>
  267. </xs:annotation>
  268. <xs:element name='query'>
  269. <xs:complexType>
  270. <xs:simpleContent>
  271. <xs:extension base='xs:string'>
  272. <xs:attribute
  273. name='key'
  274. type='xs:string'
  275. use='required'/>
  276. </xs:extension>
  277. </xs:simpleContent>
  278. </xs:complexType>
  279. </xs:element>
  280. <xs:element name='report'>
  281. <xs:complexType>
  282. <xs:simpleContent>
  283. <xs:extension base='xs:string'>
  284. <xs:attribute
  285. name='filter'
  286. type='xs:string'
  287. use='required'/>
  288. <xs:attribute
  289. name='key'
  290. type='xs:string'
  291. use='required'/>
  292. </xs:extension>
  293. </xs:simpleContent>
  294. </xs:complexType>
  295. </xs:element>
  296. </xs:schema>
  297. ]]></code>
  298. </section2>
  299. </section1>
  300. <section1 topic='Acknowledgements' anchor='ack'>
  301. <p>Thanks to Sergei Golovan for the feedback.</p>
  302. </section1>
  303. </xep>