%ents; ]>
Trust Messages (TM) This document specifies a way to communicate the trust in public long-term keys used by end-to-end encryption protocols from one endpoint to another. &LEGALNOTICE; 0434 Experimental Standards Track Standards Council XMPP Core XEP-0001 XEP-0280 XEP-0334 XEP-0420 TM Melvin Keskin melvo@olomono.de melvo@olomono.de 0.5.1 2021-05-14 melvo

Update to XEP-0450 version 0.3.0 and apply consistent formatting:

  • Update ATM's namespace to 'urn:xmpp:atm:1'
  • Apply consistent formatting for revision history
0.5.0 2021-04-16 melvo

Update to XEP-0420 version 0.4.0 and adapt namespace to shortname:

  • Replace SCE's old 'content' element by its new 'envelope' element
  • Replace SCE's old 'payload' element by its new 'content' element
  • Update SCE's namespace to 'urn:xmpp:sce:1'
  • Change namespace to 'urn:xmpp:tm:0'
0.4.0 2021-04-13 melvo

Add new section, use more precise sentences, apply consistent formatting:

  • Add new section for Trust Message URIs
  • Use 'that' instead of 'which' for restrictive clauses
  • Apply consistent formatting for paragraphs and revision history
0.3.0 2020-12-19 melvo

Clarify usage, use real namespace for examples and add missing section:

  • Clarify usage of trust messages by protocols such as &xep0450;
  • Use namespace 'urn:xmpp:atm:0' of &xep0450; as example for 'usage' attribute
  • Add section 'Security Considerations'
0.2.0 2020-11-05 melvo

Improve explanations, descriptions and examples, introduce new attribute and complete all sections:

  • Remove link to encryption protocol namespaces
  • Add short name
  • Shorten and improve introduction
  • Use emphasizing text formatting instead of quotation marks
  • Add new section for explaining the core properties of trust messages
  • Add examples comparing trust messages to public key certificates
  • Improve description of trust message structure
  • Introduce 'usage' attribute for 'trust-message' element
  • Focus on &xep0420; and adjust examples accordingly
  • Complete sections 'IANA Considerations', 'XMPP Registrar Considerations' and 'XML Schema'
0.1.0 2020-02-27 XEP Editor (jsc) Accepted by vote of Council on 2020-02-19 0.0.1 2020-02-15 melvo First draft

End-to-end encryption without verifying the authenticity of the exchanged public long-term keys only enables the endpoints to protect their communication against passive attacks. This means an attacker cannot read encrypted messages in transit without actively intervening in the key exchange. However, without any other precautions, active attacks are still possible. If an attacker replaces the exchanged keys with malicious ones or introduces an additional malicious endpoint, the end-to-end encrypted messages can be read and manipulated by the attacker.

When using end-to-end encryption where public long-term keys are transmitted over a channel that is not protected against active attacks, the authenticity of those keys is not guaranteed. Such a key has to be authenticated by the receiving endpoint over another channel that is already protected against active attacks to maintain the confidentiality of sent messages and ensure the authenticity and integrity of received messages. Trust messages can be used to transfer the needed data via XMPP for performing such an authentication. Furthermore, they can transmit the data used for distrusting a key.

Endpoint
Communication endpoint owning exactly one public long-term key. In most cases that is an XMPP client instance. In the terminology of &xep0384;, that is a device. To cover also the possibility for using multiple endpoints on the same physical device and via the same client instance, the general term endpoint is used.
Key authentication
Verification that a key received over an insecure channel is actually the one of the assumed endpoint
Key identifier
Identifier of a key (e.g., a fingerprint or the key itself)
Public key certificate
Electronic document used to prove the authenticity of a public key
Trust message
XMPP message that indicates whether specific keys are trusted or untrusted by the sending endpoint. A trust message for an endpoint's key contains the key identifier of the given key.

Trust messages can be used in conjunction with an end-to-end encryption protocol such as &xep0373; or &xep0384; to automatically or semi-automatically establish secure channels protected against active attacks. This protocol specifies how trust messages are transmitted and protocols such as &xep0450; specify how and for which purpose they are processed.

Trust messages have the following advantages:

A permanent storage is not needed. Cached data can be be removed as soon as the recipient made use of them. E.g., a server-side storage holding available data because it does not know when a client needs to access them, as for certificate-based approaches, is unnecessary.

An infrastructure in additional to the one used for messages is not needed because trust messages are ordinary messages. E.g., a server-side storage and a mechanism for accessing it other than those used for messages is unnecessary.

The authenticity and integrity of trust messages are ensured by a signing mechanism. If trust messages are additionally encrypted, they have the following advantages:

The cryptographic properties of the encryption protocol are applied to the trust messages. Properties such as confidentiality, forward secrecy and deniability can have a positive impact on the authentication of keys. Hence, trust messages, in contrast to certificates, can e.g. be deniable toward a third party if the encryption protocol provides that kind of deniability.

The fact that an endpoint trusts a key or not can be kept confidential toward an attacker by encrypting those messages and sending them only to endpoints with authenticated keys. This means that an attacker cannot detect by the content of a trust message whether a specific key is trusted by the sender. If the trust message is sent for an authentication of a key, the involved parties of that authentication will therefore stay anonymous toward an attacker.

The encryption protects against passive attacks on the transmission of the trust messages. That way, an attacker cannot read the content of the trust messages.

The restriction to send trust messages only to endpoints with authenticated keys in addition to the encryption protects against active attacks on the transmission of the trust messages. An attacker will even after introducing a malicious key not receive a trust message encrypted with that key.

Blocking data used to trust or distrust keys in transit is made more difficult. In particular, an attacker is not able to selectively block transmitted data used to distrust the attacker's key.

If an attacker cannot distinguish whether the data sent from a client is used for trusting or distrusting a key, the attacker can only randomly block some messages or the whole communication. If the communication is already compromised by an active attack, the attacker does not want to stop the whole communication. During that state, the attacker has the possibility to keep on e.g. eavesdropping or altering messages. Therefore, the attacker wants to block data that can lead to excluding the attacker. But the attacker does not want to block the communication itself.

Data that is used by the recipient to distrust the attacker's key would make it impossible for the attacker to continue to encroach on the communication. Thus, it is important to prevent an attacker from blocking data used for making trust decisions. E.g., an approach using certificates permanently stored on a server cannot prevent an attacker from specifically blocking such data because certificates have to be discoverable and identifiable as such.

It might be possible to distinguish an encrypted trust message from other encrypted messages by analyzing the network traffic over a period of time. However, the mitigation of that issue is out of scope.

A trust message (i.e., the root ]]> element)

The last two points are needed to achieve their mentioned goals because a trust message does not contain a ]]> element which would automatically lead to the desired result.

In the following example, two &xep0384; keys of Alice are indicated as trusted, one key of Bob is indicated as trusted and two other ones of Bob are indicated as untrusted.

&ns;&ns-atm;&ns-omemo; 6850019d7ed0feb6d3823072498ceb4f616c6025586f8f666dc6b9c81ef7e0a4 221a4f8e228b72182b006e5ca527d3bddccf8d9e6feaf4ce96e1c451e8648020 623548d3835c6d33ef5cb680f7944ef381cf712bf23a0119dabe5c4f252cd02f b423f5088de9a924d51b31581723d850c7cc67d0a4fe6b267c3d301ff56d2413 d9f849b6b828309c5f2c8df4f38fd891887da5aaa24a22c50d52f69b4a80817e ]]>

Trust messages MAY be sent unencrypted to solely communicate the trust in specific keys without any other protection. But as described before, the strength of trust messages is the possibility to encrypt their content and choose to which endpoints they are sent according to the trust in the endpoints' keys.

The ]]> element MUST be signed before sending for ensuring the authenticity and integrity.

The ]]> element SHOULD be signed and encrypted before sending for applying all advantages the encryption provides. That protects against passive attacks on the transmission of the trust message. The trust message SHOULD only be sent to endpoints whose keys have already been authenticated for also preventing active attacks on the transmission of the trust message.

Describing how the ]]> element has to be used by each existing encryption protocol is out of scope. &xep0420; specifies a common method for encrypting arbitrary elements which can be used by different encryption protocols. When using an encryption protocol such as &xep0384; that uses &xep0420; (SCE), the SCE ]]> element MUST contain the ]]> element as a direct child.

A trust message SCE ]]> element

  • MUST contain an ]]> affix element. This prevents an attacker from finding out the trust message's content by its length and distinguishing a trust message from another kind of SCE message.
  • MUST contain a ]]> affix element. This prevents an attacker from delivering trust messages in the wrong order or delivering a former trust message again. If the trust messages are used by the recipient for making trust decisions, it protects the recipient from setting the opposite of the intended trust state by applying trust changes in the wrong order or reapplying a former change.
  • SHOULD contain a ]]> affix element. This prevents an attacker from spoofing the sender.
  • SHOULD contain a ]]> affix element. This prevents an attacker from spoofing the recipient.
&ns-sce; QHqW2arWFewoERL1a43wonBKpTmsrBWnc1d66HSDq85NgMLmjrDJV9lV

&xep0280; minimizes the number of trust messages to be sent while having the same payload because trust messages with the same payload do not have to be sent for each endpoint. In combination with the usage of &xep0313;, the delivery of trust messages to temporarily offline endpoints is ensured even if they are available under a different resource after going online than the last known one before going offline.

This specification uses &xep0280; for sending a trust message to all endpoints of a contact or to all own endpoints at once. By sending a trust message to the contact, each endpoint of the contact and each own endpoint receives the same trust message by the server. Thus, a client needs to send the same trust message only once.

If not all endpoints of the contact should receive the trust message, the trust message MAY be sent to specific endpoints of the contact but for all own endpoints &xep0280; MAY be used and vice versa. Even when a client does not yet have a contact, the client MAY use &xep0280; for delivering a trust message to all own endpoints by sending it to the own bare JID. If then a client receives a trust message with its own full JID as the sender, it MAY discard that message directly without parsing the content.

Example: Alice's endpoint A1 authenticates the key of her endpoint A2. A1 sends the trust message for A2's key only once to all of Alice's and Bob's endpoints by using &xep0280;.

Attention: In that context, sending an encrypted trust message to all endpoints of a contact or to all own endpoints does not mean to encrypt it with the keys of all those endpoints. Instead, it only means that all of those endpoints should receive the trust message even if it is not encrypted for some of them and thereby not decryptable by those endpoints. Keep in mind that a trust message SHOULD only be encrypted for endpoints with authenticated keys.

Protocols using trust messages SHOULD specify rules for processing them in order to create or sustain a secure communication. Therefore, those protocols SHOULD state in which cases from which senders trust messages are used for making trust decisions and for which keys they are sent to whom.

This document requires no interaction with the Internet Assigned Numbers Authority (IANA).

As authorized by &xep0147;, the XMPP Registrar maintains a registry of queries and key-value pairs for use in XMPP URIs (see &QUERYTYPES;).

An XMPP URI with the trust-message query type (defined as Trust Message URI) MAY be used to provide a trust message for various purposes and a single key owner out-of-band. Such a URI MAY be encoded as a QR code and used if only a QR code scan is available as a trusted channel. E.g., the initial authentication needed by &xep0450; can be performed by scanning a QR code that encodes a Trust Message URI.

Only a Trust Message URI from a trusted source SHOULD be processed because of its impact on the communication's security. Therefore, users SHOULD be asked for confirmation if a Trust Message URI is used to make a trust decision.

The JID attribute of the ]]> element MUST be used as the Trust Message URI's path. The first key-value pair of the URI's query MUST represent the encryption attribute of the ]]> element. All remaining key-value pairs of the URI's query MUST represent the ]]> respectively ]]> elements of the ]]> element. The key of a key-value pair MUST be the element's respectively attribute's name and the value their content.

&ns-omemo;

This specification defines the following XMPP namespaces:

  • &ns;
&NSVER;
]]>