Re: [secdir] Security review of draft-thornburgh-adobe-rtmfp-07

Uri Blumenthal <uri@MIT.EDU> Tue, 25 June 2013 12:11 UTC

Return-Path: <uri@mit.edu>
X-Original-To: secdir@ietfa.amsl.com
Delivered-To: secdir@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4AB8011E80AE; Tue, 25 Jun 2013 05:11:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.252
X-Spam-Level:
X-Spam-Status: No, score=0.252 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FRT_ADOBE2=2.455, MIME_QP_LONG_LINE=1.396, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vXmjbZOpI8Cf; Tue, 25 Jun 2013 05:11:15 -0700 (PDT)
Received: from dmz-mailsec-scanner-7.mit.edu (dmz-mailsec-scanner-7.mit.edu [18.7.68.36]) by ietfa.amsl.com (Postfix) with ESMTP id 7065C21F9F6B; Tue, 25 Jun 2013 05:11:15 -0700 (PDT)
X-AuditID: 12074424-b7f228e00000096b-b1-51c988e2a7c7
Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id 3E.10.02411.2E889C15; Tue, 25 Jun 2013 08:11:14 -0400 (EDT)
Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id r5PCBCLt012018; Tue, 25 Jun 2013 08:11:13 -0400
Received: from [192.168.1.108] (chostler.hsd1.ma.comcast.net [24.62.227.134]) (authenticated bits=0) (User authenticated as uri@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r5PCB9FB016433 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 25 Jun 2013 08:11:11 -0400
References: <201306211705.r5LH5Qf2025408@sylvester.rhmr.com> <D9D602D39A98E34D9C43E965BEC7439825F20E3B@nambx08.corp.adobe.com>
Mime-Version: 1.0 (1.0)
In-Reply-To: <D9D602D39A98E34D9C43E965BEC7439825F20E3B@nambx08.corp.adobe.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Message-Id: <FD18A508-69FF-41F5-A449-6164C0F24FBB@mit.edu>
X-Mailer: iPad Mail (10B329)
From: Uri Blumenthal <uri@MIT.EDU>
Date: Tue, 25 Jun 2013 08:11:13 -0400
To: Michael Thornburgh <mthornbu@adobe.com>
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFKsWRmVeSWpSXmKPExsUixCmqrPuo42SgwZEjSha3F/9istj6dxKj xYw/E5ktNt1/yGLxYeFDFgdWj2k/e5g9liz5yeTx8pW4x5fLn9kCWKK4bFJSczLLUov07RK4 Mg5/+8pScD6p4mpvI3MD49qALkZODgkBE4nmxknsELaYxIV769m6GLk4hAT2MUqcuPmLCcLZ yCjx9Mw+dqgMk8TSybvYQFqEBOokTrYfZOli5ODgFRCXuHrQByTMKeAn8XDmXGaQMLOAjsTk hYwgYWYBbYllC18zg9i8AlYSG3/OZAUZySzwkFHi3uU9bBBXyEhs3v4Y7CI2ASWJ5uYtrCC2 sICHxLnvi5hAbBYBVYnjzzeBxUWAhu5b8oh5AqPgLIQrZiFsnoVk8wJG5lWMsim5Vbq5iZk5 xanJusXJiXl5qUW65nq5mSV6qSmlmxhBwc7uorKDsfmQ0iFGAQ5GJR7eGTEnAoVYE8uKK3MP MUpyMCmJ8s5rPxkoxJeUn1KZkVicEV9UmpNafIhRgoNZSYT3UBZQjjclsbIqtSgfJiXNwaIk zit2a2egkEB6YklqdmpqQWoRTFaGg0NJgjcCGNVCgkWp6akVaZk5JQhpJg5OkOE8QMPfgizm LS5IzC3OTIfIn2LU5VixZ+t7RiGWvPy8VClx3jSQQQIgRRmleXBzYEnqFaM40FvCvPkgVTzA BAc36RXQEiagJZNTj4MsKUlESEk1MPqfnPms7tSTKbdOW9fw/I1xLo9s4F40U6bUtvryd62f Kzx8rwcfnfEyQ6jK9kzJ0vgHjrNyfrFn7OvM6GFKsLpwwLrvNkP5WY7lTIItXSv3/ree82Q6 uxrn5Xn3++TqnqXrx704fPD21jMPJU6FTljzdOVb68L9lfc8vdUs4q9GXpV9vsJfu1aJpTgj 0VCLuag4EQBEioV2LQMAAA==
Cc: "secdir@ietf.org" <secdir@ietf.org>, "draft-thornburgh-adobe-rtmfp@tools.ietf.org" <draft-thornburgh-adobe-rtmfp@tools.ietf.org>, "iesg@ietf.org" <iesg@ietf.org>
Subject: Re: [secdir] Security review of draft-thornburgh-adobe-rtmfp-07
X-BeenThere: secdir@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Security Area Directorate <secdir.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/secdir>, <mailto:secdir-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/secdir>
List-Post: <mailto:secdir@ietf.org>
List-Help: <mailto:secdir-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/secdir>, <mailto:secdir-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 25 Jun 2013 12:11:21 -0000

Leaving alone everything else - there was no better encryption mode for streaming data (I assume Flash would be streaming?) than CBC? And what's the purpose of encrypting something with a key shared with the entire Universe? 

I think you're expecting too much from "error discovery" of CBC mode. Also, for the last two decades cryptographers insist that the correct way of MACing is applying outer MAC. Also, especially considering the capabilities of the later Intel chips, using HMAC after (or before:) encryption is a waste of time - there are fast Authenticated Encryption modes (GCM and OCB, to name a couple).

So far I tend to agree with Hillary, and suggest using DTLS.

Yours in confusion...


Sent from my iPad

On Jun 24, 2013, at 14:32, Michael Thornburgh <mthornbu@adobe.com> wrote:

> hi Hilarie.  thanks for your review.  comments/replies inline.
> 
>> From: Hilarie Orman [mailto:hilarie@purplestreak.com]
>> Sent: Friday, June 21, 2013 10:05 AM
>> 
>> Security review of
>> Adobe's Secure Real-Time Media Flow Protocol
>> draft-thornburgh-adobe-rtmfp-07
>> 
>> Do not be alarmed.  I have reviewed this document as part of the
>> security directorate's ongoing effort to review all IETF documents
>> being processed by the IESG.  These comments were written primarily
>> for the benefit of the security area directors.  Document editors and
>> WG chairs should treat these comments just like any other last call
>> comments.
>> 
>> This is an informational RFC describing an existing Adobe protocol.
>> It has the feature of allowing sessions to change their IP addresses
>> and to use forwarders to help in NAT traversal.
>> 
>> The draft does not specify the cryptographics requirements and
>> processing in enough detail to facilitate interoperable
>> implementations, and I don't recommend advancing it.
> 
> this draft describes a generic framework of cryptographic operational semantics with requirements and recommendations.  the generic framework is a common part of RTMFP and belongs in this specification.  specific cryptography choices are left to applications/profiles of RTMFP.  the intention is that application-level interoperation would be achieved using this specification and a specification of the application-specific Cryptography Profile; for example, a specification describing the Cryptography Profile to be used for Flash platform communication.
> 
>> The draft generically specifies the cryptographic features that would
>> provide privacy and authentication.  All specifics are left to the
>> implementor.  The cryptographic profiles could be trivial (rot13 and
>> casting out nines, for example).
> 
> correct. for testing/development of the RTMFP implementation used in Adobe's products, i created a "Null Crypto Adapter" implementing (NOT RECOMMENDED) straight-copy for the "Packet Encryption" function, and a trivial session-specific key to salt a simple checksum for "data integrity".  this profile/adapter met the semantic requirements of a Cryptography Profile but was not suitable for any circumstance where actual aspects of security were desired.  however, it made debugging using a packet sniffer a lot easier!
> 
>> How is the cryptographic profile specified?  Is there only one, to be
>> used by all implementations RTMFP?  If not, how do two implementations
>> agree on which profile they will use?
> 
> a Cryptography Profile would be specified in another document.  the intention is that there could be different Cryptography Profiles for different applications or uses of RTMFP.  there is one defined for Flash platform communication, which has features uniquely tailored to the Flash ecosystem; however, specifics of this are unfortunately not currently publicly disclosed.  i agree that it would be valuable to have this profile available as a concrete example; however, i don't have permission to publish it at this time.  i considered designing a new cryptography profile to use as an example, but it would have no real-world implementation or deployment experience behind it and would not have the benefit of the years of refinement and experience we have with the Flash profile.  publishing such an example would probably encourage people to implement it, even though it could have serious flaws.  i concluded that creating a new example profile was a bad idea.
> 
>> How is the "default session key" selected?  The text mentions the
>> possibility of multiple default keys.  In "Security Considerations":
>>   ... to allow for different applications of RTMFP using different
>>   Default Session Keys to (intentionally or not) share network
>>   transport addresses without interference.
>> I don't see how this could work.
> 
> the Default Session Key is chosen by the designer of the Cryptography Profile.  for example, in the Flash Crypto Profile, the Default Session Key is the 16 bytes of the UTF-8 coded string "Adobe Systems 02" (note: this has been widely known for years and is not a secret).  these 16 bytes form the raw key for AES-128-CBC, which is the default (and currently only) cipher used in the Flash Crypto Profile.
> 
> as far as two RTMFPs using the same network transport address, think of the different Default Session Keys as different spread-spectrum spreading codes.  if used with something like AES-128-CBC, then even a "data integrity" check comprising an interior checksum would be enough to reject as corrupt a packet using the wrong Default Session Key.
> 
>> What is the algorithm for encrypting with the default session key?
>> Note that the crypto profile is supposed to determine the keys, but
>> there is not necessarily an interface that accepts a default key
>> and produces usable encryption and integrity/authentication keys.
> 
> the Cryptography Profile also determines the method of encryption (Section 2.2.3 first sentence).  in the case of Flash communication, this method is AES-128-CBC, and would be fully specified in the "RTMFP for Flash" document, were it published.
> 
>> Is there any response for "endpoint discriminator unacceptable"?
> 
> section 3.5.1.1.2 gives the normative behavior for when an Endpoint Discriminator selects the identity of the responder.  see sections 3.5.1.4 and 3.5.1.5 for possible behavior for when an Endpoint Discriminator does not select the identity of the responder.
> 
> there are no chunks or other messages to encode "i received an EPD i didn't like for one reason or another".  what to do in this circumstance is intentionally not specified and is left to the implementer's discretion.  in the Adobe implementation, an IHello or FIHello with an EPD that doesn't select the receiver (including because it's malformed) is silently dropped (except in forwarders/redirectors).
> 
>> I did not see any "MUST" requirements for rejecting data that fails to
>> pass cryptographic checks.
> 
> i will add a statement to that effect in Section 2.2.3 3rd paragraph.
> 
>> How are message integrity and authentication achieved?  Is it required?
>> Section 2.2.3 says:
>>   "The packet encryption layer is responsible for data integrity and
>>   authenticity, for example by means of a checksum or cryptographic
>>   message authentication code."
>> That does not seem to require that the message integrity be tied to
>> the Endpoint Discriminator.
> 
> by "message integrity" i assume you mean "data integrity" in the context of packets.  data integrity is not tied to the EPD.  the EPD is a field interior to the packet, which must be tested for integrity before being parsed.  in the sentence you quoted above, i will add "of packets" after "integrity and authenticity" and before the comma.
> 
> in general, (packet) data integrity and authenticity is left to the designer of the cryptography profile. in the case of Flash communication, this is achieved using either an (interior) checksum or an (exterior) HMAC, the choice being determined during the IIKeying/RIKeying phase of the startup handshake in the respective Keying Components, and in the case of HMAC, the HMAC key being derived in a manner similar to how the packet encryption key is derived. 
> 
>> Is there anti-replay prevention?  I cannot tell.  There are sequence
>> numbers, but they could be spoofed under some definitions of the
>> cryptographic profile.
> 
> anti-replay prevention is part of "data integrity and authenticity".  in the case of Flash communication, a "Session Sequence Number" can be enabled (during the IIKeying/RIKeying phases, similar to how HMAC/simple checksum is selected) to prevent packet replay.  i will add a RECOMMENDED about anti-replay in SS2.2.3PP3.
> 
> flow sequence numbers prevent anti-replay (and enable retransmission) within a current flow; however, an observer could capture a packet that starts a new flow (using traffic analysis to figure out what packet that was), and later, after using traffic analysis to infer that flow is concluded, could replay that packet to potentially start a new flow with the same flow ID (or interfere with a new flow with the same ID).  i will add something to the Security Considerations about that, to further make the case for implementing packet-level anti-replay.
> 
>> Section 2.2.2:
>>   "The 32-bit Scrambled Session ID is the 32-bit Session ID modified by
>>   performing a bitwise exclusive-or with the bitwise exclusive-or of
>>   the first two 32-bit words of the encrypted packet."
>> This is security-by-obscurity and is not worth the trouble.
> 
> disagree with the characterization of "security-by-obscurity" and that it's not worth the trouble.  the intention is to make every byte of UDP payload appear to a casual observer (and especially to a meddling middlebox) to be random noise.  RTMFP is intended to be used with a strong cipher (like AES), where every ciphertext byte appears pseudorandom.  during startup, the Session ID is 0, and during the rest of the session it is a fixed non-zero value.  without the scrambling operation, there would be a tasty and consistent 4-bytes that a middlebox might want to interpret as an IP address or something, or otherwise meddle with.  if we XORed with only the first 4 bytes, then during startup (with SID 0) the first 4 bytes would be the same as the second 4 bytes.  XORing with two 32-bit words (where those 64 bits are strongly pseudorandom in the case of AES) ensures that the first 4 bytes at least don't match the next 8.
> 
> note that it's not security-by-obscurity because it's documented.  :)  note also that even if it's not worth the trouble, it *is* how this deployed protocol actually works.
> 
>> The Security Considerations admit that the Default Session Key is such
>> a weak measure that all messages that use it should be considered to
>> be sent in the clear.  It isn't worth the trouble of using it.
> 
> disagree. the Security Considerations section states that the Default Session Key is intended to scramble startup packets to avoid meddling by middleboxes, to obscure the content from casual observation, and to act as a spread-spectrum or subchannel code for different RTMFP applications that might be sharing a transport channel.  this is particularly important because startup packets can contain IP addresses and port numbers.  i disagree with the characterization as "admit [...] such a weak measure" -- the Security Considerations states the intent and disclaims (with a "MUST NOT") any security aspect to it.
> 
>> There are robust IETF security protocols that could be layered over RTMFP.
> 
> true.  RTMFP could also be adapted to be encapsulated in DTLS.
> 
>> I recommend removing all references to cryptography from this
>> document.
> 
> disagree. the generic (and intentionally open-ended) cryptographic framework is an essential semantic aspect of the protocol.  the normative semantics described in this document are common to any application of RTMFP.
> 
>> Hilarie
> 
> thank you very much.
> 
> -michael thornburgh
> _______________________________________________
> secdir mailing list
> secdir@ietf.org
> https://www.ietf.org/mailman/listinfo/secdir
> wiki: http://tools.ietf.org/area/sec/trac/wiki/SecDirReview