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-0236.xml 16KB

  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>Abuse Reporting</title>
  10. <abstract>This specification defines an XMPP protocol extension for reporting abusive traffic sent over an XMPP network. Note: This specification has been retracted in favor of XEP-0161, which now contains the content originally published in this specification.</abstract>
  12. <number>0236</number>
  13. <status>Retracted</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. <spec>XEP-0030</spec>
  20. </dependencies>
  21. <supersedes/>
  22. <supersededby/>
  23. <shortname>NOT YET ASSIGNED</shortname>
  24. &stpeter;
  25. <revision>
  26. <version>0.2</version>
  27. <date>2008-05-09</date>
  28. <initials>psa</initials>
  29. <remark><p>Retracted in favor of XEP-0161, which now contains the content originally published in this specification.</p></remark>
  30. </revision>
  31. <revision>
  32. <version>0.1</version>
  33. <date>2008-03-05</date>
  34. <initials>psa</initials>
  35. <remark><p>Initial published version.</p></remark>
  36. </revision>
  37. <revision>
  38. <version>0.0.3</version>
  39. <date>2008-02-29</date>
  40. <initials>psa</initials>
  41. <remark><p>Added reason element containing machine-readable conditions and optional human-readable text; added note about forwarding of abuse reports.</p></remark>
  42. </revision>
  43. <revision>
  44. <version>0.0.2</version>
  45. <date>2008-02-26</date>
  46. <initials>psa</initials>
  47. <remark><p>Limited scope to reporting between two servers; more clearly defined what is abusive; changed protocol to use IQ request-response exchange; limited use of error condition to stream termination.</p></remark>
  48. </revision>
  49. <revision>
  50. <version>0.0.1</version>
  51. <date>2008-02-19</date>
  52. <initials>psa</initials>
  53. <remark><p>First draft.</p></remark>
  54. </revision>
  55. </header>
  56. <section1 topic='Introduction' anchor='intro'>
  57. <p>Unfortunately, not all XMPP entities are well-behaved. Currently, if an XMPP entity (the "attacker") sends abusive stanzas to another XMPP entity (the "victim"), there is no way for the victim or the victim's server to inform the attacker's server that the attacker is generating abusive traffic. In practice, the victim's server may need to terminate the server-to-server connection (currently without explicitly informing the attacker's server about the reason for the termination) rather than continue to accept the abusive traffic.</p>
  58. <p>This situation is far from desirable. Therefore, this specification defines three small XMPP protocol functions that can help to improve the reliability of server-to-server connections:</p>
  59. <ol>
  60. <li>A method by which the receiving server can send an abuse report to the sending server, including the JID(s) of the sender(s).</li>
  61. <li>An application-specific stanza error condition that can be combined with the standard &notacceptable; stanza error condition to inform the sending server that a particular XMPP stanza is considered abusive.</li>
  62. <li>An application-specific stream error condition that can be combined with the standard &policy; stream error condition to inform the sending server about the reason for termination of an XML stream.</li>
  63. </ol>
  64. </section1>
  65. <section1 topic='Syntax' anchor='syntax'>
  66. <p>An abuse report MUST be sent in an IQ stanza of type "set" containing an &lt;abuse/&gt; element qualified by the 'urn:xmpp:tmp:abuse' namespace &NSNOTE;. The allowable children of the &lt;abuse/&gt; element are:</p>
  67. <ul>
  68. <li>One or more &lt;jid/&gt; elements whose XML character data specifies the JID(s) of the abusive sender(s)</li>
  69. <li>An optional &lt;reason/&gt; element that specifies the reason for the abuse report, via a machine-readable abuse condition defined in this specification, (optionally) human-readable text about the report, and (optionally) an application-specific condition defined outside this specification.</li>
  70. </ul>
  71. <p>This specification intentionally does not define exactly what constitutes abuse, since "abuse is in the eye of the beholder". However, the following machine-readable conditions are defined as children of the &lt;reason/&gt; element.</p>
  72. <table caption='Abuse Conditions'>
  73. <tr>
  74. <th>Condition</th>
  75. <th>Definition</th>
  76. </tr>
  77. <tr>
  78. <td>&lt;gateway/&gt;</td>
  79. <td>Attempting to inappropriately use a gateway on the receiving server (see &xep0100;)</td>
  80. </tr>
  81. <tr>
  82. <td>&lt;muc/&gt;</td>
  83. <td>Attempting to take over or otherwise abuse &xep0045; rooms on the receiving server</td>
  84. </tr>
  85. <tr>
  86. <td>&lt;proxy/&gt;</td>
  87. <td>Attempting to inappropriately use a &xep0065; proxy, TURN server, or other proxy on the receiving server</td>
  88. </tr>
  89. <tr>
  90. <td>&lt;pubsub/&gt;</td>
  91. <td>Attempting to inappropriately use a &xep0060; service on the receiving server</td>
  92. </tr>
  93. <tr>
  94. <td>&lt;service/&gt;</td>
  95. <td>Attempting to inappropriately use any other kind of service on the receiving server</td>
  96. </tr>
  97. <tr>
  98. <td>&lt;spam/&gt;</td>
  99. <td>Sending spam (unsolicited bulk messages)</td>
  100. </tr>
  101. <tr>
  102. <td>&lt;stanza-too-big/&gt;</td>
  103. <td>Sending extremely large stanzas</td>
  104. </tr>
  105. <tr>
  106. <td>&lt;too-many-recipients/&gt;</td>
  107. <td>Sending messages that contain too many recipients (see &xep0033;)</td>
  108. </tr>
  109. <tr>
  110. <td>&lt;too-many-stanzas/&gt;</td>
  111. <td>Sending an extremely large number of stanzas</td>
  112. </tr>
  113. <tr>
  114. <td>&lt;unacceptable-payload/&gt;</td>
  115. <td>Sending messages that contain unacceptable payloads such as malicious executables</td>
  116. </tr>
  117. <tr>
  118. <td>&lt;unacceptable-text/&gt;</td>
  119. <td>Sending messages that contain unacceptable human-readable text</td>
  120. </tr>
  121. <tr>
  122. <td>&lt;undefined-abuse/&gt;</td>
  123. <td>The abuse condition is undefined (should be used with an application-specific condition)</td>
  124. </tr>
  125. </table>
  126. <p>Note: The foregoing list of conditions is not exhaustive. The list may be augmented or otherwise modified in a future version of this specification as a result of implementation and deployment experience.</p>
  127. </section1>
  128. <section1 topic='Abuse Report' anchor='report'>
  129. <section2 topic='Generation' anchor='generation'>
  130. <p>If an XMPP server receives abusive stanzas over a server-to-server connection, the receiving server SHOULD send an abuse report to the sending server.</p>
  131. <example caption='Abuse Report'><![CDATA[
  132. <iq from=''
  133. id='rep1'
  134. to=''
  135. type='set'>
  136. <abuse xmlns='urn:xmpp:tmp:abuse'>
  137. <jid></jid>
  138. <reason>
  139. <condition>
  140. <muc/>
  141. </condition>
  142. </reason>
  143. </abuse>
  144. </iq>
  145. ]]></example>
  146. </section2>
  147. <section2 topic='Processing' anchor='processing'>
  148. <p>Upon receiving the abuse report, the sending server MUST proceed as follows.</p>
  149. <section3 topic='Abuse Reporting Not Supported' anchor='processing-notsupported'>
  150. <p>If the sending server does not understand the abuse reporting protocol, it MUST return a &unavailable; error to the receiving server.</p>
  151. <example caption='Abuse reporting not supported'><![CDATA[
  152. <iq from=''
  153. id='rep1'
  154. to=''
  155. type='error'>
  156. <error type='cancel'>
  157. <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  158. </error>
  159. </iq>
  160. ]]></example>
  161. </section3>
  162. <section3 topic='Sender(s) Not Found' anchor='processing-notfound'>
  163. <p>If none of the JIDs contained in the abuse report exist at the sending server, the sending server MUST return an &notfound; error to the receiving server.</p>
  164. <example caption='Senders not found'><![CDATA[
  165. <iq from=''
  166. id='rep1'
  167. to=''
  168. type='error'>
  169. <error type='cancel'>
  170. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  171. </error>
  172. </iq>
  173. ]]></example>
  174. </section3>
  175. <section3 topic='Abuse Report Accepted' anchor='processing-accept'>
  176. <p>If the sending server accepts the abuse report for one or more JIDs, it MUST return an IQ stanza of type "result" to the receiving server.</p>
  177. <example caption='Abuse report accepted'><![CDATA[
  178. <iq from=''
  179. id='rep1'
  180. to=''
  181. type='result'/>
  182. ]]></example>
  183. <p>This specification does not define how a sending server shall behave when it receives an abuse report. In general it is expected that the sending server (1) will notify the human administrators of the server in some implementation-specific or deployment-specific fashion, and (2) may use the abuse report in an automated fashion (e.g., as input to a rate-limiting algorithm, reputation system, or decision about temporarily suspending the privileges of the sending entity or entities). In addition, the sending server MAY the report to trusted parties such as third-party reporting services.</p>
  184. </section3>
  185. </section2>
  186. </section1>
  187. <section1 topic='Stanza Error' anchor='stanza'>
  188. <p>The receiving server MAY report that a particular stanza is considered abusive. The stanza error condition MUST be &notacceptable; and the error stanza MUST include an application-specific error condition of &lt;abuse/&gt; qualified by the 'urn:xmpp:tmp:abuse' &NSNOTE;. The &lt;abuse/&gt; element MUST include one or more &lt;jid/&gt; elements whose XML character data specifies the JID(s) of the abusive sender(s).</p>
  189. <example caption='Abusive stanza'><![CDATA[
  190. <message from=''
  191. to=''>
  192. [ ... some abusive payload here ... ]
  193. </message>
  194. ]]></example>
  195. <example caption='Stanza error'><![CDATA[
  196. <message from=''
  197. to=''>
  198. <error type='cancel'>
  199. <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  200. </error>
  201. <abuse xmlns='urn:xmpp:tmp:abuse'>
  202. <jid></jid>
  203. <reason>
  204. <condition>
  205. <unacceptable-payload/>
  206. </condition>
  207. </reason>
  208. </abuse>
  209. </message>
  210. ]]></example>
  211. </section1>
  212. <section1 topic='Stream Error' anchor='stream'>
  213. <p>If the sending entity continues to generate abusive stanzas via the sending server, the receiving server MAY close the stream between the receiving server and the sending server. The stream error condition MUST be &policy; and the stream error MUST include an application-specific error condition of &lt;abuse/&gt; qualified by the 'urn:xmpp:tmp:abuse'. The &lt;abuse/&gt; element MUST include one or more &lt;jid/&gt; elements whose XML character data specifies the JID(s) of the abusive sender(s).</p>
  214. <example caption='Stream Error'><![CDATA[
  215. <stream:error>
  216. <policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
  217. <abuse xmlns='urn:xmpp:tmp:abuse'>
  218. <jid></jid>
  219. <reason>
  220. <condition>
  221. <too-many-stanzas/>
  222. </condition>
  223. </reason>
  224. </abuse>
  225. </stream:error>
  226. </stream:stream>
  227. ]]></example>
  228. <p>The receiving entity then SHOULD terminate the TCP connection between the receiving server and the sending server.</p>
  229. </section1>
  230. <section1 topic='Discovering Support' anchor='disco'>
  231. <p>If a server supports the abuse reporting protocol, it MUST report that fact by including a service discovery feature of "urn:xmpp:tmp:abuse" &NSNOTE; in response to a &xep0030; information request:</p>
  232. <example caption="Service Discovery information request"><![CDATA[
  233. <iq from=''
  234. id='disco1'
  235. to=''
  236. type='get'>
  237. <query xmlns=''/>
  238. </iq>
  239. ]]></example>
  240. <example caption="Service Discovery information response"><![CDATA[
  241. <iq from=''
  242. id='disco1'
  243. to=''
  244. type='result'>
  245. <query xmlns=''>
  246. ...
  247. <feature var='urn:xmpp:tmp:abuse'/>
  248. ...
  249. </query>
  250. </iq>
  251. ]]></example>
  252. </section1>
  253. <section1 topic='Security Considerations' anchor='security'>
  254. <section2 topic='Denial of Service Attacks' anchor='security-dos'>
  255. <p>It is possible for an abusive sender to launch a denial of service attack against legitimate users of the sending server by generating abusive traffic over the server-to-server connection (in fact such attacks have already been observed on XMPP networks). Although use of the abuse reporting protocol does not completely prevent such attacks, it may at least enable sending servers to react to abusive traffic in close to real time, thus helping to "heal" the network when denial of service attacks are launched.</p>
  256. </section2>
  257. <section2 topic='Man in the Middle Attacks' anchor='security-mitm'>
  258. <p>If a malicious entity can inject information into the server-to-server connection, it can falsely send abuse reports to the sending server. Therefore the connection SHOULD be encrypted using Transport Layer Security as specified in &xmppcore;.</p>
  259. </section2>
  260. </section1>
  261. <section1 topic='IANA Considerations' anchor='iana'>
  262. <p>This document requires no interaction with &IANA;.</p>
  263. </section1>
  264. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  265. <section2 topic='Protocol Namespaces' anchor='ns'>
  266. <p>Until this specification advances to a status of Draft, its associated namespace shall be "urn:xmpp:tmp:abuse"; upon advancement of this specification, the &REGISTRAR; shall issue a permanent namespace in accordance with the process defined in Section 4 of &xep0053;.</p>
  267. </section2>
  268. <section2 topic='Application-Specific Errors' anchor='registrar-apperror'>
  269. <p>The XMPP Registrar shall add &lt;abuse/&gt; to its registry of application-specific error conditions (see &APPERRORS;), where the element is qualified by the 'urn:xmpp:tmp:abuse' namespace &NSNOTE;.</p>
  270. <p>The registry submission is as follows:</p>
  271. <code><![CDATA[
  272. <condition>
  273. <ns>urn:xmpp:tmp:abuse</ns>
  274. <element>abuse</element>
  275. <desc>the sending entity has generated traffic that the receiving server considers abusive</desc>
  276. <doc>XEP-xxxx</doc>
  277. </condition>
  278. ]]></code>
  279. </section2>
  280. </section1>
  281. <section1 topic='XML Schema' anchor='schema'>
  282. <code><![CDATA[
  283. <?xml version='1.0' encoding='UTF-8'?>
  284. <xs:schema
  285. xmlns:xs=''
  286. targetNamespace='urn:xmpp:tmp:abuse'
  287. xmlns='urn:xmpp:tmp:abuse'
  288. elementFormDefault='qualified'>
  289. <xs:element name='abuse'>
  290. <xs:complexType>
  291. <xs:sequence>
  292. <xs:element name='jid' type='xs:string' minOccurs='1' maxOccurs='unbounded'/>
  293. <xs:element ref='reason' minOccurs='0'/>
  294. </xs:sequence>
  295. </xs:complexType>
  296. </xs:element>
  297. <xs:element name='reason'>
  298. <xs:complexType>
  299. <xs:sequence>
  300. <xs:element ref='condition' minOccurs='0' maxOccurs='1'/>
  301. <xs:element name='text' type='xs:string' minOccurs='0' maxOccurs='1'/>
  302. <xs:any namespace='##other' minOccurs='0' maxOccurs='1'/>
  303. </xs:sequence>
  304. </xs:complexType>
  305. </xs:element>
  306. <xs:element name='condition'>
  307. <xs:complexType>
  308. <xs:choice>
  309. <xs:element name='gateway' type='empty'/>
  310. <xs:element name='muc' type='empty'/>
  311. <xs:element name='proxy' type='empty'/>
  312. <xs:element name='pubsub' type='empty'/>
  313. <xs:element name='service' type='empty'/>
  314. <xs:element name='spam' type='empty'/>
  315. <xs:element name='stanza-too-big' type='empty'/>
  316. <xs:element name='too-many-recipients' type='empty'/>
  317. <xs:element name='too-many-stanzas' type='empty'/>
  318. <xs:element name='unacceptable-payload' type='empty'/>
  319. <xs:element name='unacceptable-text' type='empty'/>
  320. <xs:element name='undefined-abuse' type='empty'/>
  321. </xs:choice>
  322. </xs:complexType>
  323. </xs:element>
  324. <xs:simpleType name='empty'>
  325. <xs:restriction base='xs:string'>
  326. <xs:enumeration value=''/>
  327. </xs:restriction>
  328. </xs:simpleType>
  329. </xs:schema>
  330. ]]></code>
  331. </section1>
  332. </xep>