Move text regarding labels to new internationalization considerations section; removed necessity that ID of IQ-set shall match ID of challenge, since this is not consistent with existing usage that IDs are generated by the sender of an IQ.
An entity (client or server) MAY send a challenge immediately after receiving a stanza from another entitiy. An entity MUST NOT send challenges under any other circumstances. Hereafter, the entity that generates the stanza that triggers the challenge is called the "sender" and the entity that sends the challenge is called the "challenger".
The challenger SHOULD include an explanation (in the &BODY; element) for clients that do not support this protocol. The challenger MAY also include a URL (typically a Web page with instructions) using &xep0066; as an alternative for clients that do not support the challenge form. Note: Even if it provides a URL, a challenger MUST always provide a challenge form.
The sender's client SHOULD ignore the challenge stanza in either of the following cases:
Otherwise, if the challenger provided a URL using Out-of-Band Data, then the sender's client MAY present the URL to the sender, instead of responding to the challenge form, in any of the following cases:
@@ -188,7 +194,7 @@Otherwise, the sender's client MUST respond to the challenge, preserving the 'id' attribute of the challenge stanza.
+Otherwise, the sender's client MUST respond to the challenge.
The sender's client MUST respond with a ¬acceptable; error in any of the following cases:
Otherwise, it MUST select one challenge according to the sender's preferences and submit the sender's response form to the challenger.
However, if the sender submits an incorrect response the challenger SHOULD send it a ¬acceptable; error with type "cancel":
The challenger MAY demand responses to more than one of the challenges it is offering; this is done by including an 'answers' <field/> element in the form. The challenger also MAY require responses to particular challenges; this is done by including <required/> elements in the compulsory fields.
If the sender finds the request acceptable, it MUST answer all challenges that include a <required/> element. If the total number of answers was specified and it is greater than the number of <required/> elements then the sender MUST also answer one or more of the challenges without a <required/> element. In the example above, the sender should respond to the 'qa' challenge and one of the other challenges ('ocr', 'audio_recog' or 'SHA-256').
A service that hosts multi-user chat rooms in accordance with XEP-0045 MAY challenge unknown entities that seek to join such rooms or that send messages in such rooms.
Entities MUST address the needs of disabled people and CPU-constrained clients by offering senders a reasonable choice of different types of challenges.
Desktop clients running on modern PCs will typically be configured to automatically perform a specified 'SHA-256' Hashcash challenge (see below) whenever it is below a certain level of difficulty, with the result that many people may not even notice challenges most of the time. However, people using CPU-constrained clients (e.g. Web or mobile clients) would notice the performance hit. They might prefer to take a CAPTCHA challenge instead.
Visually disabled people using a CPU-constrained client could configure their client to always present them with an audio CAPTCHA challenge.
Most of the challenges below are language sensitive. However, the evaluation of the OCR and Hashcash responses does not depend on the language the sender is using.
Challenge types are distinguished by the 'var' attribute of each <field/> element. Several types of challenges are described below. More challenges MAY be documented elsewhere and registered with the XMPP Registrar (see Field Standardization).
The SHA-256 Hashcash challenge is transparent to average PC users. It is indicated when the value of the 'var' attribute is 'SHA-256'. It forces clients to perform CPU-intensive work, making it difficult to send large amounts of spim. This significantly reduces spim, but alone it will not completely stop spim being sent through large collections of 'zombie' computers.
The SHA-256 Hashcash challenge is transparent to average PC users. It is indicated when the value of the 'var' attribute is 'SHA-256'. It forces clients to perform CPU-intensive work, making it difficult to send large amounts of spim. This significantly reduces spim, but alone it will not completely stop abusive stanzas from being sent through large collections of 'zombie' computers.
The challenger MUST set the 'label' attribute of the <field/> element to a hexadecimal random number containing a configured number of bits (e.g., 220 ≤ label < 221).
To pass the test, the sender MUST return a text string that starts with the JID the sender sent the first stanza to (i.e., the stanza that triggered the challenge). The least significant bits of the SHA-256 hash (see &nistfips180-2;) of the string MUST equal the hexadecimal value specified by the challenger (in the 'label' attribute of the <field/> element). For example, if the 'label' attribute is the 20-bit value 'e03d7' then the following string would be correct:
innocent@victim.com2450F06C173B05E3
- Note: When configuring the number of bits to be specified by a challenger in the 'label' attribute values, administrators MUST balance the need to make mass spim as difficult as possible, with the inconvenience that may be caused to the users of less powerful computers. (Most clients will be challenged only very occasionally, so the consumption of 70% of a typical desktop CPU for 4 seconds might be considered appropriate.) Administrators SHOULD increment the configured number of bits from time to time to match increases in the performance of typical desktop PCs. If an administrator notices that spim robots never attempt the Hashcash challenge, then he SHOULD consider reducing the number of bits, to avoid inconveniencing people unnecessarily.
+Note: When configuring the number of bits to be specified by a challenger in the 'label' attribute values, administrators MUST balance the need to make mass abuse as difficult as possible, with the inconvenience that may be caused to the users of less powerful computers. (Most clients will be challenged only very occasionally, so the consumption of 70% of a typical desktop CPU for 4 seconds might be considered appropriate.) Administrators SHOULD increment the configured number of bits from time to time to match increases in the performance of typical desktop PCs. If an administrator notices that abusive robots never attempt the Hashcash challenge, then he SHOULD consider reducing the number of bits, to avoid inconveniencing people unnecessarily.
For those CAPTCHA types where generic instructions are possible (see table below) then the <field/> element SHOULD NOT include a 'label' attribute (the client MUST present generic instructions to the sender in the language of its user interface). Otherwise the 'label' attribute SHOULD ask a specific question in the language indicated by the 'xml:lang' attribute of the challenge stanza.
+Note: It may be profitable to send abusive stanzas even if less than one percent of CAPTCHA responses are successful. The effectiveness of a CAPTCHA challenge needs to be close to perfect, unless it is used in combination with other anti-abuse techniques.
If a media type is specified (see table below) then the <field/> element MUST contain a <media/> element that includes a <uri/> element of that type. Clients that support the CAPTCHA type MUST be able to play or render the specified MIME-types (see table below). They MAY also support other formats.
The 'type' attribute of the <field/> element SHOULD be 'text-single', 'text-private', or 'text-multi' (if no 'type' is specified, the default is 'text-single').
Name | Media type | MIME-type | -'label' | -Example generic instructions | +Example generic instructions * | |
---|---|---|---|---|---|---|
audio_recog | Audio Recognition | audio | audio/x-wav | -No | Describe the sound you hear | |
ocr * | +ocr ** | Optical Character Recognition | image | image/jpeg | -No | Enter the code you see |
Picture Question | image | image/jpeg | -No | Answer the question you see | ||
Picture Recognition | image | image/jpeg | -No | -Describe the picture | +Identify the picture | |
qa | Text Question and Answer | - | - | -Yes** | - | |
Speech Question | audio | audio/x-wav | -No | Answer the question you hear | ||
Speech Recognition | audio | audio/x-wav | -No | Enter the words you hear | ||
Video Question | video | video/mpeg | -No | Answer the question in the video | ||
Video Recognition | video | video/mpeg | -No | -Describe the video | +Identify the video |
* The image portrays random characters that humans can read but OCR software cannot.
** To pass the challenge, the sender must type the answer to the question in the 'label' attribute.
-Note: It may be profitable to send spim even if less than one percent of CAPTCHA responses are successful. The effectiveness of a CAPTCHA challenge needs to be close to perfect, unless it is used in combination with other anti-spim techniques.
+* See the Internationalization Considerations section of this document.
+** The image portrays random characters that humans can read but OCR software cannot.
Note: Even if it provides a text question in the &BODY; element, a challenger MUST always provide a challenge form.
Legacy clients respond to the challenger using a &MESSAGE; stanza (not an &IQ;).
The challenger SHOULD treat the stanza as a normal message (instead of as a response to its challenge) if the legacy client either takes too long to submit it or has already responded to the challenge. The challenger MAY treat the response as a normal message even in cases where the challenge became unnecessary while the challenger was waiting for the response.
Otherwise the challenger MUST report the result of the challenge to the legacy client using a &MESSAGE; stanza (not an &IQ;).
It is RECOMMENDED that entities employ other techniques to combat spim in addition to those described in this document (e.g., see XEP-0161 and &xep0205;).
+It is RECOMMENDED that entities employ other techniques to combat abusive stanzas in addition to those described in this document (e.g., see XEP-0161 and &xep0205;).
It is expected that this protocol will be an important and successful tool for discouraging spim. However, much of its success is dependent on the quality of the CAPTCHAs employed by a particular implementation.
The administrator of a challenger MUST discontinue the use of Robot Challenges under the following circumstances:
Each form field SHOULD include a 'label' attribute. If the sender did not include an 'xml:lang' attribute, then the challenger may not know the correct language for the labels. Therefore, depending on user preferences the client that receives a challenge MAY present generic but localized text instead of label text that would not be understood by the user. Recommended generic text (to be suitably localized) is provided by Table 1 in the CAPTCHAs section of this document.
+This document introduces no security considerations above and beyond those described in RFC 3920 and RFC 3921.