Why did S/MIME 4.0 (RFC 8551) add AuthEnvelopedData with AES-GCM beside EnvelopedData with AES-CBC, and what does its integrity check still not prove?
answer
- confidentiality is not integrity
- replaced ciphertext still decrypts
- a 2018 study of mail clients
- a mac field, verify before release
- every recipient holds the content key
basics
~20 sEnvelopedData gives confidentiality only: CBC ciphertext can be altered and still decrypt, which 2018 research turned into plaintext disclosure in some clients. AuthEnvelopedData with AES-GCM adds an integrity check, but not origin: any recipient holding the content key could rewrite the message.
solid answer
~40 sRFC 8551 section 3.3 says an enveloped-only message does not provide data integrity: ciphertext can be replaced so the message still processes but its meaning changes. Its security considerations cite 2018 research showing that CBC malleability, combined with how some clients handled decrypted HTML, could expose plaintext, and recommend moving to AES-GCM as quickly as possible. S/MIME 4.0 added `AuthEnvelopedData` (RFC 5083) and made AES-GCM (RFC 5084) a MUST, leaving AES-128 CBC as MUST-. It carries a `mac`, and the recipient must verify it before releasing any plaintext. What it does not prove is who sent the message: RFC 8551 says it gives no authentication or non-repudiation, and any recipient can replace the content undetected. Authorship still needs a signature.
code
plaintext · 5 linesContent-Type: application/pkcs7-mime; name=smime.p7m;
smime-type=enveloped-data
Content-Type: application/pkcs7-mime; smime-type=authEnveloped-data;
name=smime.p7mgo deeper
Recall that encryption alone does not show a message was unchanged, and that S/MIME 4.0 added an authenticated-encryption format for exactly that reason.
Explain enveloped-data against authEnveloped-data: the mac field, the verify-before-release rule, and how the smime-type parameter shows which one a message used.
Describe the 2018 CBC malleability class and the specification's response, and be precise that AES-GCM integrity proves neither origin nor non-repudiation, since any recipient can rewrite the content.
Weigh how fast to move correspondents to AuthEnvelopedData and what to require alongside it, such as signing, where both authorship and integrity matter.
## What EnvelopedData does and does not protect `EnvelopedData` (RFC 5652) provides **confidentiality**: the content is encrypted under a random content key, and nobody without a recipient's private key can read it. It provides **no integrity**. RFC 8551 section 3.3 says plainly that sending enveloped but not signed messages does not provide for data integrity, and that ciphertext can be replaced so that the processed message is still valid but its meaning is altered. The structure has no field for an authentication tag, so with AES-CBC, the content cipher S/MIME 3.2 required, a recipient's client cannot tell intact ciphertext from changed ciphertext. Why an unauthenticated mode allows this is covered with cipher modes and integrity. ## The 2018 findings, at concept level RFC 8551's security considerations cite a 2018 paper on S/MIME and OpenPGP mail security, presented at USENIX Security in August 2018. For this structure its findings come down to: - **Class of flaw:** CBC malleability. Changes to the ciphertext produce predictable changes in parts of the decrypted plaintext without CBC's weak built-in check being triggered. - **What it put at risk:** combined with how some mail clients handled decrypted content, notably HTML and mixed protected and unprotected parts, it could expose the plaintext of an encrypted message. - **What changed:** RFC 8551 recommends that mail systems migrate to AES-GCM as quickly as possible and that decrypted content not be acted on before the integrity check finishes. It also requires clients to treat a `text/html` part as a complete HTML document and to treat each encrypted or signed piece as a separate origin from unprotected content and from each other. ## What AuthEnvelopedData adds `AuthEnvelopedData` (RFC 5083) is the authenticated counterpart, used with an authenticated-encryption cipher such as AES-GCM (RFC 5084). Its fields mirror `EnvelopedData`, with additions: - `authEncryptedContentInfo` — the encrypted content. - `authAttrs` — optional attributes that are authenticated but not encrypted; they form the additional authenticated data. - `mac` — the integrity check value the cipher produces. - For AES-GCM, `GCMParameters` carry `aes-nonce` (12 octets recommended) and `aes-ICVlen` (default 12 octets). The nonce must be unique for each key; the reasoning behind that rule belongs to cipher modes. RFC 5083 requires the recipient to verify integrity before releasing any information, especially the plaintext, and to destroy all of the plaintext if verification fails. On the wire the message is labelled `smime-type=authEnveloped-data`. ## What S/MIME 4.0 requires | Content encryption | RFC 8551 (4.0) | RFC 5751 (3.2) | |---|---|---| | AES-128 GCM, AES-256 GCM | MUST | not listed | | AES-128 CBC | MUST- | MUST | | ChaCha20-Poly1305 | SHOULD+ | not listed | | Triple-DES | marked historic | SHOULD- | When a sender knows neither a recipient's capabilities nor their S/MIME version, RFC 8551 says it SHOULD use AES-256 GCM, and if it does not, AES-128 CBC. ## What the integrity check still does not prove - **Not origin.** RFC 8551 says `AuthEnvelopedData` does not provide authentication or non-repudiation, and section 3.4 adds that any recipient for whom the message is encrypted can replace it without detection, because every recipient holds the content key. For an outsider without the key, replacement is substantially more difficult than with `EnvelopedData`. - **Not origin even with one recipient.** The security considerations list preconditions for authenticated encryption to show origin (a starting key bound to one entity, exactly one sender and one recipient, a direct path from that key to the content key) and note that S/MIME's key agreement methods do not meet them. - **Not length.** AES-GCM encrypts in counter mode, so the ciphertext length reveals the plaintext length unless the application pads. - **Not a proof to third parties.** Where origin could be inferred, either party could have created the message, so nothing can be proven to an outsider. Showing authorship still takes a signature made with the sender's private key. ## How to tell what is in force 1. Read the `smime-type` parameter of the `application/pkcs7-mime` Content-Type: `enveloped-data` means no integrity check; `authEnveloped-data` means authenticated encryption. Both use the `.p7m` file extension, so the extension does not tell them apart. 2. In the CMS structure, read the content-encryption algorithm: `id-aes128-GCM` or `id-aes256-GCM` against an AES-CBC identifier. 3. In client and gateway policy, check which content cipher outgoing mail prefers and how incoming `enveloped-data` messages are presented.
- What are authAttrs in an S/MIME AuthEnvelopedData, and what protection do they get?Optional attributes that are authenticated but not encrypted. RFC 5083 DER-encodes them as the additional authenticated data of the cipher, so altering them fails the integrity check while their content stays readable. It also says authAttrs MUST be present if the content type is not id-data, and that the message-digest attribute SHOULD NOT be included.
- What must a receiving client do when the AES-GCM integrity check of an AuthEnvelopedData fails?RFC 5083 requires the recipient to verify the content's integrity before releasing any information, especially the plaintext, and to destroy all of the plaintext if verification fails. RFC 8551 adds, for mail, the recommendation that decrypted content not be acted on before the integrity check has finished.
- Does putting a signature inside an EnvelopedData close its integrity gap?It gives the recipient a way to detect change: RFC 8551 says modification of EnvelopedData ciphertext can go undetected if authentication is not also used, meaning without SignedData around it or inside it. The signature is checked only after decryption, though, so AuthEnvelopedData moves integrity into the decryption step and does not depend on that extra layer.
- Encrypted mail cannot be changed without the recipient noticing.
- AES-GCM in AuthEnvelopedData proves who sent the message.
- The fix for the 2018 findings was longer RSA keys.
- RFC 8551 removed AES-CBC, so S/MIME 4.0 clients cannot read CBC messages.
- Authenticated encryption also hides how long the message is.
Assumes S/MIME 4.0 (RFC 8551, 2019), which added AuthEnvelopedData and made AES-128 and AES-256 GCM MUST with AES-128 CBC as MUST-; S/MIME 3.2 required AES-128 CBC in EnvelopedData.