p≡p I-Ds (IETF Internet-Drafts)
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.

32 KiB


title: "Header Protection for S/MIME" abbrev: Header Protection S/MIME docname: draft-ietf-lamps-header-protection-00 category: info

stand_alone: yes pi: [toc, sortrefs, symrefs, comments]

author: {::include ../shared/author_tags/bernie_hoeneisen.mkd} {::include ../shared/author_tags/alexey_melnikov.mkd} #{::include ../shared/author_tags/daniel_kahn_gillmor.mkd}





RFC2045: # MIME part 1 # RFC2046: # MIME part 2 # RFC5322: # SMTP # RFC8551: # S/MIME # I-D.ietf-lamps-header-protection-requirements:




RFC3156: # PGP/MIME #

RFC3501: # IMAP

RFC4949: # Internet Security Glossary #

RFC4880: # OpenPGP



RFC6376: # DKIM #

RFC6532: # internationalized email headers

RFC7208: # SPF #



RFC7489: # DMARC #



I-D.melnikov-iana-reg-forwarded: I-D.autocrypt-lamps-protected-headers:


I-D.pep-email: I-D.marques-pep-email # TODO: Update reference, once submitted #





{::include ../shared/references/pep-mixnet.mkd}

--- abstract

Privacy and security issues with email header protection in S/MIME have been identified for some time. However, the desire to fix these issues has only recently been expressed in the IETF LAMPS Working Group. The existing S/MIME specification is to be updated regarding header protection.

This document describes the problem statement, generic use cases, and the S/MIME specification for header protection.

--- middle


A range of protocols for the protection of electronic mail (email) exist, which allow to assess the authenticity and integrity of the email headers section or selected header fields (HF) from the domain-level perspective, specifically DomainKeys Identified Mail (DKIM) {{RFC6376}} and Sender Policy Framework (SPF) {{RFC7208}}, and Domain-based Message Authentication, Reporting, and Conformance (DMARC) {{RFC7489}}. These protocols, while essential to responding to a range of attacks on email, do not offer (full) end-to-end protection to the header section and are not capable of providing privacy for the information contained therein.

The need for means of Data Minimization, which includes data spareness and hiding all technically concealable information whenever possible, has grown in importance over the past several years.

A standard for end-to-end protection of the email header section exists for S/MIME version 3.1 and later. (cf. {{RFC8551}}):

In order to protect outer, non-content-related message header fields (for instance, the "Subject", "To", "From", and "Cc" fields), the sending client MAY wrap a full MIME message in a message/RFC822 wrapper in order to apply S/MIME security services to these header fields.

No mechanism for header protection (HP) has been standardized for PGP/MIME (Pretty Good Privacy) {{RFC3156}} yet.

Several varying implementations of end-to-end protections for email header sections exist, though the total number of such implementations appears to be rather low.

Some LAMPS WG participants expressed the opinion that whatever mechanism will be chosen, it should not be limited to S/MIME, but also applicable to PGP/MIME.

This document describes the problem statement ({{problem-statement}}), generic use cases ({{use-cases}}) and the specification for Header Protection ({{specification}}).

{{I-D.ietf-lamps-header-protection-requirements}} defines the requirements that this specification is based on.

This document is in early draft state and contains a proposal to base the upcoming discussions on. In any case, the final solution is to be determined by the IETF LAMPS WG.

{::include ../shared/text-blocks/key-words-rfc2119.mkd}

{::include ../shared/text-blocks/terms-intro.mkd}

{::include ../shared/text-blocks/mitm.mkd}

  • S/MIME: Secure/Multipurpose Internet Mail Extensions (cf. {{RFC8551}})

  • PGP/MIME: MIME Security with OpenPGP (cf. {{RFC3156}})

  • Message: An Email Message consisting of header fields (collectively called "the Header Section of the message") followed, optionally, by a Body; cf. {{RFC5322}}.

  • Transport: The entity taking care of the transport of a Message towards the receiver or from the sender. The Transport on the sending side typically determines the destination recipients by reading the To, Cc and Bcc Header Fields (of the Outer Message). The Transport is typically implemented by an MTA (Mail Transfer Agent).

  • Header Field (HF): cf. {{RFC5322}} Header Fields are lines beginning with a field name, followed by a colon (":"), followed by a field body (value), and terminated by CRLF; cf. {{RFC5322}}.

    Note: To avoid ambiguity, this document does not use the terms "Header" or "Headers" in isolation, but instead always uses "Header Field" to refer to the individual field and "Header Section" to refer to the entire collection; cf. {{RFC5322}}.

  • Header Section (HS): The Header Section is a sequence of lines of characters with special syntax as defined in {{RFC5322}}. It is the (top) section of a message containing the Header Fields.

  • Body: The Body is simply a sequence of characters that follows the Header Section and is separated from the Header Section by an empty line (i.e., a line with nothing preceding the CRLF); cf {{RFC5322}}. It is the (bottom) section of Message containing the payload of a Message. Typically, the Body consists of a (multipart) MIME {{RFC2045}} construct.

  • MIME Header Section (part): The collection of MIME Header Fields describing the following MIME structure as defined in {{RFC2045}}.

  • Header Protection (HP): cryptographic protection of email Header Sections (or parts of it) for signatures and/or encryption

  • Protection Levels (PL): One of 'signature and encryption', 'signature only' or 'encryption only' (cf. {{protection-levels}})

  • Original Message (OrigM): The message to be protected before any protection related processing has been applied on the sending side.

  • Inner Message (InnerM): The message to be protected, shortly before protection measures are applied to on the sending side or the message shortly after decryption and/or unwrapping the signed part on the receiving side. Typically the Inner Message is in clear text. The Inner Message is rather similar as the Original Message. The Inner Message MUST be the same on the sending and the receiving side.

  • Outer Message (OuterM): The Message as handed over to the Transport or received from the Transport respectively. The Outer Message normally differs on the sending and the receiving side (e.g. new Header Fields are added by intermediary nodes).

  • Receiving User Facing Message (RUFM): The message used for rendering at the receiving side after the Outer Message Header Section has been merged with the Inner Message Header Section.

  • Essential Header Fields (EHF): The Header Fields an Outer Message Header Section SHOULD contain at least; cf. {{outer-msg-hf}}.

  • Protected: Protected refers to the parts of a message where protection measures of any Protection Levels have been applied to.

  • Protected Message: A message that protection measures of any Protection Levels have been applied to.

  • Unprotected: Unprotected refers to the parts of a message where no protection measures of any Protection Levels have been applied to.

  • Unprotected Message: A message that no protection measures of any Protection Levels have been applied to.

  • Data Minimization: Data spareness and hiding all technically concealable information whenever possible.

Problem Statement

The LAMPS charter contains the following Work Item:

Update the specification for the cryptographic protection of email headers -- both for signatures and encryption -- to improve the implementation situation with respect to privacy, security, usability and interoperability in cryptographically-protected electronic mail. Most current implementations of cryptographically-protected electronic mail protect only the body of the message, which leaves significant room for attacks against otherwise-protected messages.

In the following a set of challenges to be addressed:

TODO: enhance this section, add more items to the following


  • Data Minimization, which includes data spareness and hiding all technically concealable information whenever possible


  • MITM attacks (cf. {{RFC4949}})


  • User interaction / User experience


  • Interoperability with {{RFC8551}} implementations

Use Cases

In the following, the reader can find a list of the generic use cases that need to be addressed for messages with Header Protection (HP). These use cases apply independently of whether S/MIME, PGP/MIME or any other technology is used to achieve HP.


Main Case for Header Protection

Both peers (sending and receiving side) fully support Header Protection as specified in this document; see {{main-use-case}}.

Backward Compatibility

The sending side fully supports Header protection as specified in this document, while the receiving side does not support any Header Protection; see {{backward-compatibility-use-case}}.

Note: The compatibility of legacy HP systems with this new solutions, and how to handle issues surrounding future maintenance for these legacy systems, will be decided by the LAMPS WG.

Protection Levels

The following protection levels need to be considered:

a) Signature and encryption

Messages containing a cryptographic signature, which are also

b) Signature only

Messages containing a cryptographic signature, but which are not

c) Encryption only

Messages that are encrypted, but do not contain a cryptographic


This section contains the specification for Header Protection in S/MIME to update and clarifies Section 3.1 of {{RFC8551}} (S/MIME 4.0). This specification is likely to be integrated into S/MIME at some later stage.

Furthermore, it is likely that PGP/MIME {{RFC3156}} will also take over this specification or parts of it.

This specification applies to the protection levels "signature & encryption" and "signature only" (cf. {{protection-levels}}):

Sending and receiving sides SHOULD implement "signature and encryption", which is the default to use on the sending side.

Certain implementations MAY decide to send "signature only" messages, depending on the circumstances and customer requirements. Sending side MAY and receiving sides SHOULD implement "signature only".

It generally is NOT RECOMMENDED to send a message with protection level "encryption only". On the other hand, messages with protection level "encryption only" might arrive at the receiving side. While not targeted to protection level "encryption only", this specification is assumed to also function for "encryption only". Receiving sides SHOULD implement "encryption only".

Note: It is for further study whether or not more guidance for handling messages with protection level "encryption only" at the receiving side is needed.

Main Use Case

The following covers the Interaction (cf. {{interactions}}) if all parties (sending and receiving side) implement this specification. (For backward compatibility cases cf. {{backward-compatibility-use-case}}).

MIME Format

As per S/MIME version 3.1 and later (cf. {{RFC8551}}), the sending client MAY wrap a full MIME message in a message/RFC822 wrapper in order to apply S/MIME security services to these header fields.

To help the receiving side to distinguish between forwarded and wrapped message, a Content-Type header field parameter "forwarded" is added as defined in {{I-D.melnikov-iana-reg-forwarded}}. Certain mailing applications might display the Inner Message as attachment otherwise.

In the simplest case, a message looks as follows:

{::include ../shared/fence-line.mkd}

<Outer Message Header Section (unprotected)>

<Outer Message Body (protected)>

<MIME Header Section>

<Inner Message Header Section>

<Inner Message Body>

{::include ../shared/fence-line.mkd}

The following example demonstrates how header section and payload of a protect body part might look like. For example, this will be the first body part of a multipart/signed message or the signed and/or encrypted payload of the application/pkcs7-mime body part. Lines prepended by "O: " are the Outer Message Header Section. Lines prepended by "I: " are the Inner Message Header Section. Lines prepended by "W: " are the wrapper (MIME Header Section):

{::include ../shared/fence-line.mkd}

O: Date: Mon, 25 Sep 2017 17:31:42 +0100 (GMT Daylight Time) O: Message-ID: e4a483cb-1dfb-481d-903b-298c92c21f5e@matt.example.net O: Subject: Meeting at my place O: From: "Alexey Melnikov" alexey.melnikov@example.net O: To: somebody@example.net O: MIME-Version: 1.0 O: Content-Type: multipart/signed; charset=us-ascii; micalg=sha1; O: protocol="application/pkcs7-signature"; O: boundary=.cbe16d2a-e1a3-4220-b821-38348fc97237

 This is a multipart message in MIME format.

W: Content-Type: message/RFC822; forwarded=no W: I: Date: Mon, 25 Sep 2017 17:31:42 +0100 (GMT Daylight Time) I: From: "Alexey Melnikov" alexey.melnikov@example.net I: Message-ID: e4a483cb-1dfb-481d-903b-298c92c21f5e@matt.example.net I: MIME-Version: 1.0 I: MMHS-Primary-Precedence: 3 I: Subject: Meeting at my place I: To: somebody@example.net I: X-Mailer: Isode Harrier Web Server I: Content-Type: text/plain; charset=us-ascii

 This is an important message that I don't want to be modified.

 Content-Transfer-Encoding: base64
 Content-Type: application/pkcs7-signature

 [[base-64 encoded signature]]


{::include ../shared/fence-line.mkd}

The Outer Message Header Section is unprotected, while the remainder (Outer Message Body) is protected. The Outer Message Body consists of the Inner Message (Header Section and Body).

The Inner Message Header Section is the same as (or a subset of) the Original Message Header Section preceded by a MIME Header Section with media type "message/RFC822" containing a Content-Type header field parameter "forwarded=no" (cf. {{inner-msg-hf}}).

The Inner Message Body is the same as the Original Message Body.

The Original Message itself may contain any defined MIME structure.

There may also be an additional MIME layer with Media-Type "multipart/mixed" in the Outer Message Body to contain the Inner Message (as "message/RFC822") along with other MIME part(s).

Alternative Option Autocrypt "Protected Headers" (Ex-"Memory Hole")

An alternative Option (based on the former autocrypt "Memory Hole" approach) to be considered, is described in {{I-D.autocrypt-lamps-protected-headers}}.

That option emphasizes backward compatibility challenges to existing Mail User Agents (MUAs) that do encryption, but are unaware of Header Protection as specified herein (see also {{backward-compatibility-use-case}}).

That option suggests to use the media type "text/plain" to contain the Inner Message (as opposed to "message/RFC822", cf. {{mime-format}}). For MUA implementers rendering those messages, that approach might become problematic implementation-wise once the Content of "text/plain" needs to be parsed (as media type "text/plain" is defined as unstructured text).

Regarding MIME type "message/RFC822" {{RFC2046}} specifies:

Plain text does not provide for or allow formatting commands, font attribute specifications, processing instructions, interpretation directives, or content markup. Plain text is seen simply as a linear sequence of characters, possibly interrupted by line breaks or page breaks"

Existing MIME parsers and libraries and/or MUAs implemented according to {{RFC2046}} will need to be changed to implement the option described in {{I-D.autocrypt-lamps-protected-headers}}, as that option differs from the current MIME Standard (cf. {{RFC2046}}).

The impact of using "text/plain", while in fact containing a (subset of a) "message/RFC822" media type to be parsed, is for further study concerning MIME standards and real world deployments.

For further information, the reader is encouraged to consult {{I-D.autocrypt-lamps-protected-headers}}.

Inner Message Header Fields

It is RECOMMEND that the Inner Messages contains all the Header Fields of the Original Message with the exception of the following Header Field, which MUST NOT be included to the Inner Message nor to any other protected part of the message:

  • Bcc

[[ TODO: Bcc handling needs to be further specified (see also {{bcc-handling}}). Certain MUAs cannot properly decrypt messages with Bcc recipients. ]]

In additon, the Inner Message Header Section MUST be preceded by a MIME Header Section with media type "message/RFC822" that SHOULD contain the Content-Type header field parameter "forwarded=no" as defined in {{I-D.melnikov-iana-reg-forwarded}}.

Outer Message Header Fields

To maximize Privacy, it is strongly RECOMMENDED to follow the principle of Data Minimization (cf. {{privacy}}).

However, the Outer Message Header Section SHOULD contain the Essential Header Fields and, in addition, MUST contain the Header Fields of the MIME Header Section part to describe the encryption or signature as per {{RFC8551}}.

The following Header Fields are defined as the Essential Header Fields:

  • From
  • To (if present in the OrigM)
  • Cc (if present in the OrigM)
  • Bcc (if present in the OrigM, see also {{outer-msg-hf}} and {{bcc-handling}})
  • Date
  • Message-ID
  • Subject

Some of these Header Fields are needed by the Transport (e.g. to determine the destination). Furthermore, not including certain Header Fields may trigger spam detection to flag the message as spam and/or lead to user experience (UX) issues.

For further Data Minimization the value of the Subject Header Field SHOULD be obfuscated. In addition, the value of other Essential Header Fields MAY be obfuscated. Further Header Fields MAY be obfuscated, though simply not adding those to the Outer Message Header SHOULD be prefered over obfuscation. Header Field obfuscation is further specified in {{obfuscation-outer-HF}}.

Header Fields not obfuscated SHOULD contain the same values as in the Original Message.

The MIME Header Section part is the collection of MIME Header Fields describing the following MIME structure as defined in {{RFC2045}}. A MIME Header Section part typically includes the following Header Fields:

  • MIME-Version
  • Content-Type
  • Content-Transfer-Encoding
  • Content-Disposition

The following example shows the MIME header of an S/MIME signed message (using application/pkcs7-mime with SignedData):

{::include ../shared/fence-line.mkd}

MIME-Version: 1.0 Content-Type: application/pkcs7-mime; smime-type=signed-data; name=smime.p7m Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=smime.p7m

{::include ../shared/fence-line.mkd}

Depending on the scenario, further Header Fields MAY be exposed in the Outer Message Header Section, which is NOT RECOMMENDED unless justified. Such Header Fields may include e.g.:

  • References
  • Reply-To
  • In-Reply-To

Obfuscation of Outer Message Header Fields

If the values of the following Outer Message Header Fields are obfuscated, those SHOULD assume the following values:

* Subject: ...
* Message-ID: <new randomly generated Message-ID> 
* Date: Thu, 01 Jan 1970 00:00:00 +0000 (UTC)

[[ TODO: Consider alternatives for Date e.g. set to Monday 9am of the same week. ]]

In certain implementations also the From, To, and/or Cc Header Field MAY be obfucated. Those may be replaced by e.g.

Such implementations need to ensure that the Transport has access to these Header Fields in clear text and is capable of processing those.

A use case for obfuscation of all Outer Message Header Fields is mixnet netwerks, i.e. "onion routing" for email (e.g.{{pEp.mixnet}}).

Note: It is for further study to what extent Header Field obfuscation (adversely) impacts spam filtering.

Message Processing

The Following figure depicts the different message representations (OrigM, InnerM, OuterM, RUFM) and which parts those are constructed from:

{::include ../shared/fence-line.mkd} {::include ../shared/ascii-arts/message_orig_outer_inner_rufm.mkd} {::include ../shared/fence-line.mkd}


  • OuterM(S): Outer Message (OuterM) at sending side (before processing by Transport)

  • OuterM(R): Outer Message at receiving side (as received by Transport)

  • InnerM: Inner Message (that protection is applied to)

  • RUFM: Receiving User Facing Message

  • More-HF: Additional Header Fields (HF) in the Original Message (OrigM)

  • MIME-HS: MIME Header Section; with media type (message/RFC822)

  • MIME-HSp: MIME Header Section part

  • Trans-HF: Header Fields added in Transit (between sending and receiving side)

  • '>': taken over / copied from last column

  • '=': propagates unchanged, unless something unusual (e.g. attack) happens

  • '(*)': HF is often not present (but also further HF may not be present). If the HF is not present, naturally it can neither be taken over nor propagated.

  • '(new)' / '(OrigM)': HF or MIME-HSp is generated depending on the decision in {{sending-side-step-1}}, while '(new)' / '(OrigM)' designate the default.

Sending Side

For a protected message the following steps are applied before a message can be handed over to the Transport:

Step 1: Decide on Protection Level and Information Disclosure

The entity applying protection to a message must decide:

  • Which protection level (signature and/or encryption) is applied to the message? This depends on user request and/or local policy as well as availability of cryptographic keys.

  • Which Header Fields of the Orignial Message shall be part of the Outer Message Header Section? This typically depends on local policy. By default the Essential Header Fields are part of the Outer Message Header Section (in addition to the MIME Header Section part); cf. {{outer-msg-hf}}.

  • Which of these Header Fields are to be obfuscated? This depends on local policy and/or specific Privacy requirements of the user. By default only the Subject Header Field is obfuscated; cf. {{obfuscation-outer-HF}}.

Step 2: Compose the Outer Message Header Section

Depending on the decision in {{sending-side-step-1}}, compose the Outer Message Header Section. (Note that this also includes the necessary MIME Header Section part for the following protection layer.)

Outer Header Fields that are not obfuscated SHOULD contain the same values as in the Original Message (except for MIME Header Section part, which depends on the protection level selected in {{sending-side-step-1}}).

Step 3: Apply Protection to the Original Message

Depending on the protection level in selected in {{sending-side-step-1}} apply signature and/or encryption to the original message (as per {{RFC8551}}) and include the result to the message as Outer Message Body.

The resulting (Outer) Message is then typically handed over to the Transport.

TODO: Example

Receiving Side

When a protected message is received the following steps are applied:

Step 1: Decrypt message and/or check signature

Depending on the protection level the received message is decrypted and/or its signature is checked as per {{RFC8551}}.

Step 2: Construct the Receiving User Facing Message

The Receiving User Facing Message is constructed as follows:

  • The Header Section of the Receiving User Facing Message MUST consist of the Outer Message Header Fields that are not contained in the Inner Message Header Section, and the Inner Message Header Fields (i.e. the Inner Message Header Field MUST always take precedence).

  • The Body of the Receiving User Facing Message Body MUST be the same as the Inner Message Body.

The resulting message is handed over for further processing, which typically involves rendering it to the user.

[[ TODO: Do we need to take special care for HFs, which may appear multiple times, e.g. Received HF? ]]

Note: It is for further study whether and, if yes, how the Outer Message Header Section (as received from the Transport) is preserved for the user.

Backward Compatibility Use Case

{{I-D.autocrypt-lamps-protected-headers}} describes a possibility to achieve backward compatibility with existing S/MIME (and PGP/MIME) implementations unaware of this specification (Legacy Display). It mainly focuses on email clients that do not render emails using header protection (nicely) and may confuse the user. While this has been observed occasionally in PGP/MIME (cf. {{RFC3156}}), the extent of this problem with S/MIME implementations is still unclear. (Note: At this time, none of the samples in {{I-D.autocrypt-lamps-protected-headers}} applies header protection as specified in Section 3.1 of {{RFC8551}}, which is wrapping as Media Type "message/RFC822".)

Should serious backward compatibility issues with rendering at the receiver reveal, the Legacy Display format described in {{I-D.autocrypt-lamps-protected-headers}} may serve as a basis to mitigate those (backward compatibility use case).

Another variant of backward compatibility has been implemented by pEp {{I-D.pep-email}}, i.e. pEp Email Format 1.0. At this time pEp has implemented this for PGP/MIME (but not yet S/MIME).

Security Considerations


Privacy Considerations


IANA Considerations

This document requests no action from IANA.

RFC Editor: This section may be removed before publication.


The authors would like to thank the following people who have provided helpful comments and suggestions for this document: Claudio Luck, David Wilson, Hernani Marques, Krista Bennett, Kelly Bristol, Robert Williams, Sofia Balicka, Steve Kille, Volker Birk, and Wei Chuang.

--- back

Additional information

Stored Variants of Messages with Bcc

Messages containing at least one recipient address in the Bcc header field may appear in up to three different variants:

  1. The message for the recipient addresses listed in To or Cc header fields, which must not include the Bcc header field neither for signature calculation nor for encryption.

  2. The message(s) sent to the recipient addresses in the Bcc header field, which depends on the implementation:

    a) One message for each recipient in the Bcc header field separately with a Bcc header field containing only the address of the recipient it is sent to

    b) The same message for each recipient in the Bcc header field with a Bcc header field containing an indication such as "Undisclosed recipients" (but no addressees)

    c) The same message for each recipient in the Bcc header field which does not include a Bcc header field (this message is identical to 1. / cf. above)

  3. The message stored in the 'Sent'-Folder of the sender, which usually contains the Bcc unchanged from the original message, i.e. with all recipient addresses.

Document Changelog

RFC Editor: This section is to be removed before publication

  • draft-ietf-lamps-header-protection-00

    • Initial version (text partialy taken over from {{I-D.ietf-lamps-header-protection-requirements}}

Open Issues

[[ RFC Editor: This section should be empty and is to be removed before publication. ]]

  • Decide on format of obfuscated HFs, in particular Date HF ({{obfuscation-outer-HF}})

  • Impact on spam filtering, if HFs are obfuscated ({{obfuscation-outer-HF}})

  • More examples (e.g. in {{message-processing}})

  • Should Outer Message Header Section (as received) be preserved for the user? ({{receiving-side-step-2}})

  • Do we need to take special care of HFs that may appear multiple times, e.g. Received HF? ({{receiving-side-step-2}})

  • Change adding Content-Type header field parameter "forwarded" from SHOULD to MUST ({{mime-format}})?

  • Decide on whether or not merge requirements from {{I-D.ietf-lamps-header-protection-requirements}} into this document.

  • Decide what parts of {{I-D.autocrypt-lamps-protected-headers}} to merge into this document.

  • Enhance Introduction and Problem Statement sections

  • Decide on whether or not specification for more legacy HP requirements should be added to this document

  • Improve definitions in {{protection-levels}}

  • Privacy Considerations {{privacy-considerations}}

  • Security Considerations {{security-considerations}}