RFC 4895
Authenticated Chunks for the Stream Control Transmission Protocol (SCTP)
Heyyy bestie ๐ okay so this is RFC 4895, and it's literally giving "authenticate your SCTP chunks so nobody can fake them" ๐โจ
Title Block ๐
So the big facts first. The doc is Authenticated Chunks for the Stream Control Transmission Protocol (SCTP), dated August 2007. It's on the Standards Track ๐ฆ. The authors are M. Tuexen (Muenster Univ. of Applied Sciences), R. Stewart and P. Lei (both Cisco Systems, Inc.), and E. Rescorla (RTFM, Inc.) ๐. The block doesn't have an "Obsoletes" or "Updates" line, so it doesn't say this one replaces or changes any earlier RFC ๐
Status of This Memo ๐
Okay so this one is an Internet standards track protocol for the whole Internet community, and it's basically asking everyone to talk about it and suggest fixes ๐ฌ. If you want to know where SCTP stands officially, check the current "Internet Official Protocol Standards" (STD 1) ๐. And the memo can be shared as much as you want, distribution is unlimited ๐ซถ
Abstract โจ
This doc adds a new chunk type, a few new parameters, and the procedures for using them with SCTP ๐ง. The new chunk type lets you authenticate SCTP chunks using shared keys between sender and receiver ๐. The new parameters are how those shared keys get set up ๐
Table of Contents ๐
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Conventions . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. New Parameter Types . . . . . . . . . . . . . . . . . . . . . 4
3.1. Random Parameter (RANDOM) . . . . . . . . . . . . . . . . 4
3.2. Chunk List Parameter (CHUNKS) . . . . . . . . . . . . . . 5
3.3. Requested HMAC Algorithm Parameter (HMAC-ALGO) . . . . . . 6
4. New Error Cause . . . . . . . . . . . . . . . . . . . . . . . 7
4.1. Unsupported HMAC Identifier Error Cause . . . . . . . . . 7
5. New Chunk Type . . . . . . . . . . . . . . . . . . . . . . . . 8
5.1. Authentication Chunk (AUTH) . . . . . . . . . . . . . . . 8
6. Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . 10
6.1. Establishment of an Association Shared Key . . . . . . . . 10
6.2. Sending Authenticated Chunks . . . . . . . . . . . . . . . 11
6.3. Receiving Authenticated Chunks . . . . . . . . . . . . . . 12
7. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15
8.1. A New Chunk Type . . . . . . . . . . . . . . . . . . . . . 15
8.2. Three New Parameter Types . . . . . . . . . . . . . . . . 15
8.3. A New Error Cause . . . . . . . . . . . . . . . . . . . . 15
8.4. A New Table for HMAC Identifiers . . . . . . . . . . . . . 16
9. Security Considerations . . . . . . . . . . . . . . . . . . . 16
10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 17
11. Normative References . . . . . . . . . . . . . . . . . . . . . 17
1. Introduction โจ
Okay so SCTP uses 32-bit verification tags to protect itself from blind attackers ๐ก๏ธ, and those values don't change for the whole life of an SCTP association ๐
Now, as new SCTP extensions show up, there's a real need for a way to prove that a chunk (or a bunch of chunks) actually came from the original peer that started the association, and not from some sneaky attacker ๐
Using Transport Layer Security (TLS), as defined in RFC 3436 [6], doesn't really solve it, because TLS only secures SCTP user data ๐ โโ๏ธ
So this doc presents an SCTP extension that gives you a way to derive shared keys for each association ๐๏ธ. These association shared keys come from endpoint pair shared keys (which are configured and might be empty) plus data that gets exchanged while the association is being set up ๐งฉ
The extension in this document lets an SCTP sender authenticate chunks using shared keys between the sender and receiver ๐. The receiver can then check that the chunks came from the sender and not a malicious attacker, as long as that attacker doesn't know an association shared key ๐ฆ
Here's the cute part ๐: this extension puts the result of a Hashed Message Authentication Code (HMAC) computation before the data it covers. If you put it at the end of the packet instead, then when you're authenticating DATA chunks you'd have to put a control chunk after the DATA chunks. That breaks the rule that control chunks come before DATA chunks in SCTP packets ๐. It's also worth noting that putting the HMAC result after the covered data would stop you from sending the packet while the HMAC is still being computed. The reason is that the HMAC result is needed to compute the CRC32C checksum of the SCTP packet, and that checksum lives in the packet's common header ๐ง
Last thing, and it's giving main character energy ๐: the SCTP extension for Dynamic Address Reconfiguration (ADD-IP) requires using the extension in this document. The SCTP Partial Reliability Extension (PR-SCTP) can also be used together with it ๐ธ
2. Conventions ๐
Bestie, the keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" are interpreted exactly as described in RFC 2119 [3] whenever they show up in this doc ๐โจ
3. New Parameter Types ๐ฆ
So this section defines the new parameter types that get used to negotiate authentication during association setup ๐ค. Table 1 lays them all out ๐
+----------------+------------------------------------------------+
| Parameter Type | Parameter Name |
+----------------+------------------------------------------------+
| 0x8002 | Random Parameter (RANDOM) |
| 0x8003 | Chunk List Parameter (CHUNKS) |
| 0x8004 | Requested HMAC Algorithm Parameter (HMAC-ALGO) |
+----------------+------------------------------------------------+
Table 1
Note that the parameter format means the receiver has to ignore a parameter it doesn't understand and keep going ๐ซถ. As described in RFC 2960 [5], Section 3.2.1., this works because of the upper bits of the parameter type ๐ง
3.1. Random Parameter (RANDOM) ๐ธ
This parameter carries a random number of arbitrary length ๐ฒ
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Parameter Type = 0x8002 | Parameter Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
\ Random Number /
/ +-------------------------------\
| | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1
Parameter Type: 2 bytes (unsigned integer) ๐ข This value MUST be set to 0x8002.
Parameter Length: 2 bytes (unsigned integer) ๐ This value is the length of the Random Number in bytes plus 4.
Random Number: n bytes (unsigned integer) ๐ฐ This value represents an arbitrary Random Number in network byte order.
Padding: 0, 1, 2, or 3 bytes (unsigned integer) ๐งธ If the length of the Random Number is not a multiple of 4 bytes, the sender MUST pad the parameter with all zero bytes to make the parameter 32-bit aligned. The Padding MUST NOT be longer than 3 bytes and it MUST be ignored by the receiver.
Okay so the RANDOM parameter MUST be included once in the INIT or INIT-ACK chunk if the sender wants to send or receive authenticated chunks, and it provides a 32-byte Random Number ๐. For 32-byte Random Numbers the Padding is empty โจ
3.2. Chunk List Parameter (CHUNKS) ๐
This parameter specifies which chunk types the peer is required to have authenticated before sending them ๐
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Parameter Type = 0x8003 | Parameter Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Chunk Type 1 | Chunk Type 2 | Chunk Type 3 | Chunk Type 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ /
\ ... \
/ /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Chunk Type n | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 2
Parameter Type: 2 bytes (unsigned integer) ๐ข This value MUST be set to 0x8003.
Parameter Length: 2 bytes (unsigned integer) ๐ This value is the number of listed Chunk Types plus 4.
Chunk Type n: 1 byte (unsigned integer) ๐งฉ Each Chunk Type listed is required to be authenticated when sent by the peer.
Padding: 0, 1, 2, or 3 bytes (unsigned integer) ๐งธ If the number of Chunk Types is not a multiple of 4, the sender MUST pad the parameter with all zero bytes to make the parameter 32-bit aligned. The Padding MUST NOT be longer than 3 bytes and it MUST be ignored by the receiver.
So the CHUNKS parameter MUST be included once in the INIT or INIT-ACK chunk if the sender wants to receive authenticated chunks ๐ซง. Its maximum length is 260 bytes ๐
Chunk types for INIT, INIT-ACK, SHUTDOWN-COMPLETE, and AUTH chunks MUST NOT be listed in the CHUNKS parameter ๐ซ. However, if a CHUNKS parameter is received, then the types for INIT, INIT-ACK, SHUTDOWN-COMPLETE, and AUTH chunks MUST be ignored ๐
Real talk: those four chunk types never go in the CHUNKS list, and if one shows up anyway, the receiver has to ignore it. Don't skip this one, bestie ๐ญ
3.3. Requested HMAC Algorithm Parameter (HMAC-ALGO) ๐
okay so this parameter is how you tell your bestie which HMAC Identifiers they MUST use ๐
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Parameter Type = 0x8004 | Parameter Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| HMAC Identifier 1 | HMAC Identifier 2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ /
\ ... \
/ /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| HMAC Identifier n | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 3
Parameter Type: 2 bytes (unsigned integer) ๐งฉ This value MUST be set to 0x8004.Parameter Length: 2 bytes (unsigned integer) ๐ This value is the number of HMAC Identifiers multiplied by 2, plus 4.HMAC Identifier n: 2 bytes (unsigned integer) ๐ The values expressed are a list of HMAC Identifiers that may be used by the peer. The values are listed by preference, with respect to the sender, where the first HMAC Identifier listed is the one most preferable to the sender.Padding: 0 or 2 bytes (unsigned integer) ๐ซง If the number of HMAC Identifiers is not even, the sender MUST pad the parameter with all zero bytes to make the parameter 32-bit aligned. The Padding MUST be 0 or 2 bytes long and it MUST be ignored by the receiver.
The HMAC-ALGO parameter MUST be included once in the INIT or INIT-ACK chunk if the sender wants to send or receive authenticated chunks. โจ
Table 2 shows the currently defined values for HMAC Identifiers. ๐ฆ
+-----------------+--------------------------+
| HMAC Identifier | Message Digest Algorithm |
+-----------------+--------------------------+
| 0 | Reserved |
| 1 | SHA-1 defined in [8] |
| 2 | Reserved |
| 3 | SHA-256 defined in [8] |
+-----------------+--------------------------+
Table 2
Every endpoint supporting SCTP chunk authentication MUST support the HMAC based on the SHA-1 algorithm. ๐จ
4. New Error Cause โจ
this section is where we meet a brand new error cause ๐ it gets sent if an AUTH chunk shows up with an HMAC Identifier nobody can support. Table 3 has the deets.
+------------+-----------------------------+
| Cause Code | Error Cause Name |
+------------+-----------------------------+
| 0x0105 | Unsupported HMAC Identifier |
+------------+-----------------------------+
Table 3
4.1. Unsupported HMAC Identifier Error Cause ๐
this error cause is the "hey, I don't speak that HMAC" message. It tells you an AUTH chunk came in carrying an unsupported HMAC Identifier.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cause Code = 0x0105 | Cause Length = 6 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| HMAC Identifier | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 4
Cause Code: 2 bytes (unsigned integer) ๐ท๏ธ This value MUST be set to 0x0105.Cause Length: 2 bytes (unsigned integer) ๐ This value MUST be set to 6.HMAC Identifier: 2 bytes (unsigned integer) ๐ซ This value is the HMAC Identifier which is not supported.Padding: 2 bytes (unsigned integer) ๐ซง The sender MUST pad the error cause with all zero bytes to make the cause 32-bit aligned. The Padding MUST be 2 bytes long and it MUST be ignored by the receiver.
5. New Chunk Type ๐ฆ
this section introduces the new chunk type that's used to authenticate chunks. Table 4 is the lineup.
+------------+-----------------------------+
| Chunk Type | Chunk Name |
+------------+-----------------------------+
| 0x0F | Authentication Chunk (AUTH) |
+------------+-----------------------------+
Table 4
it should be noted that the AUTH-chunk format makes the receiver ignore the chunk if it isn't understood, and silently discard all chunks that follow. This is done (as described in RFC 2960 [5], Section 3.2.) by using the upper bits of the chunk type. ๐ธ
5.1. Authentication Chunk (AUTH) ๐
this chunk holds the result of the HMAC calculation. ๐
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 0x0F | Flags=0 | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Shared Key Identifier | HMAC Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
\ HMAC /
/ \
/ +-------------------------------\
| | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 5
Type: 1 byte (unsigned integer) ๐ฏ This value MUST be set to 0x0F for all AUTH-chunks.Flags: 1 byte (unsigned integer) ๐ฉ SHOULD be set to zero on transmit and MUST be ignored on receipt.Length: 2 bytes (unsigned integer) ๐ This value holds the length of the HMAC in bytes plus 8.Shared Key Identifier: 2 bytes (unsigned integer) ๐๏ธ This value describes which endpoint pair shared key is used.HMAC Identifier: 2 bytes (unsigned integer) ๐ This value describes which message digest is being used. Table 2 shows the currently defined values.HMAC: n bytes (unsigned integer) ๐ง This holds the result of the HMAC calculation.Padding: 0, 1, 2, or 3 bytes (unsigned integer) ๐ซง If the length of the HMAC is not a multiple of 4 bytes, the sender MUST pad the chunk with all zero bytes to make the chunk 32-bit aligned. The Padding MUST NOT be longer than 3 bytes and it MUST be ignored by the receiver.
the control chunk AUTH MUST NOT appear more than once in an SCTP packet. โ All control and data chunks placed after the AUTH chunk in the packet are sent in an authenticated way. Chunks placed in a packet before the AUTH chunk are not authenticated. Please note that DATA chunks can not appear before control chunks in an SCTP packet. ๐ฆ
6. Procedures ๐
6.1. Establishment of an Association Shared Key ๐
an SCTP endpoint that's willing to receive or send authenticated chunks MUST send one RANDOM parameter in its INIT or INIT-ACK chunk. The RANDOM parameter MUST contain a 32-byte Random Number. The Random Number should be generated in accordance with RFC 4086 [7]. If the Random Number is not 32 bytes, the association MUST be aborted. The ABORT chunk SHOULD contain the error cause 'Protocol Violation'. In case of INIT collision, the rules governing the handling of this Random Number follow the same pattern as those for the Verification Tag, as explained in Section 5.2.4 of RFC 2960 [5]. Therefore, each endpoint knows its own Random Number and the peer's Random Number after the association has been established. ๐ซถ
an SCTP endpoint has a list of chunks it only accepts if they are received in an authenticated way. This list is included in the INIT and INIT-ACK, and MAY be omitted if it is empty. Since this list does not change during the lifetime of the SCTP endpoint, there is no problem in case of INIT collision. ๐
each SCTP endpoint MUST include in the INIT and INIT-ACK a HMAC-ALGO parameter containing a list of HMAC Identifiers it requests the peer to use. The receiver of an HMAC-ALGO parameter SHOULD use the first listed algorithm it supports. The HMAC algorithm based on SHA-1 MUST be supported and included in the HMAC-ALGO parameter. An SCTP endpoint MUST NOT change the parameters listed in the HMAC-ALGO parameter during the lifetime of the endpoint. ๐ฅ
both endpoints of an association MAY have endpoint pair shared keys that are byte vectors and pre-configured or established by another mechanism. They are identified by the Shared Key Identifier. For each endpoint pair shared key, an association shared key is computed. If there is no endpoint pair shared key, only one association shared key is computed by using an empty byte vector as the endpoint pair shared key. ๐๏ธ
the RANDOM parameter, the CHUNKS parameter, and the HMAC-ALGO parameter sent by each endpoint are concatenated as byte vectors. These parameters include the parameter type, parameter length, and the parameter value, but padding is omitted. All padding MUST be removed from this concatenation before proceeding with further computation of keys. Parameters that were not sent are simply omitted from the concatenation process. The resulting two vectors are called the two key vectors. ๐งต
from the endpoint pair shared keys and the key vectors, the association shared keys are computed. This is performed by selecting the numerically smaller key vector and concatenating it to the endpoint pair shared key, and then concatenating the numerically larger key vector to that. If the key vectors are equal as numbers but differ in length, then the concatenation order is the endpoint shared key, followed by the shorter key vector, followed by the longer key vector. Otherwise, the key vectors are identical, and may be concatenated to the endpoint pair key in any order. The concatenation is performed on byte vectors, and all numerical comparisons use network byte order to convert the key vectors to a number. The result of the concatenation is the association shared key. โจ๐ฆ
6.2. Sending Authenticated Chunks โจ
Okay bestie, so endpoints MUST send all requested chunks that have been authenticated, but only when the peer asked for that ๐ซถ The other chunks MAY be sent whether or not they've been authenticated ๐ฆ If endpoint pair shared keys are used, one of them MUST be selected for authentication ๐
To send chunks in an authenticated way, the sender MUST include these chunks after an AUTH chunk. So a sender MUST bundle chunks in order to authenticate them ๐ฆ It's giving "bundle or be ignored" ๐
If the endpoint has no endpoint pair shared key for the peer, it MUST use Shared Key Identifier zero with an empty endpoint pair shared key. If there are multiple endpoint shared keys, the sender selects one and uses the corresponding Shared Key Identifier ๐
The sender MUST calculate the Message Authentication Code (MAC) (as described in RFC 2104 [2]) using the hash function H as described by the HMAC Identifier and the shared association key K based on the endpoint pair shared key described by the Shared Key Identifier. The 'data' used for the computation of the AUTH-chunk is given by the AUTH chunk with its HMAC field set to zero (as shown in Figure 6), followed by all the chunks that are placed after the AUTH chunk in the SCTP packet ๐งฎ
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 0x0F | Flags=0 | Chunk Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Shared Key Identifier | HMAC Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
\ 0 /
/ +-------------------------------\
| | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 6
Please note that all fields are in network byte order, and that the field that will contain the complete HMAC is filled with zeroes. The length of the field shown as zero is the length of the HMAC described by the HMAC Identifier. The padding of all chunks being authenticated MUST be included in the HMAC computation ๐ง
The sender fills the HMAC into the HMAC field and sends the packet ๐
6.3. Receiving Authenticated Chunks ๐ง
The receiver has a list of chunk types that it expects to be received only after an AUTH-chunk. This list has been sent to the peer during the association setup. It MUST silently discard these chunks if they are not placed after an AUTH chunk in the packet ๐
The receiver MUST use the HMAC algorithm indicated in the HMAC Identifier field. If this algorithm was not specified by the receiver in the HMAC-ALGO parameter in the INIT or INIT-ACK chunk during association setup, the AUTH chunk and all the chunks after it MUST be discarded, and an ERROR chunk SHOULD be sent with the error cause defined in Section 4.1 ๐
If an endpoint with no shared key receives a Shared Key Identifier other than 0, it MUST silently discard all authenticated chunks. If the endpoint has at least one endpoint pair shared key for the peer, it MUST use the key specified by the Shared Key Identifier if a key has been configured for that Shared Key Identifier. If no endpoint pair shared key has been configured for that Shared Key Identifier, all authenticated chunks MUST be silently discarded ๐
The receiver now performs the same calculation as described for the sender, based on Figure 6. If the result of the calculation is the same as given in the HMAC field, all the chunks following the AUTH chunk are processed โ If the field does not match the result of the calculation, all the chunks following the AUTH chunk MUST be silently discarded โ
Quick heads-up: if the receiver wants to tear down an association in an authenticated way only, the handling of malformed packets should not result in tearing down the association. (Don't let a bad packet ruin the whole vibe ๐ญ)
An SCTP implementation has to maintain state for each SCTP association. In the following, we call this data structure the SCTP transmission control block (STCB) ๐๏ธ
When an endpoint requires COOKIE-ECHO chunks to be authenticated, some special procedures have to be followed, because the reception of a COOKIE-ECHO chunk might result in the creation of an SCTP association. If a packet arrives containing an AUTH chunk as a first chunk, a COOKIE-ECHO chunk as the second chunk, and possibly more chunks after them, and the receiver does not have an STCB for that packet, then authentication is based on the contents of the COOKIE-ECHO chunk. In this situation, the receiver MUST authenticate the chunks in the packet by using the RANDOM parameters, CHUNKS parameters and HMAC_ALGO parameters obtained from the COOKIE-ECHO chunk, and possibly a local shared secret, as inputs to the authentication procedure specified in Section 6.3. If authentication fails, then the packet is discarded. If the authentication is successful, the COOKIE-ECHO and all the chunks after the COOKIE-ECHO MUST be processed. If the receiver has an STCB, it MUST process the AUTH chunk as described above, using the STCB from the existing association to authenticate the COOKIE-ECHO chunk and all the chunks after it ๐ช
If the receiver does not find an STCB for a packet containing an AUTH chunk as the first chunk, and does not find a COOKIE-ECHO chunk as the second chunk, it MUST use the chunks after the AUTH chunk to look up an existing association. If no association is found, the packet MUST be considered as out of the blue. The out of the blue handling MUST be based on the packet without taking the AUTH chunk into account. If an association is found, it MUST process the AUTH chunk using the STCB from the existing association as described earlier ๐ต๏ธโโ๏ธ
Requiring ABORT chunks and COOKIE-ECHO chunks to be authenticated makes it impossible for an attacker to bring down or restart an association, as long as the attacker does not know the association shared key. But it's also worth noting that if an endpoint accepts ABORT chunks only in an authenticated way, it might take longer to detect that the peer is no longer available ๐ซ If an endpoint accepts COOKIE-ECHO chunks only in an authenticated way, the restart procedure does not work, because the restarting endpoint most likely does not know the association shared key of the old association to be restarted. However, if the restarting endpoint does know the old association shared key, they can successfully send the COOKIE-ECHO chunk in a way that it is accepted by the peer, by using this old association shared key for the packet containing the AUTH chunk. After this operation, both endpoints have to use the new association shared key ๐
If a server has an endpoint pair shared key with some clients, it can request the COOKIE_ECHO chunk to be authenticated, and can ensure that only associations from clients with a correct endpoint pair shared key are accepted ๐
Furthermore, it is important that the cookie contained in an INIT-ACK chunk and in a COOKIE-ECHO chunk MUST NOT contain any endpoint pair shared keys. Keep those keys out of the cookie, periodt ๐ซ๐
7. Examples ๐ง
This section gives examples of message exchanges for association setup ๐
The simplest way of using the extension described in this document is given by the following message exchange:
---------- INIT[RANDOM; CHUNKS; HMAC-ALGO] ---------->
<------- INIT-ACK[RANDOM; CHUNKS; HMAC-ALGO] ---------
-------------------- COOKIE-ECHO -------------------->
<-------------------- COOKIE-ACK ---------------------
Please note that the CHUNKS parameter is optional in the INIT and INIT-ACK ๐ธ
If the server wants to receive DATA chunks in an authenticated way, the following message exchange is possible:
---------- INIT[RANDOM; CHUNKS; HMAC-ALGO] ---------->
<------- INIT-ACK[RANDOM; CHUNKS; HMAC-ALGO] ---------
--------------- COOKIE-ECHO; AUTH; DATA ------------->
<----------------- COOKIE-ACK; SACK ------------------
Please note that if the endpoint pair shared key depends on the client and the server, and is only known by the upper layer, this message exchange requires an upper layer intervention between the processing of the COOKIE-ECHO chunk and the processing of the AUTH and DATA chunk at the server side. This intervention may be realized by a COMMUNICATION-UP notification, followed by the presentation of the endpoint pair shared key by the upper layer to the SCTP stack. See for example Section 10 of RFC 2960 [5]. If this intervention is not possible due to limitations of the API (for example, the socket API), the server might discard the AUTH and DATA chunk, making a retransmission of the DATA chunk necessary. If the same endpoint pair shared key is used for multiple endpoints and does not depend on the client, this intervention might not be necessary ๐งฉ
8. IANA Considerations ๐
This document (RFC 4895) is the reference for all registrations described in this section. All registrations need to be listed in the document available at SCTP-parameters [9]. The changes are described below ๐
8.1. A New Chunk Type ๐
A chunk type for the AUTH chunk has been assigned by IANA. IANA has assigned the value (15), as given in Table 4. An additional line has been added in the "CHUNK TYPES" table of SCTP-parameters [9]:
CHUNK TYPES
ID Value Chunk Type Reference
----- ---------- ---------
15 Authentication Chunk (AUTH) [RFC4895]
8.2. Three New Parameter Types ๐
Parameter types have been assigned for the RANDOM, CHUNKS, and HMAC-ALGO parameters by IANA. The values are as given in Table 1. This required two modifications to the "CHUNK PARAMETER TYPES" tables in SCTP-parameters [9]. The first is the addition of three new lines to the "INIT Chunk Parameter Types" table:
Chunk Parameter Type Value
-------------------- -----
Random 32770 (0x8002)
Chunk List 32771 (0x8003)
Requested HMAC Algorithm Parameter 32772 (0x8004)
The second required change is the addition of the same three lines to the to the "INIT ACK Chunk Parameter Types" table ๐ซถ
8.3. A New Error Cause ๐จ
An error cause for the Unsupported HMAC Identifier error cause has been assigned. The value (261) has been assigned as in Table 3 โจ
This requires an additional line of the "CAUSE CODES" table in SCTP-parameters [9]:
VALUE CAUSE CODE REFERENCE
----- ---------------- ---------
261 (0x0105) Unsupported HMAC Identifier [RFC4895]
8.4. A New Table for HMAC Identifiers
okay so HMAC Identifiers are something IANA has to keep track of, bestie ๐ IANA already handed out four starter values, and they're all listed in Table 2 ๐ That means a brand new table called "HMAC IDENTIFIERS" got added to SCTP-parameters [9] ๐
HMAC Identifier Message Digest Algorithm REFERENCE
--------------- ------------------------ ---------
0 Reserved [RFC4895]
1 SHA-1 [RFC4895]
2 Reserved [RFC4895]
3 SHA-256 [RFC4895]
wanna register a new HMAC Identifier? you have to request a number in this table, and it's giving strict vibes ๐ง That number must be unique, and a message digest algorithm usable with the HMAC defined in RFC 2104 [2] MUST be specified. The "Specification Required" policy of RFC 2434 [4] MUST be applied. no skipping the line, periodt ๐
9. Security Considerations
๐จ okay bestie, this section is SERIOUS, so read it carefully ๐จ
if you're not using endpoint shared keys, this extension only protects against modification or injection of authenticated chunks by attackers who did not capture the initial handshake that sets up the SCTP association. so it's not a full shield, it's a partial one ๐ก๏ธ
now if an endpoint pair shared key is used, the vibe changes completely ๐ญ even a true man in the middle cannot inject chunks that are required to be authenticated, even if he intercepts the initial message exchange. the endpoint also knows it's accepting authenticated chunks from a peer who knows the endpoint pair shared key. iconic protection, no cap ๐
the establishment of endpoint pair shared keys is out of the scope of this document, so that's a whole other story ๐ other mechanisms can be used for it, like TLS or manual configuration.
when an endpoint accepts COOKIE-ECHO chunks only in an authenticated way, the restart procedure does not work. neither an attacker nor a restarted endpoint that doesn't know the association shared key can perform a restart ๐ however, if the association shared key is known, it is possible to restart the association. so guard that key like it's your diary ๐
SCTP already has a built-in mechanism that handles duplicated chunks, so the presented solution makes use of that functionality and does not provide its own method to avoid replay attacks. of course, this only works within each SCTP association. that's why a separate shared key is used for each SCTP association, to handle replay attacks covering multiple SCTP associations โจ
each endpoint presenting a list of more than one element in the HMAC-ALGO parameter must be prepared for the peer using the weakest algorithm listed. so if you're offering a bunch of options, be ready for the other side to pick the weakest one ๐ฅบ
finally, when an endpoint pair uses non-NULL endpoint pair shared keys but one of the endpoints still accepts a NULL key, an attacker who captured the initial handshake can still inject or modify authenticated chunks by using the NULL key. translation: one accepted NULL key and the whole lock is cooked ๐
10. Acknowledgments
the authors wanna thank David Black, Sascha Grau, Russ Housley, Ivan Arias Rodriguez, Irene Ruengeler, and Magnus Westerlund for their invaluable comments ๐ซถ the main character supporting cast, honestly ๐ธ
11. Normative References
- [1] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, April 1992.
- [2] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-Hashing for Message Authentication", RFC 2104, February 1997.
- [3] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
- [4] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 2434, October 1998.
- [5] Stewart, R., Xie, Q., Morneault, K., Sharp, C., Schwarzbauer, H., Taylor, T., Rytina, I., Kalla, M., Zhang, L., and V. Paxson, "Stream Control Transmission Protocol", RFC 2960, October 2000.
- [6] Jungmaier, A., Rescorla, E., and M. Tuexen, "Transport Layer Security over Stream Control Transmission Protocol", RFC 3436, December 2002.
- [7] Eastlake, D., Schiller, J., and S. Crocker, "Randomness Requirements for Security", BCP 106, RFC 4086, June 2005.
- [8] National Institute of Standards and Technology, "Secure Hash Standard", FIPS PUB 180-2, August 2002,
http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf. - [9]
http://www.iana.org/assignments/sctp-parameters
Authors' Addresses
Michael Tuexen
Muenster Univ. of Applied Sciences
Stegerwaldstr. 39
48565 Steinfurt
Germany
EMail: tuexen@fh-muenster.de
Randall R. Stewart
Cisco Systems, Inc.
4875 Forest Drive
Suite 200
Columbia, SC 29206
USA
EMail: rrs@cisco.com
Peter Lei
Cisco Systems, Inc.
8735 West Higgins Road
Suite 300
Chicago, IL 60631
USA
Phone:
EMail: peterlei@cisco.com
Eric Rescorla
RTFM, Inc.
2064 Edgewood Drive
Palo Alto, CA 94303
USA
Phone: +1 650-320-8549
EMail: ekr@rtfm.com
Full Copyright Statement
Copyright (C) The IETF Trust (2007). ๐
This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.
This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Intellectual Property
The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org. ๐
that's the whole spec, bestie ๐โจ literally a masterpiece
๐ฆ where this page comes from
- ietf: rfc4895 2007-08
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms