From bbc6fbdac0bd2c9e43564314d592479272757c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Tue, 20 Dec 2022 18:42:57 +0100 Subject: [PATCH] Accept inbox/pubsub-signing.xml as XEP-0475 --- xep-0475.xml | 233 +++++++++++++++++++++++++++++++++++++++++++++++++++ xep.ent | 1 + 2 files changed, 234 insertions(+) create mode 100644 xep-0475.xml diff --git a/xep-0475.xml b/xep-0475.xml new file mode 100644 index 00000000..e19a6c6b --- /dev/null +++ b/xep-0475.xml @@ -0,0 +1,233 @@ + + +%ents; +]> + + +
+ Pubsub Signing + Specifies a mechanism to sign pubsub items + &LEGALNOTICE; + 0475 + Experimental + Standards Track + Standards + Council + + XMPP Core + XEP-0001 + XEP-0004 + XEP-0060 + XEP-0470 + + + + pubsub-signing + + Jérôme + Poisson + goffi@goffi.org + goffi@jabber.fr + + + 0.1.0 + 2022-12-20 + XEP Editor (jsc) + Accepted by vote of Council on 2022-11-30. + + + 0.0.2 + 2022-10-20 + jp + +
    +
  • replaced "signatory" term with the more commonly used "signer"
  • +
  • added <to/> and <time/> elements (similar to XEP-0373)
  • +
+
+
+ + 0.0.1 + 2022-10-17 + jp +

First draft.

+
+
+ +

There are few ways to authenticate items published via &xep0060;, and none of them are secure: the publish attribute defined by the pubsub service is not mandatory and can be spoofed by the service itself, and some XEPs such as &xep0277; have their own mechanism (like <author/> qualified by "http://www.w3.org/2005/Atom" namespace) that is even easier to spoof.

+

This specification proposes a framework for attaching cryptographic signatures to pubsub items, allowing strong authentication of item authors. This specification only defines the framework, it is designed to be extended by other specifications to use various cryptographic algorithms.

+
+ +
    +
  • wrapper element: element wrapping the item to sign, and containing extra metadata
  • +
  • signed data: normalized and serialized wrapped element
  • +
  • signing profile: a specialisation of this specification for a specific cryptographic algorithm.
  • +
  • signature: element containing the signature itself (which is detached from the signed data).
  • +
  • C14N: Canonical XML (version 2.0 is used in this specification), a way to normalize XMP to have the same data to sign.
  • +
+
+ +

The design goals of this XEP are:

+
    +
  • it must be possible to sign plain text items as well as end-to-end encrypted items;
  • +
  • it must be backwards compatible: attaching a signature must work with existing specifications so that clients that do not support pubsub signatures can continue to work as usual;
  • +
  • it must be possible to sign an item by several authors;
  • +
  • it should be possible to have different signers from the item publisher;
  • +
+
+ +

To sign a pubsub item, the signature and the signed data are separated. Signed data is a wrapper element comprising essential data such as signers, and the item to be signed. The wrapper element is then normalized, serialized and signed. The signature and additional data of the wrapper element are then publised as &xep0470;. In case of multiple signers, each signer publish their own signature as an attachment.

+

To verify a signature, the process is similiar: the receiving client builds the same wrapper element, normalize and serialize it, and uses it to validate the given signature(s).

+
+ + +

To sign a pubsub item, a <sign-data/> wrapper element qualified by the 'urn:xmpp:pubsub-signature:0' namespace is created. This element MUST contain at least one 'to' element which MUST have a 'jid' attribute whose value is the intended recipient's XMPP address. The XMPP address found in the 'to' element's 'jid' attribute SHOULD be without Resourcepart (i.e., a bare JID).

+

The <sign-data/> element MUST contain exactly one <time/> element. The <time/> element MUST have a 'stamp' attribute which contains the timestamp of the moment when the element is being signed in the DateTime format as specified in &xep0082;

+

The <sign-data/> element MUST contain one or more <signer/> element(s) which MUST possess a 'jid' attribute whose value is the bare JID of the signer.

+

One or more external elements specified by signing profile MAY be added

+

The item to sign MUST be added as a child of the <sign-data/> element. If the wrapped <item/> element possesses a 'publisher' attribute, it MUST be removed when added to the wrapper element. As item ID can be added or modified by the Pubsub/PEP service, if the <item/> has an 'id' attribute, it MUST be removed too when added to the wrapper element, thus the item ID is not part of the signed data.

+

Then the resulting item is put to canonical form by applying C14N v2.0 specification.

+

The resulting element in canonical form is then serialized and signed.

+

Below is an example of wrapper element:

+ + + +

The normalized form is as follow:

+ + juliet@capulet.litJuliet Capuletxmpp:juliet@capulet.litShe is so pretty!2022-10-16T18:39:02Z]]> + +

The signature is then put as an &xep0470;. The attachment is a <signature/> element qualified by the 'urn:xmpp:pubsub-signing:0' namespace. The attachment MUST contain the same <time/> and <signer/> elements in the same order as in the <sign-data/> element. If any signing profile extra elements have been used in <sign-data/>, they MUST be added too in the same order as in <sign-data/>. Then the signature is added in an element specified in the signing profile specification.

+

Each signer entity MUST publish a <signature/> attachment signed with their own encryption keys.

+

If the pubsub item is encrypted, the signature MUST be done on the plain text version of the item before the encryption of the item. The <signature/> attachment SHOULD be encrypted too.

+ + + + + + + + + + + + + + ]]> + +

The reason we use &xep0470; instead of directly signing the target item is that we need to be backwards compatible, so we cannot replace the target item with another element, nor is it possible to add a sibling element to item's payload (this would not be compliant with &xep0060; specification). This requires detaching the signature from the <item/> element itself, and &xep0470; are dedicated to attaching data to items, so a viable solution.

+
+ + +

To summarize signatures as explained in &xep0470; the <signer/> elements are grouped into a <signature/> element qualified by the 'urn:xmpp:pubsub-signing:0' namespace. This allows a client to easily know that an item is signed, and to obtain the IDs of attachments that need to be retrieved to validate signatures.

+ + + + + + + + + + juliet@capulet.lit + romemo@montague.lit + + + + + + + + + ]]> +
+ + +

Once one or more signatures have been found in an item attachment, a client SHOULD validate them. To do this, it builds a wrapper element with the target item as explained in Signing a Pubsub Item, and validate it with each signature. Validation mechanism depends of the signing profile.

+
+ +
+ + +

C14N 2.0 defines parameters for the algorithm. For this specification, default values MUST be used, i.e. IgnoreComments is true, TrimTextNodes is true, PrefixRewrite is none, and QNameAware is the empty set. In other terms: there must be no comments, text nodes must be trimmed, prefixes are left unchanged, and no nodes must be processed as QName-valued.

+

Once the signature has been validated, it's the original item which MUST be used, as usual, not the normalized form. The original item has attributes missing from the normalized form ('published' and 'id' attribute), and spaces are trimmed, but they may be significant (e.g. in a dataform <value/>).

+

It is essential to use the same <to/>, <time/>, <signer/> and signing profile extra elements in the <signature/> element put in attachment and in wrapper <sign-data/> element used for signed data, as it is necessary for receiving client to re-build the wrapper element and then validate the signature.

+
+ + +

The client validating signatures should display a message or indicator depending on the validation result:

+
    +
  • If one of the signatures doesn't validate, the client SHOULD display a prominent warning message explicitely stating that the signature is not validated and that the message is probably spoofed.
  • +
  • If the signature is validated but at least one of the signers's fingerprints is not trusted, the client SHOULD display a warning message stating that the signature is validated but unreliable, and that the message may be forged.
  • +
  • If all signatures are validated and all signers' fingerprints are trusted, the client SHOULD display an information message or indication that the item is signed by one or more trusted signers.
  • +
+
+ + +

If a client supports the protocol specified in this XEP, it MUST advertise it by including the "urn:xmpp:pubsub-signing:0" discovery feature in response to a &xep0030; information request:

+ + + +]]> + + + ... + + ... + +]]> +
+ + +

Signature is intimely linked to the trust in the fingerprint of the encryption keys. A warning SHOULD be displayed by a client if a signature is valid but the signing entity's fingerprints are not trusted. Trust should be done through an external channel (outside of XMPP), preferably face-to-face.

+

Security considerations of the signing profile applies.

+
+ + +

TODO

+
+ +

TODO

+
+ +

TODO

+
+ +

Thanks to NLnet foundation/NGI0 Discovery for funding.

+
+
diff --git a/xep.ent b/xep.ent index d87a9995..b620c7ab 100644 --- a/xep.ent +++ b/xep.ent @@ -1670,3 +1670,4 @@ IANA Service Location Protocol, Version 2 (SLPv2) Templates PubSub Social Feed (XEP-0472) XEP-0472: PubSub Social Feed <https://xmpp.org/extensions/xep-0472.html>." > OpenPGP for XMPP Pubsub (XEP-0473) XEP-0473: OpenPGP for XMPP Pubsub <https://xmpp.org/extensions/xep-0473.html>." > SASL SCRAM Downgrade Protection (XEP-0474) XEP-0474: SASL SCRAM Downgrade Protection <https://xmpp.org/extensions/xep-0474.html>." > +Pubsub Signing (XEP-0475) XEP-0475: Pubsub Signing <https://xmpp.org/extensions/xep-0475.html>." >