RFC 6113
A Generalized Framework for Kerberos Pre-Authentication
RFC 6113: A Generalized Framework for Kerberos Pre-Authentication ๐
Okay bestie, here's the deal ๐ This is RFC 6113, and it's giving standards track ๐ It was written by S. Hartman from Painless Security and L. Zhu from Microsoft Corporation, and it dropped in April 2011. It has ISSN 2070-1721. It updates RFC 4120, which is the core Kerberos spec, so this one is basically a glow-up for it. The title block doesn't list anything it obsoletes, so nothing gets retired here ๐ซถ
Abstract
Okay so Kerberos is a protocol for checking who someone is (a workstation user, a network server, anybody, really) on an open network ๐ It has a feature called pre-authentication, and pre-authentication mechanisms can use it to extend Kerberos and prove a principal's identity โจ
This doc gives a more formal model for that feature ๐ง It explains which parts of the Kerberos request a pre-auth mechanism is likely to change, and how several pre-auth mechanisms in the same request interact with each other. The vibes are very "they're all in one group chat now" ๐
It also brings common tools that multiple pre-auth mechanisms need ๐งฐ The big one is a secure channel between the client and the key distribution center, with a reply key strengthening mechanism. That channel protects the authentication exchange, so offline dictionary attacks basically get eliminated ๐ With all this, it's pretty easy to chain multiple authentication mechanisms, use a different key management system, or support a brand new key agreement algorithm. Iconic ๐ญ๐ฆ
Status of This Memo
This is an Internet Standards Track document ๐ธ
It's a product of the Internet Engineering Task Force (IETF), so it reflects the consensus of the IETF community. It went through public review and got approved for publication by the Internet Engineering Steering Group (IESG) ๐ซถ For more on Internet Standards, check Section 2 of RFC 5741.
If you want the current status, any errata, or a way to send feedback, go to http://www.rfc-editor.org/info/rfc6113 ๐
Copyright Notice
Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved ๐
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they're in effect on the publication date. Please actually read those, because they explain your rights and restrictions for this doc, and they matter ๐ Any Code Components pulled out of this document have to include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions. They come without warranty, as described in the Simplified BSD License ๐ง
Table of Contents
1. Introduction ....................................................4
1.1. Conventions and Terminology Used in This Document ..........5
1.2. Conformance Requirements ...................................5
2. Model for Pre-Authentication ....................................6
2.1. Information Managed by the Pre-Authentication Model ........7
2.2. Initial Pre-Authentication Required Error ..................9
2.3. Client to KDC .............................................10
2.4. KDC to Client .............................................11
3. Pre-Authentication Facilities ..................................12
3.1. Client Authentication Facility ............................13
3.2. Strengthening Reply Key Facility ..........................13
3.3. Replace Reply Key Facility ................................14
3.4. KDC Authentication Facility ...............................15
4. Requirements for Pre-Authentication Mechanisms .................15
4.1. Protecting Requests/Responses .............................16
5. Tools for Use in Pre-Authentication Mechanisms .................17
5.1. Combining Keys ............................................17
5.2. Managing States for the KDC ...............................19
5.3. Pre-Authentication Set ....................................20
5.4. Definition of Kerberos FAST Padata ........................23
5.4.1. FAST Armors ........................................24
5.4.2. FAST Request .......................................26
5.4.3. FAST Response ......................................30
5.4.4. Authenticated Kerberos Error Messages Using
Kerberos FAST ......................................33
5.4.5. Outer and Inner Requests ...........................34
5.4.6. The Encrypted Challenge FAST Factor ................34
5.5. Authentication Strength Indication ........................36
6. Assigned Constants .............................................37
6.1. New Errors ................................................37
6.2. Key Usage Numbers .........................................37
6.3. Authorization Data Elements ...............................37
6.4. New PA-DATA Types .........................................37
7. IANA Considerations ............................................38
7.1. Pre-Authentication and Typed Data .........................38
7.2. Fast Armor Types ..........................................40
7.3. FAST Options ..............................................40
8. Security Considerations ........................................41
9. Acknowledgements ...............................................42
10. References ....................................................43
10.1. Normative References .....................................43
10.2. Informative References ...................................43
Appendix A. Test Vectors for KRB-FX-CF2 ...........................45
Appendix B. ASN.1 Module ..........................................46
1. Introduction โจ
Okay so the core Kerberos spec [RFC4120] treats pre-authentication data (padata) as an opaque typed hole in the messages to the key distribution center (KDC). That hole can influence the reply key used to encrypt the KDC reply ๐ This generality has been super useful. Pre-auth data gets used for all kinds of extensions, a lot of them way beyond what the original designers had in mind ๐ The downside is that designing the more common kinds of pre-auth mechanisms is hard. Every mechanism has to spell out how it plays with the others ๐ญ Tasks like combining a key with the long-term secrets, or proving who the user is, show up across multiple mechanisms too. When there's a generally well-accepted solution to one of these problems, it's worth standardizing it so mechanisms don't keep redoing the same work ๐ง For other problems, a modular approach is the move. That way, better solutions can slide into existing mechanisms as they get developed ๐ฆ
This document specifies a framework for Kerberos pre-authentication mechanisms ๐ It defines the common set of functions that pre-auth mechanisms perform, and how those functions change the state of the request and reply. It also provides several common tools that pre-auth mechanisms need ๐ Unlike [RFC3961], this framework isn't complete. It doesn't describe all the inputs and outputs for pre-auth mechanisms, so it's not the whole story ๐ Still, mechanism designers should try to stay consistent with this framework, because it makes their mechanisms easier to implement ๐ซถ Kerberos implementations are likely to have plug-in architectures for pre-auth, and those will probably support mechanisms that follow this framework plus commonly used extensions. The framework also makes it easier to combine multiple pre-auth mechanisms (each of which might be an authentication factor) into one single multi-factor pre-auth mechanism ๐ฅ
One of these common tools is the flexible authentication secure tunneling (FAST) padata type ๐ธ FAST gives you a protected channel between the client and the key distribution center (KDC), and it can optionally deliver key material to strengthen the reply key, all inside that protected channel ๐ Because of FAST, pre-auth mechanisms can extend Kerberos with ease. For example, they can support password-authenticated key exchange (PAKE) protocols with zero-knowledge password proof (ZKPP) [EKE] [IEEE1363.2] ๐ Any pre-auth mechanism can be encapsulated in the FAST messages, as defined in Section 5.4. A pre-auth type carried within FAST is called a "FAST factor" โจ Creating a FAST factor is the easiest way to make a new pre-auth mechanism. FAST factors are also way easier to analyze from a security standpoint than other pre-auth mechanisms, so this is a big deal ๐
Mechanism designers should design FAST factors, instead of making new pre-auth mechanisms outside of FAST ๐ง
1.1. Conventions and Terminology Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119] ๐
Before you read this doc, you should have read the documents describing the Kerberos cryptography framework [RFC3961] and the core Kerberos protocol [RFC4120] ๐ค This document may freely use terminology and notation from those two without explaining it again, so keep them handy ๐
The word padata is shorthand for pre-authentication data ๐
A conversation is the full set of authentication messages exchanged between the client and the client's Authentication Service (AS) in order to authenticate the client principal. A conversation, as defined here, includes every message needed to finish the authentication between the client and the client's AS ๐ In the Ticket Granting Service (TGS) exchange, a conversation is the request message plus the reply message. The term conversation is defined here for both AS and TGS, just to make discussion easier ๐ For the specific rules on how far a conversation extends in the AS-REQ case, see Section 5.2. Before this framework, implementations had to use their own heuristics to figure out where a conversation ended ๐ญ
If the KDC reply in an AS exchange is verified, the client authenticates the KDC. In this document, verification of the KDC reply is used as a synonym for authentication of the KDC ๐ซถ
1.2. Conformance Requirements
Okay, so this section is the mandatory-to-implement cheat sheet, just a convenient summary for implementors ๐ The real requirements and their context live in the body of the document, so don't skip there for the full story โจ
Clients conforming to this specification MUST support the padata defined in Section 5.2 ๐ธ
Conforming implementations MUST support Kerberos FAST padata (Section 5.4) ๐ They also MUST implement the FX_FAST_ARMOR_AP_REQUEST armor type ๐ฅ
Conforming implementations MUST support the encrypted challenge FAST factor (Section 5.4.6) ๐ฆ
2. Model for Pre-Authentication โจ
okay bestie, let's talk about how a Kerberos client actually asks for a ticket ๐ When a client wants a ticket, it sends an initial Authentication Service (AS) request to the KDC. If pre-authentication is required but nobody's using it, the KDC replies with KDC_ERR_PREAUTH_REQUIRED [RFC4120]. Rude, but iconic ๐
Alternatively, if the client already knows which pre-auth to use, it MAY skip a round trip and put the padata right in the initial request โก If the padata was computed with the wrong pre-auth mechanism or incorrect keys, the KDC MAY return KDC_ERR_PREAUTH_FAILED and won't tell you what padata it wanted ๐ In that case, the client MUST retry with no padata and check the error data of the KDC_ERR_PREAUTH_REQUIRED error. If the KDC puts pre-auth info in the error data of KDC_ERR_PREAUTH_FAILED, the client SHOULD process that error data and then retry.
The conventional KDC keeps no state between requests, and the next request might even land on a totally different KDC ๐ The client, though, treats a whole series of exchanges as one conversation. Each exchange piles up state and hopefully gets the client closer to a successful authentication โจ
These two models look like they clash ๐ญ For lots of simple pre-auth setups, the client uses one round trip to learn which mechanisms the KDC supports. Then the next request has enough pre-auth for the KDC to send back a successful reply. For these simple cases, the client only sends one request with pre-auth data, so the convo is trivial ๐ For more complex conversations, the KDC needs to give the client a cookie to include in future requests, which captures the current state of the auth session ๐ช Multi-round-trip mechanisms are covered in Section 5.2.
This framework describes how Kerberos pre-auth mechanisms behave when they're used to identify users or to change the reply key that encrypts the KDC reply. The PA-DATA typed hole can carry extensions that have nothing to do with proving who the user is or setting up a reply key, but those are outside the scope of this framework ๐ซ Still, mechanisms that do accomplish these goals should follow this framework.
This framework specifies the minimum state a Kerberos implementation needs to keep while handling a request so it can do pre-auth. It also spells out how Kerberos implementations process the padata at each step of the AS request process ๐
2.1. Information Managed by the Pre-Authentication Model
The client and the KDC both keep track of this info as each request gets processed:
- The reply key used to encrypt the KDC reply
- How strongly the identity of the client has been authenticated
- Whether the reply key has been used in this conversation
- Whether the reply key has been replaced in this conversation
- Whether the origin of the KDC reply can be verified by the client (i.e., whether the KDC is authenticated to the client)
Conceptually, the reply key starts out as the principal's long-term key. But principals can have several long-term keys, thanks to multiple encryption types, salts, and string2key parameters ๐ As described in Section 5.2.7.5 of the Kerberos protocol [RFC4120], the KDC sends PA-ETYPE-INFO2 to tell the client which key types are available. So, in full generality, the reply key in the pre-auth model is actually a set of keys. At the start of a request, it's set to the long-term keys advertised in PA-ETYPE-INFO2 on the KDC. If multiple reply keys are available, the client chooses which one to use, so the client doesn't need to treat the reply key as a set. At the beginning of a request, the client picks a key to use.
KDC implementations MAY choose to offer only one key in the PA-ETYPE-INFO2 element ๐ฏ Since the KDC already knows the client's list of supported enctypes from the request, no interoperability problems come up from choosing a single possible reply key. That way, the KDC skips the whole "treat the reply key as a set" complexity ๐
When the padata in the request are verified by the KDC, the client is known to have that key. Therefore, the KDC SHOULD pick the same key as the reply key โ
At the beginning of handling a message on both the client and the KDC, the client's identity is not authenticated. A mechanism may indicate that it has successfully authenticated the client's identity. It's useful to track this on the client so it knows which pre-auth mechanisms should be used. The KDC needs to track whether the client is authenticated, because the primary purpose of pre-auth is to authenticate the client identity before issuing a ticket. The handling of authentication strength across various authentication mechanisms is discussed in Section 5.5.
Initially, the reply key is not used. A pre-auth mechanism that uses the reply key to encrypt or checksum some data while generating new keys MUST indicate that the reply key is used. The client and the KDC keep this state to enforce the security requirement in Section 3.3 that the reply key SHOULD NOT be replaced after it has been used. ๐
Initially, the reply key is not replaced. If a mechanism implements the Replace Reply Key facility discussed in Section 3.3, then the state MUST be updated to show that the reply key has been replaced. Once the reply key has been replaced, knowing the reply key is insufficient to authenticate the client. The reply key is marked as replaced in exactly the same situations where the KDC reply is marked as not verified to the client principal. However, while mechanisms can verify the KDC reply to the client, once the reply key is replaced, it stays replaced for the remainder of the conversation.
Without pre-auth, the client knows the KDC reply is authentic and hasn't been modified, because it's encrypted in the client's long-term key. Only the KDC and the client know that key ๐คซ So at the start of a conversation, the KDC reply is presumed verified using the client's long-term key. Heads up: in this document, verifying the KDC reply means authenticating the KDC, and the two phrases are used interchangeably. Any pre-auth mechanism that sets a new reply key not based on the principal's long-term secret MUST either verify the KDC reply some other way or indicate that the reply is not verified. If a mechanism indicates the reply is not verified, the client implementation MUST return an error unless a subsequent mechanism verifies the reply. The KDC needs to track this state so it can avoid generating a reply that is not verified.
In this specification, KDC verification/authentication refers to the level of authentication of the KDC to the client provided by RFC 4120. There's a stronger form of KDC verification that matters in some Kerberos deployments but isn't addressed in this specification ๐ฌ The typical Kerberos request doesn't give the client machine a way to know it's talking to the correct KDC. Someone who can inject packets into the network between the client machine and the KDC, and who knows the password the user will type into the client machine, can generate a KDC reply that decrypts properly. So if the client machine needs to authenticate that the user really is the named principal, the client machine needs to do a TGS request for itself as a service. Some pre-auth mechanisms may provide a way for the client machine to authenticate the KDC. Examples include signing the reply so it can be verified using a well-known public key, or providing a ticket for the client machine as a service. ๐ก๏ธ
2.2. Initial Pre-Authentication Required Error
Typically, a client starts the conversation by sending an initial request with no pre-authentication. If the KDC requires pre-auth, it returns KDC_ERR_PREAUTH_REQUIRED. After that first reply with the KDC_ERR_PREAUTH_REQUIRED error code, the KDC returns the error code KDC_ERR_MORE_PREAUTH_DATA_REQUIRED (defined in Section 5.2) for pre-auth configurations that use multi-round-trip mechanisms. See Section 2.4 for details of that case. ๐
The KDC needs to choose which mechanisms to offer the client. The client needs to be able to choose which mechanisms to use from the first message. For example, consider a KDC that will accept mechanism A followed by mechanism B, or alternatively the single mechanism C. A client that supports A and C needs to know that it should not bother trying A ๐ โโ๏ธ
Mechanisms can either be sufficient on their own or be part of an authentication set, which is a group of mechanisms that all need to successfully complete in order to authenticate a client. Some mechanisms may only be useful in authentication sets, while others may be useful alone or in authentication sets. For the second group of mechanisms, KDC policy dictates whether the mechanism will be part of an authentication set, offered alone, or both. For each mechanism that is offered alone (even if it is also offered in an authentication set), the KDC includes the pre-authentication type ID of the mechanism in the padata sequence returned in the KDC_ERR_PREAUTH_REQUIRED error. Mechanisms that are only offered as part of an authentication set are not directly represented in the padata sequence returned in the KDC_ERR_PREAUTH_REQUIRED error, although they are represented in the PA-AUTHENTICATION-SET sequence. ๐งฉ
The KDC SHOULD NOT send data that is encrypted in the long-term password-based key of the principal. Doing so has the same security exposures as the Kerberos protocol without pre-authentication. There are few situations where the KDC needs to expose ciphertext encrypted in a weak key before the client has proven knowledge of that key, and where pre-authentication is desirable. ๐จ
2.3. Client to KDC โจ
okay so this part assumes the client has already gotten a KDC_ERR_PREAUTH_REQUIRED from the KDC ๐. If the client does optimistic pre-authentication, it has to guess the stuff it would normally get from that error, or use cached info from earlier chats with the KDC ๐ค.
The client starts by setting up its pre-authentication state, as specified. Then it processes the padata in the KDC_ERR_PREAUTH_REQUIRED ๐
.
When the client processes the response to KDC_ERR_PREAUTH_REQUIRED, it MAY ignore any padata it picks, unless ignoring it would break a specification the client conforms to ๐. Clients conforming to this specification MUST NOT ignore the padata defined in Section 5.2 ๐ซ. Clients SHOULD choose one authentication set or mechanism that could lead to authenticating the user, and ignore the other ones ๐ฏ. This rule doesn't touch padata unrelated to this framework, though, so clients SHOULD still process that padata normally ๐ซถ. The KDC lists its mechanisms in decreasing preference order, so clients usually go with the first mechanism or authentication set they can actually use ๐. If a client chooses to ignore some padata, it MUST NOT process that padata, MUST NOT let it affect the pre-authentication state, and MUST NOT respond to it ๐
โโ๏ธ.
For each instance of padata the client decides to process, it processes that padata and updates the pre-authentication state as that mechanism requires ๐ง.
After processing the padata in the KDC error, the client generates a new request ๐. It processes the pre-authentication mechanisms in the order they will appear in the next request, updating the state as it goes. The request gets sent once it's complete ๐ฆ.
2.4. KDC to Client โจ
When a KDC gets an AS request from a client, it needs to decide whether to send back an error or an AS reply ๐ค. Plenty of errors have nothing to do with pre-authentication (the core Kerberos specification covers those) ๐.
From the pre-authentication point of view, the KDC starts by setting up its pre-authentication state ๐ธ. If a PA-FX-COOKIE pre-authentication data item is present, it gets processed first; check Section 5.2 for its definition ๐ช. Then the KDC processes the padata in the request. As mentioned in Section 2.3, the KDC MAY ignore padata that don't fit its configuration, and it MUST ignore padata of an unknown type ๐ค. The KDC MUST NOT ignore padata of types used in earlier messages. For example, if a KDC sends a KDC_ERR_PREAUTH_REQUIRED error that includes padata of type x, then it cannot ignore padata of type x that shows up in an AS-REQ message from the client ๐จ.
At this point, the KDC decides whether to send an error or a reply. Usually, a KDC sends a reply once the client's identity has been authenticated to a sufficient degree ๐.
For a KDC_ERR_MORE_PREAUTH_DATA_REQUIRED error, the KDC again starts by setting up the pre-authentication state. Then it processes any padata in the client's request, in the order the client gave them. Mechanisms the KDC doesn't understand just get ignored ๐ซฅ. Next, it generates padata for the error response, updating the pre-authentication state appropriately as each mechanism runs ๐. The KDC picks the order it generates padata in (and that sets the order of padata in the response), but it has to update the pre-authentication state consistently with that order. For example, if one mechanism establishes an authenticated client identity, the mechanisms that come after it in the generated response get that state as input ๐ชช. Once the padata are generated, the error response gets sent. Usually, the errors with the code KDC_ERR_MORE_PREAUTH_DATA_REQUIRED in a conversation will include KDC state, as discussed in Section 5.2 ๐ง.
To generate a final reply, the KDC generates the padata, updating the pre-authentication state as needed. Then it generates the final response and encrypts it with the current pre-authentication reply key ๐โจ.
3. Pre-Authentication Facilities ๐
Pre-authentication mechanisms can be thought of as providing various conceptual facilities ๐งฉ. This is useful for two reasons. First, mechanism authors can choose to solve just one small, specific problem ๐ฏ. It's often handy for a mechanism designed for key management to not handle client authentication directly, and instead let one or more other mechanisms take care of that ๐ค. Secondly, thinking about the abstract services a mechanism provides gives you a minimum set of security requirements that every mechanism providing that facility must meet ๐ก๏ธ. These security requirements aren't complete, though. Mechanisms will have extra security requirements based on the specific protocol they use ๐.
A mechanism isn't limited to offering just one of these facilities. Mechanisms like that can be designed and are sometimes useful, but lots of pre-authentication mechanisms implement several facilities at once ๐. It's often easier to build a secure, simple solution by combining multiple facilities in one mechanism than by solving the whole problem in full generality ๐ง . Even when a mechanism provides multiple facilities, it needs to meet the security requirements for all of them ๐ช. If the FAST factor approach is used, one mechanism can probably provide one or a small number of facilities without complicating the security analysis ๐ฆ.
According to the Kerberos extensibility rules (Section 1.5 of the Kerberos specification [RFC4120]), an extension MUST NOT change the semantics of a message unless the recipient is known to understand that extension ๐. A client doesn't know whether the KDC supports a particular pre-authentication mechanism when it sends its initial request. So a pre-authentication mechanism MUST NOT change the semantics of the request in a way that would break a KDC that doesn't understand that mechanism ๐ฌ. In the same spirit, KDCs MUST NOT send messages to clients that affect the core semantics unless the client has indicated support for that message ๐ โโ๏ธ.
The only state in this model that would break the interpretation of a message is changing the expected reply key ๐. If one mechanism changes the reply key and a later mechanism uses that reply key, a KDC that understood the second mechanism but not the first would fail to interpret the request correctly ๐. To avoid this, extensions that change core semantics are usually split into two parts ๐ฐ. The first part proposes a change to a core semantic (for example, proposing a new reply key) ๐. The second part acknowledges that the extension is understood and that the change takes effect โ . Section 3.2 explains how to design mechanisms that modify the reply key so the change is split into a proposal and an acceptance, without needing extra round trips to use the new reply key in later pre-authentication ๐. Other changes in the state described in Section 2.1 can safely be ignored by a KDC that doesn't understand a mechanism ๐. Mechanisms that change the behaviour of the request outside the scope of this framework need to think carefully about the Kerberos extensibility rules, so they don't run into similar problems ๐ง.
3.1. Client Authentication Facility โจ
The Client Authentication facility proves a user's identity to the KDC before a ticket is issued ๐ชช. Examples of mechanisms implementing this facility include the encrypted timestamp facility, defined in Section 5.2.7.2 of the Kerberos specification [RFC4120] โฐ. Mechanisms that provide this facility are expected to mark the client as authenticated โ๏ธ.
Mechanisms implementing this facility SHOULD require the client to prove it knows the reply key before sending a successful KDC reply ๐. Otherwise, an attacker could intercept the pre-authentication exchange and get a reply to attack with ๐ฑ. One way to prove the client knows the reply key is to implement the Replace Reply Key facility alongside this one ๐. The Public Key Cryptography for Initial Authentication in Kerberos (PKINIT) mechanism [RFC4556] implements Client Authentication alongside Replace Reply Key ๐๏ธ.
If the reply key has been replaced, then mechanisms such as encrypted-timestamp, which rely on knowing the reply key to authenticate the client, MUST NOT be used ๐ซ.
3.2. Strengthening Reply Key Facility ๐
Particularly when dealing with keys based on passwords, it's desirable to make the key stronger by adding extra secrets to it ๐ช. Examples of sources for those extra secrets include the results of a Diffie-Hellman key exchange, or key bits from the output of a smart card [KRB-WG.SAM] ๐ณ. Typically, these additional secrets can first be combined with the existing reply key, and then converted to a protocol key using the tools defined in Section 5.1 ๐งช.
Typically, a mechanism implementing this facility knows that the other side of the exchange supports the facility before the reply key is changed ๐ค. For example, a mechanism might need to learn a KDC's certificate before encrypting a new key in the public key belonging to that certificate ๐. However, if a mechanism implementing this facility wants to modify the reply key before knowing that the other party supports the mechanism, it proposes modifying the reply key ๐ก. The other party then includes a message saying the proposal is accepted, if it's understood and meets policy โ . In many cases, it's desirable to use the new reply key for client authentication and for other facilities too ๐ซถ. Waiting for the other party to accept the proposal and actually modify the reply key state would add an extra round trip to the exchange ๐ข. So instead, mechanism designers are encouraged to include a typed hole for additional padata in the message that proposes the reply key change ๐ณ๏ธ. The padata in the typed hole are generated assuming the new reply key. If the other party accepts the proposal, those padata are treated as an inner level. Just like with the outer level, one authentication set or mechanism is typically chosen for client authentication, along with auxiliary mechanisms such as KDC cookies, and the other mechanisms get ignored ๐. When mechanisms include such a container, the hint provided for use in authentication sets (as defined in Section 5.3) MUST contain a sequence of inner mechanisms along with hints for those mechanisms ๐. The party that generated the proposal can tell whether the padata were processed by checking whether the proposal for the reply key was accepted โจ.
The specific formats of the proposal message, including where padata are included, are up to the mechanism specification ๐. Likewise, the format of the message accepting the proposal is mechanism specific ๐งพ.
Mechanisms implementing this facility and including a typed hole for additional padata MUST checksum that padata using a keyed checksum, or encrypt the padata ๐. This requirement protects against modification of the contents of the typed hole ๐ก๏ธ. By modifying those contents, an attacker might be able to choose which mechanism gets used to authenticate the client, or convince a party to provide text encrypted in a key the attacker had manipulated ๐. It's really important that mechanisms strengthen the reply key enough that using it to checksum padata is appropriate ๐จ๐ .
3.3. Replace Reply Key Facility โจ
okay so this facility swaps out the key that a successful AS reply gets encrypted in ๐ Bestie, it's only usable when knowing the reply key isn't how the client gets authenticated, otherwise it's a whole mess ๐
The new reply key MUST be communicated to the client and the KDC in a secure manner ๐. This facility MUST NOT be used if there can be a man-in-the-middle between the client and the KDC ๐ โโ๏ธ. Mechanisms implementing this facility MUST mark the reply key as replaced in the pre-authentication state ๐ท๏ธ. They also MUST either provide a mechanism to verify the KDC reply to the client or mark the reply as unverified in the pre-authentication state ๐. And mechanisms implementing this facility SHOULD NOT be used if a previous mechanism has used the reply key ๐ซ
As with the Strengthening Reply Key facility, Kerberos extensibility rules say the reply key can't change unless both sides of the exchange understand the extension ๐งฉ For this facility, both sides will probably know it's available by the time the new key is ready to go ๐ But mechanism designers can use a container for padata in a proposal message, as discussed in Section 3.2, if it makes sense ๐
3.4. KDC Authentication Facility ๐ก๏ธ
This facility checks that the reply comes from the expected KDC ๐ In traditional Kerberos, the KDC and the client share a key, so if the KDC reply can be decrypted, the client knows a trusted KDC responded ๐ฅฐ Note that the client machine cannot trust the client unless the machine is presented with a service ticket for it (typically, the machine can retrieve this ticket by itself) ๐คทโโ๏ธ However, if the reply key is replaced, some mechanism is required to verify the KDC ๐ Pre-authentication mechanisms providing this facility let a client figure out that the expected KDC has responded even after the reply key is replaced ๐ฆ They mark the pre-authentication state as having been verified โ
4. Requirements for Pre-Authentication Mechanisms ๐
This section is the checklist for anyone writing a pre-authentication mechanism ๐
For each message in the pre-authentication mechanism, the specification describes the pa-type value to be used and the contents of the message ๐จ It also covers how the sender and recipient process the message. The spec needs to include all modifications to the pre-authentication state too ๐งพ
Generally, mechanisms have a message that can be sent in the error data of the KDC_ERR_PREAUTH_REQUIRED error message or in an authentication set ๐ If the client needs information, such as trusted certificate authorities, to figure out whether it can use the mechanism, that info should be in that message ๐๏ธ Such mechanisms should also define a pa-hint to be included in authentication sets ๐ธ Often, the same info included in the padata-value is a good fit for the pa-hint (as defined in Section 5.3) โจ
To make security analysis easier, the mechanism specification should describe which facilities from this document the mechanism offers ๐ For each facility, the security considerations section of the mechanism specification should show that the security requirements of that facility are met ๐ซถ This applies to any FAST factor that provides authentication information too ๐
Okay this part is serious ๐ญ Significant problems have come up in Kerberos protocols because so much of the KDC exchange isn't protected against alteration ๐ The security considerations section should discuss unauthenticated plaintext attacks โ ๏ธ It should either show that plaintext is protected or discuss what harm an attacker could do by modifying the plaintext ๐ต๏ธโโ๏ธ It's generally acceptable for an attacker to be able to make the protocol negotiation fail by modifying plaintext ๐ More significant attacks should be evaluated carefully ๐ฅ
As discussed in Section 5.2, there's no guarantee that a client will use the same KDCs for every message in a conversation ๐ The mechanism specification needs to show why the mechanism is secure in that situation ๐ The hardest problem, especially for challenge/response mechanisms, is making sure the same response can't be replayed against two KDCs while still letting the client talk to any KDC ๐ตโ๐ซ
4.1. Protecting Requests/Responses ๐ง
Mechanism designers SHOULD protect cleartext portions of pre-authentication data ๐ก๏ธ Various denial-of-service attacks and downgrade attacks against Kerberos are possible unless plaintexts are somehow protected against modification ๐ฌ An early design goal of Kerberos Version 5 [RFC4120] was to avoid encrypting more of the authentication exchange than was required ๐ฏ (Version 4 doubly-encrypted the encrypted part of a ticket in a KDC reply, for example ๐) This minimization of encryption reduces the load on the KDC and busy servers ๐ Also, during the initial design of Version 5, legal restrictions on exporting cryptography made it desirable to minimize the number of uses of encryption in the protocol ๐ Unfortunately, that minimization created numerous instances of unauthenticated security-relevant plaintext fields ๐
Mechanisms MUST guarantee that by the end of a successful authentication exchange, both the client and the KDC have verified all the plaintext sent by the other party ๐ If there's more than one round trip in the exchange, mechanisms MUST additionally guarantee that no individual messages were reordered or replayed from a previous exchange ๐ Strategies for this include using message authentication codes (MACs) to protect the plaintext as it's sent, with some form of nonce or cookie so state can be chained from one message to the next, or exchanging a MAC of the entire conversation after a key is established ๐งท
Mechanism designers need to provide a strategy for updating cryptographic algorithms ๐ Examples include defining a new pre-authentication type for each algorithm, or using the client's list of supported RFC 3961 encryption types to indicate the client's support for cryptographic algorithms ๐
Primitives defined in [RFC3961] are RECOMMENDED for integrity protection and confidentiality ๐ Mechanisms based on these primitives are crypto-agile because they use [RFC3961] along with [RFC4120] ๐ฆ The big win of crypto-agility is being able to roll out a fix for one specific algorithm without going through a multi-year standardization and deployment cycle when real attacks show up ๐
Note that data used by FAST factors (defined in Section 5.4) is encrypted in a protected channel ๐ So they don't share the unauthenticated-text issues that come with mechanisms designed as full-blown pre-authentication mechanisms ๐
5. Tools for Use in Pre-Authentication Mechanisms ๐งฐ
This section covers common tools that multiple pre-authentication mechanisms need ๐ ๏ธ By using these tools, mechanism designers can take a modular approach to specifying mechanism details, which makes security analysis easier ๐
5.1. Combining Keys ๐
Frequently, a weak key needs to be combined with a stronger key before use ๐ช For example, passwords are typically limited in size and not random enough, so it's smart to boost the strength of password-based keys by adding extra secrets โจ An extra source of secrecy can come from hardware tokens ๐
This section provides standard ways to combine two keys into one ๐งฉ
KRB-FX-CF1() is defined to combine two passphrases ๐
KRB-FX-CF1(UTF-8 string, UTF-8 string) -> (UTF-8 string)
KRB-FX-CF1(x, y) := x || y
Where || denotes concatenation ๐งต The strength of the final key is roughly the total strength of the individual keys being combined, assuming the string_to_key() function [RFC3961] uses all its input evenly ๐
An example of using KRB-FX-CF1() is when a device gives you random but short passwords. The password is often combined with a personal identification number (PIN) ๐ข The password and the PIN can be combined using KRB-FX-CF1() ๐
KRB-FX-CF2() combines two protocol keys based on the pseudo-random() function defined in [RFC3961] ๐ฆ
Given two input keys, K1 and K2, where K1 and K2 can be of two different enctypes, the output key of KRB-FX-CF2(), K3, is derived as follows ๐
KRB-FX-CF2(protocol key, protocol key, octet string,
octet string) -> (protocol key)
PRF+(K1, pepper1) -> octet-string-1
PRF+(K2, pepper2) -> octet-string-2
KRB-FX-CF2(K1, K2, pepper1, pepper2) :=
random-to-key(octet-string-1 ^ octet-string-2)
Where ^ denotes the exclusive-OR operation โก PRF+() is defined as follows ๐ธ
PRF+(protocol key, octet string) -> (octet string)
PRF+(key, shared-info) := pseudo-random( key, 1 || shared-info ) ||
pseudo-random( key, 2 || shared-info ) ||
pseudo-random( key, 3 || shared-info ) || ...
Here the counter values 1, 2, 3, and so on are encoded as a one-octet integer ๐ข The pseudo-random() operation is specified by the enctype of the protocol key ๐ PRF+() uses the counter to generate as many bits as the random-to-key() [RFC3961] function needs for the encryption type of the resulting key, and unneeded bits are removed from the tail โ๏ธ Unless otherwise specified, the resulting enctype of KRB-FX-CF2 is the enctype of k1 ๐ The pseudo-random() operation is the RFC 3961 pseudo-random() operation for the corresponding input key, and the random-to-key() operation is the RFC 3961 random-to-key operation for the resulting key ๐ง
Mechanism designers MUST specify the values for the input parameters pepper1 and pepper2 when combining two keys using KRB-FX-CF2() ๐ The pepper1 and pepper2 MUST be distinct, so that if the two keys being combined are the same, the resulting key is not a trivial key ๐ โโ๏ธ๐
5.2. Managing States for the KDC โจ
okay so KDCs are kinda stateless ๐ซถ, which means there's no rule that a client has to hit the same KDC for its second request in a convo. Proxies and other middle nodes can totally change which KDC you land on too ๐ง. So every request a client sends to a KDC has to carry enough info for the KDC to rebuild whatever state it needs. The way we pull that off is by handing the client a potentially long opaque cookie in responses, and the client echoes it back in future requests in the same conversation ๐. The KDC MAY respond that a conversation is too old and needs to restart by responding with a KDC_ERR_PREAUTH_EXPIRED error.
KDC_ERR_PREAUTH_EXPIRED 90
When a client gets this error, it SHOULD abort the existing conversation and restart a new one ๐.
An example where more than one message from the client is needed is when the client gets authenticated with a challenge/response scheme. In that case the KDC has to keep track of the challenge it issued for that client authentication request ๐ฅ.
The PA-FX-COOKIE padata type is defined here to make state management in the AS exchange easier ๐
. The KDC sends these padata when it needs state for a future transaction, and the client includes this opaque token in the next message in the conversation. The token can be pretty chunky, so clients MUST be prepared for tokens somewhat larger than the size of all messages in a conversation ๐.
PA-FX-COOKIE 133
-- Stateless cookie that is not tied to a specific KDC.
The corresponding padata-value field [RFC4120] holds an opaque token, and the client echoes that token back in its response to an error from the KDC ๐ฆ.
The cookie token is generated by the KDC and sent in a PA-FX-COOKIE pre-authentication data item of a KRB-ERROR message. The client MUST copy the exact cookie encapsulated in a PA-FX-COOKIE data element into the next message of the same conversation. The contents of the cookie field are a local matter for the KDC, so it's not generally possible to mix KDC implementations from different vendors in the same realm ๐. However, the KDC MUST construct the cookie token in such a manner that a malicious client cannot subvert the authentication process by manipulating the token. The KDC implementation needs to think about token expiration, key rollover, and other security issues in its token design, and this is seriously important ๐ญ. The cookie field is likely specific to the pre-authentication mechanisms used to authenticate the client. If a client authentication response can be replayed to multiple KDCs via the PA-FX-COOKIE mechanism, an expiration in the cookie is RECOMMENDED so the response can't be presented indefinitely ๐. Implementations need to consider replay of an entire conversation and of messages within a conversation when they decide what info goes in a cookie and how pre-authentication mechanisms get implemented ๐.
If at least one more message for a mechanism or a mechanism set is expected by the KDC, the KDC returns a KDC_ERR_MORE_PREAUTH_DATA_REQUIRED error with a PA-FX-COOKIE to identify the conversation with the client, according to Section 2.2. The cookie isn't supposed to stay constant for a conversation, so the KDC is expected to generate a new cookie for each message โจ.
KDC_ERR_MORE_PREAUTH_DATA_REQUIRED 91
A client MAY throw away the state associated with a conversation and start a fresh one by discarding its state and leaving out the cookie in the first message of a conversation ๐ง. KDCs that comply with this specification MUST include a cookie in a response when the client can continue the conversation. Specifically, a KDC MUST include a cookie in a KDC_ERR_PREAUTH_REQUIRED or KDC_ERR_MORE_PREAUTH_DATA_REQUIRED. KDCs SHOULD include a cookie in errors that contain extra info allowing a client to retry ๐ซถ. One reasonable strategy for meeting these requirements is to always include a cookie in KDC errors, which is honestly the iconic move ๐.
A KDC MAY indicate that it's ending a conversation by leaving out the cookie in a response. When FAST is used, clients can assume that the absence of a cookie means the KDC is ending the conversation ๐. Similarly, if a cookie shows up at all during a conversation, clients MAY assume that a missing cookie in a future message means the KDC is ending the conversation ๐ฆ. Clients also have to deal with KDCs, from before this specification, that don't include cookies. If neither cookies nor FAST are used in a conversation, a missing cookie is not a strong sign that the KDC is terminating the conversation ๐.
5.3. Pre-Authentication Set ๐
If all mechanisms in a group need to succeed in order to authenticate a client, then the client and the KDC SHOULD use the PA-AUTHENTICATION-SET padata element ๐
.
PA-AUTHENTICATION-SET 134
A PA-AUTHENTICATION-SET padata element holds the ASN.1 DER encoding of the PA-AUTHENTICATION-SET structure:
PA-AUTHENTICATION-SET ::= SEQUENCE OF PA-AUTHENTICATION-SET-ELEM
PA-AUTHENTICATION-SET-ELEM ::= SEQUENCE {
pa-type [0] Int32,
-- same as padata-type.
pa-hint [1] OCTET STRING OPTIONAL,
pa-value [2] OCTET STRING OPTIONAL,
...
}
The pa-type field of the PA-AUTHENTICATION-SET-ELEM structure holds the matching value of padata-type in PA-DATA [RFC4120] โจ. Attached to the pa-type is a pa-hint, which is an octet string defined by the pre-authentication mechanism. The hint could help the client figure out whether the mechanism can be used ๐ธ. For example, a public-key mechanism might include the certificate authorities it trusts in the hint info ๐. Most mechanisms today don't specify hint info, so if a mechanism doesn't specify hint info, the KDC MUST NOT send a hint for that mechanism. To let future revisions of mechanism specs add hint info, clients MUST ignore hint info received for mechanisms that the client believes do not support hint info. ๐ง
The pa-value element of the PA-AUTHENTICATION-SET-ELEM sequence carries the first padata-value from the KDC to the client ๐. If the client chooses this authentication set, then the client MUST process this pa-value. The pa-value element MUST be absent for all but the first entry in the authentication set. Clients MUST ignore the pa-value for the second and following entries in the authentication set. ๐
If the client chooses an authentication set, then its first AS-REQ message MUST contain a PA-AUTH-SET-SELECTED padata element. This element holds the encoding of the PA-AUTHENTICATION-SET sequence received from the KDC for the authentication set that was chosen ๐. The client MUST use the same octet values received from the KDC; it can't re-encode the sequence. That's what lets KDCs use bit-wise comparison to identify the selected authentication set ๐ฅ. Permitting bit-wise comparison could limit the ability to use certain pre-authentication mechanisms that generate a dynamic challenge in an authentication set with optimistic selection, which is a whole vibe ๐ญ. As with other optimistic pre-authentication failures, the KDC MAY return KDC_ERR_PREAUTH_FAILED with a new list of pre-authentication mechanisms (including authentication sets) if optimistic pre-authentication fails ๐
.
The PA-AUTH-SET-SELECTED padata element MUST come before any padata elements from the authentication set in the padata sequence in the AS-REQ message. The client MAY cache authentication sets from prior messages and use them to build an optimistic initial AS-REQ ๐ฆ. If the KDC receives a PA-AUTH-SET-SELECTED padata element that doesn't match an authentication set it would offer, then the KDC returns the KDC_ERR_PREAUTH_BAD_AUTHENTICATION_SET error. The e-data in this error holds a sequence of padata, just like for the KDC_ERR_PREAUTH_REQUIRED error ๐.
PA-AUTH-SET-SELECTED 135
KDC_ERR_PREAUTH_BAD_AUTHENTICATION_SET 92
The PA-AUTHENTICATION-SET only shows up in the first message from the KDC to the client. In particular, the client MAY fail if the authentication mechanism sets change as the conversation goes on ๐. Clients MAY assume that the hints in the authentication set contain enough info for the client to know which user interface elements need to be displayed during the entire authentication conversation. Exceptional situations, like expired passwords or expired accounts, might need extra user interface to be displayed ๐ญ. So mechanism designers need to think carefully about their hints so the client has the info it needs โจ. That way clients can build the dialog boxes or wizards they need from the authentication set and present one coherent user interface ๐. Current UI standards don't give an acceptable experience when the client has to ask extra questions later in the conversation ๐.
When indicating which sets of pre-authentication mechanisms are supported, the KDC includes a PA-AUTHENTICATION-SET padata element for each pre-authentication mechanism set ๐.
The client sends the padata-value for the first mechanism it picks in the pre-authentication set. When the first mechanism completes, the client and the KDC proceed with the second mechanism, and so on until all mechanisms complete successfully ๐ง. The PA-FX-COOKIE, as defined in Section 5.2, MUST be sent by the KDC. One reason for this is so the conversation can keep going if it involves multiple KDCs ๐ธ. KDCs MUST support clients that do not include a cookie because they optimistically choose an authentication set, although they MAY always return a KDC_ERR_PREAUTH_BAD_AUTHENTICATION_SET and include a cookie in that message ๐. Clients that support PA-AUTHENTICATION-SET MUST support PA-FX-COOKIE. ๐
Before authentication succeeds and a ticket gets returned, the client's message is an AS-REQ and the KDC's message is a KRB-ERROR message โจ. The error code in the KRB-ERROR message from the KDC is KDC_ERR_MORE_PREAUTH_DATA_REQUIRED, as defined in Section 5.2, and the accompanying e-data holds the DER encoding of the ASN.1 type METHOD-DATA. The KDC includes the padata elements in the METHOD-DATA. If there are no padata, the e-data field is absent from the KRB-ERROR message ๐ฆ.
If the client sends the last message for a given mechanism, then the KDC sends the first message for the next mechanism. If the next mechanism doesn't start with a KDC-side challenge, then the KDC includes a padata item with the right pa-type and an empty pa-data ๐. If the KDC sends the last message for a particular mechanism, the KDC also includes the first padata for the next mechanism ๐ .
5.4. Definition of Kerberos FAST Padata โจ
okay bestie, so as [RFC4120] explains, Kerberos is vulnerable to offline dictionary attacks ๐ญ. An attacker can request an AS-REP and try a bunch of passwords to see if they can decrypt the resulting ticket. RFC 4120 gives us the encrypted timestamp pre-authentication method, which helps a little because the attacker has to watch a successful authentication happen first ๐. But plenty of environments want way stronger security than that, and that's where Kerberos FAST pre-authentication padata comes in ๐ . It's a tool that significantly reduces the vulnerability to offline dictionary attacks. When it's combined with encrypted challenge, FAST forces an attacker to pull off a successful man-in-the-middle attack just to observe ciphertext. When it's combined with host keys, FAST can even protect against active attacks ๐ฅ. It also solves common pre-authentication problems like binding the request and the reply, plus the freshness guarantee of the authentication โจ. Ngl though, FAST itself does not authenticate the client or the KDC. Instead, it gives you a typed hole so pre-authentication data can be tunneled through it ๐ซถ. A pre-authentication data element used within FAST is called a "FAST factor", and a FAST factor captures the minimal work needed to extend Kerberos to support a new pre-authentication scheme ๐ฆ.
A FAST factor MUST NOT be used outside of FAST unless its specification explicitly allows so. The typed holes in FAST messages can also be used as generic holes for other padata that isn't meant to prove the client's identity or establish the reply key ๐ธ.
New pre-authentication mechanisms SHOULD be designed as FAST factors, instead of full-blown pre-authentication mechanisms ๐.
FAST factors that are pre-authentication mechanisms MUST meet the requirements in Section 4 ๐.
FAST employs an armoring scheme ๐ก๏ธ. The armor can be a Ticket Granting Ticket (TGT) that the client's machine gets using the host keys to pre-authenticate with the KDC, or an anonymous TGT obtained based on anonymous PKINIT [RFC6112] [RFC4556].
The rest of this section describes the types of armors and the syntax of the messages used by FAST. Conforming implementations MUST support Kerberos FAST padata ๐.
Any FAST armor scheme MUST provide a fresh armor key for each conversation. Clients and KDCs can assume that if a message is encrypted and integrity protected with a given armor key, then it's part of the conversation using that armor key ๐.
All KDCs in a realm MUST support FAST if FAST is offered by any KDC as a pre-authentication mechanism ๐.
5.4.1. FAST Armors
An armor key is used to encrypt pre-authentication data in the FAST request and the response ๐. The KrbFastArmor structure is defined to identify the armor key. This structure has two fields: the armor-type, which identifies the type of armor, and the armor-value, which is an OCTET STRING containing the description of the armor scheme and the armor key ๐ง.
KrbFastArmor ::= SEQUENCE {
armor-type [0] Int32,
-- Type of the armor.
armor-value [1] OCTET STRING,
-- Value of the armor.
...
}
The value of the armor key is up to the armor type specification. Only one armor type is defined in this document ๐.
FX_FAST_ARMOR_AP_REQUEST 1
The FX_FAST_ARMOR_AP_REQUEST armor is based on Kerberos tickets ๐ซ.
Conforming implementations MUST implement the FX_FAST_ARMOR_AP_REQUEST armor type. If a FAST KDC receives an unknown armor type, it MUST respond with KDC_ERR_PREAUTH_FAILED ๐.
An armor type may be appropriate for use in armoring AS requests, armoring TGS requests, or both. TGS armor types MUST authenticate the client to the KDC, typically by binding the TGT sub-session key to the armor key. As discussed below, it's desirable for AS armor types to authenticate the KDC to the client, but this is not required ๐ค.
FAST implementations MUST maintain state about whether the armor mechanism authenticates the KDC. If it doesn't, then a FAST factor that authenticates the KDC MUST be used if the reply key is replaced ๐ง.
5.4.1.1. Ticket-Based Armors
This is a ticket-based armoring scheme ๐๏ธ. The armor-type is FX_FAST_ARMOR_AP_REQUEST, and the armor-value contains an ASN.1 DER encoded AP-REQ. The ticket in the AP-REQ is called an armor ticket or an armor TGT. The subkey field in the AP-REQ MUST be present. The armor key is defined by the following function:
armor_key = KRB-FX-CF2( subkey, ticket_session_key,
"subkeyarmor", "ticketarmor" )
The 'ticket_session_key' is the session key from the ticket in the ap-req. The 'subkey' is the ap-req subkey. This construction guarantees that both the KDC (through the session key) and the client (through the subkey) contribute to the armor key ๐ซถโจ.
The server name field of the armor ticket MUST identify the TGS of the target realm. Here are three common ways, in decreasing order of preference, that an armor TGT SHOULD be obtained ๐:
- If the client is authenticating from a host machine whose Kerberos realm has an authentication path to the client's realm, the host machine obtains a TGT by using the host keys. If the client's realm is different from the realm of the local host, the machine then obtains a cross-realm TGT to the client's realm as the armor ticket. Otherwise, the host's primary TGT is the armor ticket ๐.
- If the client's host machine can't obtain a host ticket strictly based on RFC 4120, but the KDC has an asymmetric signing key whose binding with the expected KDC can be verified by the client, the client can use anonymous PKINIT [RFC6112] [RFC4556] to authenticate the KDC and obtain an anonymous TGT as the armor ticket. The armor ticket can also be a cross-realm TGT obtained based on the initial primary TGT that was obtained using anonymous PKINIT with KDC authentication ๐ฅ.
- Otherwise, the client uses anonymous PKINIT to get an anonymous TGT without KDC authentication, and that TGT is the armor ticket. Note that this mode of operation is vulnerable to man-in-the-middle attacks at the time of obtaining the initial anonymous armor TGT ๐จ.
โ ๏ธ Heads up, bestie: if anonymous PKINIT is used to obtain the armor ticket, the KDC can't know whether its signing key can be verified by the client. So the KDC MUST be marked as unverified from the KDC's point of view, while the client could still authenticate the KDC by verifying that the KDC's signing key is bound with the expected KDC. The client needs to carefully weigh the risk and benefit tradeoffs around active attacks before exposing cipher text encrypted using the user's long-term secrets, when the armor doesn't authenticate the KDC ๐ฐ.
The TGS MUST reject a request if there is an AD-fx-fast-armor (71) element in the authenticator of the pa-tgs-req padata, or if the ticket in the authenticator of a pa-tgs-req contains the AD-fx-fast-armor authorization data element. These tickets and authenticators MAY be used as FAST armor tickets, but not to obtain a ticket via the TGS ๐
โโ๏ธ. This authorization data is used in a system where the encryption of the user's pre-authentication data is performed in an unprivileged user process. A privileged process can give the user process a host ticket, an authenticator for use with that ticket, and the sub-session key contained in the authenticator. To make sure the host ticket isn't accidentally or intentionally misused (for example, the user process might use the host ticket to authenticate as the host), the privileged process MUST include a critical authorization data element of the type AD-fx-fast-armor when providing the authenticator, or in the enc-authorization-data field of the TGS request used to obtain the TGT ๐. The corresponding ad-data field of the AD-fx-fast-armor element is empty ๐ซง.
This armor type is only valid for AS requests. Implicit armor, described below in TGS processing, is the only supported way to establish an armor key for the TGS at this time ๐.
5.4.2. FAST Request โจ
okay bestie, so there's a padata type called PA-FX-FAST that's set aside for the Kerberos FAST pre-auth padata ๐ฆ its padata-value field [RFC4120] holds the DER encoding of the ASN.1 type PA-FX-FAST-REQUEST, and it's giving very structured energy ๐ as with every pre-auth type, the KDC SHOULD advertise PA-FX-FAST in a PREAUTH_REQUIRED error. KDCs MUST send that advertisement with an empty pa-value, and clients MUST ignore the pa-value of PA-FX-FAST in an initial PREAUTH_REQUIRED error ๐ซถ FAST is not really expected to be part of an authentication set. clients will usually just use FAST padata if it's there, and that choice shouldn't hinge on which other pre-auth methods are around. so no pa-hint is defined for FAST right now ๐ธ
PA-FX-FAST 136
-- Padata type for Kerberos FAST
PA-FX-FAST-REQUEST ::= CHOICE {
armored-data [0] KrbFastArmoredReq,
...
}
KrbFastArmoredReq ::= SEQUENCE {
armor [0] KrbFastArmor OPTIONAL,
-- Contains the armor that identifies the armor key.
-- MUST be present in AS-REQ.
req-checksum [1] Checksum,
-- For AS, contains the checksum performed over the type
-- KDC-REQ-BODY for the req-body field of the KDC-REQ
-- structure;
-- For TGS, contains the checksum performed over the type
-- AP-REQ in the PA-TGS-REQ padata.
-- The checksum key is the armor key, the checksum
-- type is the required checksum type for the enctype of
-- the armor key, and the key usage number is
-- KEY_USAGE_FAST_REQ_CHKSUM.
enc-fast-req [2] EncryptedData, -- KrbFastReq --
-- The encryption key is the armor key, and the key usage
-- number is KEY_USAGE_FAST_ENC.
...
}
KEY_USAGE_FAST_REQ_CHKSUM 50
KEY_USAGE_FAST_ENC 51
the PA-FX-FAST-REQUEST structure holds a KrbFastArmoredReq type, and that's the thing that wraps up the encrypted padata ๐ the enc-fast-req field carries an encrypted KrbFastReq structure. it gets encrypted with the armor key, and the key usage number for that is KEY_USAGE_FAST_ENC. slay ๐
the armor key gets picked like this:
- In an AS request, the armor field in the KrbFastArmoredReq structure MUST be present and the armor key is identified according to the specification of the armor type.
- There are two possibilities for armor for a TGS request. If the ticket presented in the PA-TGS-REQ authenticator is a TGT, then the client SHOULD NOT include the armor field in the Krbfastreq and a subkey MUST be included in the PA-TGS-REQ authenticator. In this case, the armor key is the same armor key that would be computed if the TGS-REQ authenticator was used in an FX_FAST_ARMOR_AP_REQUEST armor. Clients MAY present a non-TGT in the PA-TGS-REQ authenticator and omit the armor field, in which case the armor key is the same that would be computed if the authenticator were used in an FX_FAST_ARMOR_AP_REQUEST armor. This is the only case where a ticket other than a TGT can be used to establish an armor key; even though the armor key is computed the same as an FX_FAST_ARMOR_AP_REQUEST, a non-TGT cannot be used as an armor ticket in FX_FAST_ARMOR_AP_REQUEST. Alternatively, a client MAY use an armor type defined in the future for use with the TGS request.
the req-checksum field is computed differently for AS and TGS, and this part is so specific it's iconic ๐ฅ for an AS-REQ, it's done over the type KDC-REQ-BODY for the req-body field of the KDC-REQ structure of the containing message. for a TGS-REQ, it's done over the type AP-REQ in the PA-TGS-REQ padata of the TGS request. the checksum key is the armor key, and the checksum type is the required checksum type for the enctype of the armor key per [RFC3961]. this checksum MUST be a keyed checksum, and it's included to bind the FAST padata to the outer request ๐ a KDC that implements FAST will ignore the outer request, but including a checksum is relatively cheap and may prevent confusing behavior โจ
the KrbFastReq structure contains the following info:
KrbFastReq ::= SEQUENCE {
fast-options [0] FastOptions,
-- Additional options.
padata [1] SEQUENCE OF PA-DATA,
-- padata typed holes.
req-body [2] KDC-REQ-BODY,
-- Contains the KDC request body as defined in Section
-- 5.4.1 of [RFC4120].
-- This req-body field is preferred over the outer field
-- in the KDC request.
...
}
the fast-options field lists various options that modify how the KDC behaves ๐ these are the options that are defined:
FastOptions ::= KerberosFlags
-- reserved(0),
-- hide-client-names(1),
Bits Name Description
-----------------------------------------------------------------
0 RESERVED Reserved for future expansion of this
field.
1 hide-client-names Requesting the KDC to hide client
names in the KDC response, as
described next in this section.
16 kdc-follow-referrals reserved [REFERRALS].
bits 1 through 15 inclusive (with bit 1 and bit 15 included) are critical options. if the KDC doesn't support a critical option, it MUST fail the request with KDC_ERR_UNKNOWN_CRITICAL_FAST_OPTIONS, and there's no accompanying e-data defined in this document for this error code ๐ญ bit 16 and onward (with bit 16 included) are non-critical options, and KDCs conforming to this specification ignore unknown non-critical options. that's the vibe ๐ธ
KDC_ERR_UNKNOWN_CRITICAL_FAST_OPTIONS 93
The hide-client-names Option
the Kerberos response defined in [RFC4120] has the client identity in cleartext, and that makes traffic analysis super straightforward ๐ that's the problem hide-client-names is here to fix. it's designed to complicate traffic analysis. if hide-client-names is set, the KDC implementing PA-FX-FAST MUST identify the client as the anonymous principal [RFC6112] in the KDC reply and the error response. so the client sets this option when it wants to hide its identity in the KDC response ๐ง a conforming KDC ignores the client principal name in the outer KDC-REQ-BODY field, and identifies the client using the cname and crealm fields in the req-body field of the KrbFastReq structure.
The kdc-follow-referrals Option
this option is reserved for [REFERRALS]. that's all the tea for now ๐
the padata field holds a list of PA-DATA structures, described in Section 5.2.7 of [RFC4120]. these can carry FAST factors. they can also act as generic typed-holes for data that isn't meant to prove the client's identity or set up a reply key, and that's there for protocol extensibility ๐ if the KDC supports the PA-FX-FAST-REQUEST padata, then unless otherwise specified, the client MUST place any padata that's otherwise in the outer KDC request body into this field. in a TGS request, PA-TGS-REQ padata is not included in this field, and it's present in the outer KDC request body instead.
the KDC-REQ-BODY in the FAST structure is used in preference to the KDC-REQ-BODY outside of the FAST pre-authentication. the outer KDC-REQ-BODY structure SHOULD be filled in for backwards compatibility with KDCs that don't support FAST ๐ฅน a conforming KDC ignores the outer KDC-REQ-BODY field in the KDC request. pre-authentication data methods such as [RFC4556] that include a checksum of the KDC-REQ-BODY should checksum the KDC-REQ-BODY in the FAST structure.
in a TGS request, a client MAY include the AD-fx-fast-used authdata either in the pa-tgs-req authenticator or in the authorization data in the pa-tgs-req ticket. if the KDC receives this authorization data but doesn't find a FAST padata, then it MUST return KRB_APP_ERR_MODIFIED no cap, that's a whole main character moment ๐ ๐
5.4.3. FAST Response โจ
Okay bestie, the KDC that supports the PA-FX-FAST padata MUST include a PA-FX-FAST padata element in the KDC reply ๐. If there's an error, the PA-FX-FAST padata still shows up in the KDC responses, just following the rules in Section 5.4.4 ๐ .
The padata-value field [RFC4120] for PA-FX-FAST in the KDC response holds the DER encoding of the ASN.1 type PA-FX-FAST-REPLY ๐ฆ.
PA-FX-FAST-REPLY ::= CHOICE {
armored-data [0] KrbFastArmoredRep,
...
}
KrbFastArmoredRep ::= SEQUENCE {
enc-fast-rep [0] EncryptedData, -- KrbFastResponse --
-- The encryption key is the armor key in the request, and
-- the key usage number is KEY_USAGE_FAST_REP.
...
}
KEY_USAGE_FAST_REP 52
So PA-FX-FAST-REPLY wraps a KrbFastArmoredRep, which is the encrypted version of the padata in the KDC reply ๐. The KrbFastResponse gets encrypted with the armor key from the request, and the key usage number is KEY_USAGE_FAST_REP. Iconic protection energy ๐.
The Kerberos client MUST support a local policy that rejects the response if PA-FX-FAST-REPLY isn't included ๐ โโ๏ธ. Clients MAY also support policies that fall back to other mechanisms, or that skip pre-authentication when FAST is unavailable. Just know it matters to think about potential downgrade attacks before you deploy a policy like that ๐ญ.
Heads up, bestie: downgrade attacks are no joke. If a client is willing to fall back when FAST is missing, an attacker might try to push it into that fallback. Think carefully before you turn that on ๐จ.
The KrbFastResponse structure holds this info:
KrbFastResponse ::= SEQUENCE {
padata [0] SEQUENCE OF PA-DATA,
-- padata typed holes.
strengthen-key [1] EncryptionKey OPTIONAL,
-- This, if present, strengthens the reply key for AS and
-- TGS. MUST be present for TGS.
-- MUST be absent in KRB-ERROR.
finished [2] KrbFastFinished OPTIONAL,
-- Present in AS or TGS reply; absent otherwise.
nonce [3] UInt32,
-- Nonce from the client request.
...
}
The padata field in KrbFastResponse holds a list of PA-DATA structures, as described in Section 5.2.7 of [RFC4120] ๐ธ. These are used to carry data that moves the exchange forward for the FAST factors. They can also act as generic typed-holes for protocol extensibility, which is very much a main character move ๐. Unless specified otherwise, the KDC MUST include any padata that's otherwise sitting in the outer KDC-REP or KDC-ERROR structure into this field. Meanwhile, the padata field in the KDC reply structure outside of PA-FX-FAST-REPLY typically includes only the PA-FX-FAST-REPLY padata โจ.
The strengthen-key field is how the KDC strengthens the reply key ๐ช. If it's set, the strengthen-key value MUST be randomly generated to have the same etype as the reply key before it gets strengthened. Then the reply key is strengthened after all padata items are processed. Let padata-reply-key be the reply key after padata processing ๐ง.
reply-key = KRB-FX-CF2(strengthen-key, padata-reply-key,
"strengthenkey", "replykey")
The strengthen-key field MAY be set in an AS reply, and it MUST be set in a TGS reply. It must be absent in an error reply ๐ โโ๏ธ. It's required in a TGS reply so an attacker can't strip the FAST PADATA out of a TGS reply and make the KDC look like it doesn't support FAST ๐ต๏ธโโ๏ธ๐.
The finished field contains a KrbFastFinished structure ๐. The KDC fills it in on the final message of the conversation. It's present in an AS-REP or a TGS-REP when a ticket is returned, and it's not present in an error reply.
The KrbFastFinished structure holds this info:
KrbFastFinished ::= SEQUENCE {
timestamp [0] KerberosTime,
usec [1] Microseconds,
-- timestamp and usec represent the time on the KDC when
-- the reply was generated.
crealm [2] Realm,
cname [3] PrincipalName,
-- Contains the client realm and the client name.
ticket-checksum [4] Checksum,
-- checksum of the ticket in the KDC-REP using the armor
-- and the key usage is KEY_USAGE_FAST_FINISH.
-- The checksum type is the required checksum type
-- of the armor key.
...
}
KEY_USAGE_FAST_FINISHED 53
The timestamp and usec fields tell you when the reply ticket was generated on the KDC โฐ. They mean the same thing as the identically named fields in Section 5.6.1 of [RFC4120]. The client MUST use the KDC's time in these fields from then on when it uses the returned ticket ๐ฐ๏ธ. The client doesn't need to check that the returned timestamp is within allowable clock skew, because the armor key already guarantees the reply is fresh ๐ง. The client MAY trust the returned timestamp.
The cname and crealm fields identify the authenticated client ๐ซถ. If the facilities described in [REFERRALS] are used, the authenticated client might be different from the client in the FAST request ๐ฆ.
The ticket-checksum is a checksum of the issued ticket ๐๏ธ. The checksum key is the armor key. The checksum type is the required checksum type for the enctype of that key, and the key usage number is KEY_USAGE_FAST_FINISHED.
When FAST padata is included, the PA-FX-COOKIE padata from Section 5.2 MUST be included in the padata sequence of the KrbFastResponse, if the KDC expects at least one more message from the client to finish authenticating ๐ช. Dramatic, I know ๐ญ.
The nonce field in KrbFastResponse holds the nonce value from the KDC-REQ of the matching client request ๐. That's how it binds the KDC response to the client request. The client MUST verify that the nonce in the reply matches the request's nonce, and reject the KDC reply if it doesn't ๐ซ. To stop a response from one message in a conversation getting replayed against a request in another message, clients SHOULD use a new nonce for each message in a conversation ๐.
5.4.4. Authenticated Kerberos Error Messages Using Kerberos FAST โจ
If the Kerberos FAST padata was included in the request, then unless specified otherwise, the e-data field of the KRB-ERROR message [RFC4120] holds the ASN.1 DER encoding of the type METHOD-DATA [RFC4120], and a PA-FX-FAST is included in the METHOD-DATA ๐. The KDC MUST include all the padata elements, like PA-ETYPE-INFO2 and the padata elements that indicate acceptable pre-authentication mechanisms [RFC4120], in the KrbFastResponse structure ๐งโโ๏ธ.
The KDC MUST also include a PA-FX-ERROR padata item in the KRBFastResponse structure ๐ . The padata-value element of this sequence is the ASN.1 DER encoding of the type KRB-ERROR. The e-data field MUST be absent in the PA-FX-ERROR padata. Everything else should match the outer KRB-ERROR. The client ignores the outer error and uses the combo of the padata in the KRBFastResponse and the error info in the PA-FX-ERROR ๐ฆ.
PA-FX-ERROR 137
If the Kerberos FAST padata is in the request but not in the error reply, whether the client accepts the info in that error without integrity protection is up to its local policy ๐คทโโ๏ธ. However, the client SHOULD process the KDC errors as the result of the KDC's inability to accept the AP_REQ armor, and potentially retry another request with different armor when that makes sense ๐. The Kerberos client MAY process an error message without a PA-FX-FAST-REPLY, if that's only meant to return better error info to the application, typically for troubleshooting ๐ ๏ธ.
In cases where the e-data field of the KRB-ERROR message is expected to carry a TYPED-DATA [RFC4120] element, that info should be sent in a pa-data element within the KRBFastResponse structure ๐ฆ. The padata-type is the same as the data-type would be in the typed data element, and the padata-value is the same as the data-value. As discussed in Section 7, data-types and padata-types come from the same namespace ๐ธ. For example, the TD_TRUSTED_CERTIFIERS structure is expected in the KRB-ERROR message when the error code is KDC_ERR_CANT_VERIFY_CERTIFICATE [RFC4556] ๐.
5.4.5. Outer and Inner Requests โจ
Typically, a client knows FAST is being used before it sends a request containing PA-FX-FAST ๐. So the outer AS request usually includes just one pa-data item: PA-FX-FAST. The client MAY include additional pa-data, but the KDC MUST ignore the outer request body and any padata besides PA-FX-FAST if, and only if, PA-FX-FAST is processed ๐. For a TGS request, the outer request should include PA-FX-FAST and PA-TGS-REQ ๐.
When an AS generates a response, all padata besides PA-FX-FAST should be included in PA-FX-FAST ๐ง. The client MUST ignore other padata outside of PA-FX-FAST ๐ซถ.
5.4.6. The Encrypted Challenge FAST Factor ๐โจ
Okay bestie, the encrypted challenge FAST factor is how a client proves who it is using its long-term key ๐๐. It's giving encrypted timestamp pre-auth vibes from [RFC4120] ๐. Why "challenge" and not "timestamp"? ๐ค Because the timestamp is the first challenge, but if the KDC and client clocks aren't synced, the KDC can hand the client an updated time to use as the challenge instead โฐโจ. Iconic problem-solving, ngl ๐ .
The client encrypts a structure containing a timestamp in the challenge key. The client-to-KDC challenge key is KRB-FX-CF2(armor_key,long_term_key, "clientchallengearmor", "challengelongterm"), and the KDC-to-client challenge key is KRB-FX-CF2(armor_key, long_term_key, "kdcchallengearmor", "challengelongterm"). Since the armor key is fresh and random, the challenge key is fresh and random too ๐ฒ๐ฅ. The only job of the timestamp is to limit how long the authentication is valid, so a request can't be replayed ๐ซ๐.
A client MAY base the timestamp on the KDC time in a KDC error, and it doesn't need to keep its own clock accurate ๐ฐ๏ธ. But lowkey, this is a risk: if a client bases its time on an untrusted source, an attacker could trick it into producing an authentication request that's valid at some future time ๐ฌ. That attacker could then use the request to make it look like the client authenticated at that future time ๐. If ticket-based armor is used, the ticket's lifetime limits how big that window can be ๐ซ. For most situations, that's not a major concern, because not needing clock sync on clients is worth more ๐.
The client sends a padata of type PA-ENCRYPTED-CHALLENGE. The padata-value holds the DER encoding of the ASN.1 type EncryptedChallenge ๐ฆ:
EncryptedChallenge ::= EncryptedData
-- Encrypted PA-ENC-TS-ENC, encrypted in the challenge key
-- using key usage KEY_USAGE_ENC_CHALLENGE_CLIENT for the
-- client and KEY_USAGE_ENC_CHALLENGE_KDC for the KDC.
PA-ENCRYPTED-CHALLENGE 138
KEY_USAGE_ENC_CHALLENGE_CLIENT 54
KEY_USAGE_ENC_CHALLENGE_KDC 55
The client includes a timestamp that's reasonably close to the KDC's current time, and encrypts it in the challenge key inside a PA-ENC-TS-ENC structure (see Section 5.2.7.2 in RFC 4120) ๐. Clients MAY use the current time, and doing so prevents the exposure where an attacker can cause a client to appear to authenticate in the future ๐ โโ๏ธโณ. Then the client sends the request including this factor ๐จ.
When the KDC gets an AS-REQ containing the PA-ENCRYPTED-CHALLENGE FAST factor, it decrypts the timestamp ๐. If decryption fails, the KDC SHOULD return KDC_ERR_PREAUTH_FAILED, including PA-ETYPE-INFO2 in the KRBFastResponse in the error ๐. The KDC then confirms the timestamp falls within its current clock skew, and returns KRB_APP_ERR_SKEW if it doesn't ๐จ. Next, the KDC SHOULD check whether the encrypted challenge is a replay ๐ต๏ธโโ๏ธ. The KDC MUST NOT consider two encrypted challenges replays just because their timestamps match. To be a replay, the ciphertext MUST be identical ๐งพ. Letting clients reuse timestamps means they don't have to keep track of which timestamps they've already used, which is a whole mood ๐ธ.
If the KDC accepts the encrypted challenge, it MUST include a padata element of type PA-ENCRYPTED-CHALLENGE ๐. The KDC encrypts its current time in the challenge key, and it MUST strengthen the reply key before issuing a ticket ๐ช. On the client side, the client MUST check that the timestamp decrypts properly โ . The client MAY check that the timestamp is within the window of acceptable clock skew for the client โฐ. And the client MUST NOT require the timestamp to be identical to the timestamp in the issued credentials or the returned message ๐ โโ๏ธ.
The encrypted challenge FAST factor provides Client Authentication and KDC Authentication ๐ค. It also takes advantage of the FAST facility to strengthen the reply key ๐ฅ. It does not provide the Replace Reply Key facility. The Security Considerations section of this document explains why the security requirements are met ๐.
The encrypted challenge FAST factor can be useful in an authentication set ๐งฉ. No pa-hint is defined, because the only information this mechanism needs is already in the PA-ETYPE-INFO2 pre-authentication data. KDCs are already required to send PA-ETYPE-INFO2 ๐ฌ. If KDCs weren't required to send PA-ETYPE-INFO2, that information would need to be part of a hint for encrypted challenge ๐ซถ.
Conforming implementations MUST support the encrypted challenge FAST factor ๐โจ.
5.5. Authentication Strength Indication ๐๏ธโโ๏ธ
Implementations that have pre-authentication mechanisms offering significantly different strengths of client authentication MAY choose to keep track of the strength of the authentication used, as an input into policy decisions ๐. For example, some principals might require strong pre-authentication, while less sensitive principals can use relatively weak forms of pre-authentication, like encrypted timestamp ๐.
An AuthorizationData data type called AD-Authentication-Strength is defined for this purpose ๐:
AD-authentication-strength 70
The corresponding ad-data field contains the DER encoding of the pre-authentication data set as defined in Section 5.3 ๐ฆ. This set contains all the pre-authentication mechanisms that were used to authenticate the client. If only one mechanism was used, the pre-authentication set contains one element 1๏ธโฃ. Unless otherwise specified, the hint and value fields of the members of this sequence MUST be empty ๐ซ. To let mechanisms carry extra strength info in these fields in the future, clients and application servers MUST ignore non-empty hint and value fields for mechanisms, unless the implementation has been updated with the interpretation of those fields for a given pre-authentication mechanism in this authorization element ๐ฎ.
The AD-authentication-strength element MUST be included in the AD-KDC-ISSUED container, so the KDC integrity protects its contents ๐ก๏ธ. This element can be ignored if the receiver doesn't recognise it ๐.
6. Assigned Constants ๐งฎโจ
The pre-authentication framework and FAST involve a bunch of Kerberos protocol constants ๐ค. This section lists the protocol constants first introduced in this specification that come from registries not managed by IANA. Many of these registries would be best managed by IANA, but that's a known issue and out of scope for this document ๐. The constants here have been accounted for, and they'll show up in the next revision of the Kerberos core specification or in a document creating IANA registries ๐.
Section 7 creates IANA registries for a different set of constants used by the extensions in this document ๐๏ธ.
6.1. New Errors ๐จ
KDC_ERR_PREAUTH_EXPIRED 90
KDC_ERR_MORE_PREAUTH_DATA_REQUIRED 91
KDC_ERR_PREAUTH_BAD_AUTHENTICATION_SET 92
KDC_ERR_UNKNOWN_CRITICAL_FAST_OPTIONS 93
6.2. Key Usage Numbers ๐
KEY_USAGE_FAST_REQ_CHKSUM 50
KEY_USAGE_FAST_ENC 51
KEY_USAGE_FAST_REP 52
KEY_USAGE_FAST_FINISHED 53
KEY_USAGE_ENC_CHALLENGE_CLIENT 54
KEY_USAGE_ENC_CHALLENGE_KDC 55
6.3. Authorization Data Elements ๐ซ
AD-authentication-strength 70
AD-fx-fast-armor 71
AD-fx-fast-used 72
6.4. New PA-DATA Types ๐ฌ
PA-FX-COOKIE 133
PA-AUTHENTICATION-SET 134
PA-AUTH-SET-SELECTED 135
PA-FX-FAST 136
PA-FX-ERROR 137
PA-ENCRYPTED-CHALLENGE 138
7. IANA Considerations ๐๏ธ๐
This document creates a number of IANA registries ๐. They're all located under Kerberos Parameters on http://www.iana.org. See [RFC5226] for descriptions of the registration policies used in this section ๐.
7.1. Pre-Authentication and Typed Data โจ
okay so [RFC4120] defines pre-authentication data, which you can tuck into a KDC request or response to authenticate the client or to extend the protocol ๐ . It also defines Typed-Data, the extension mechanism for errors ๐ซถ. Both get carried as a 32-bit signed integer plus an octet string ๐ข. The encoding is slightly different between the two, but the types for pre-authentication data and typed data come from the same namespace ๐ธ. By convention, registrations starting with TD- are typed data and registrations starting with PA- are pre-authentication data ๐. The shared namespace matters a lot, because some errors where you'd want typed data need the e-data field formatted as pre-authentication data ๐ญ.
When Kerberos FAST is used, pre-authentication data encoding is always used ๐ง.
There's one apparently conflicting registration between the two. PA-GET-FROM-TYPED-DATA and TD-PADATA are both assigned the value 22 ๐. But that registration is really just a way to include an element of the other encoding. Honestly, using both should be deprecated ๐.
This document creates a registry for pre-authentication and typed data ๐. The registration procedures go like this. Expert review covers pre-authentication mechanisms designed to authenticate users, KDCs, or establish the reply key. The expert first figures out whether the purpose of the method is to authenticate clients, authenticate KDCs, or establish the reply key. If so, expert review is the right move. The expert then evaluates the security and interoperability of the specification ๐.
IETF review is required if the expert believes the pre-authentication method is broader than those three areas ๐. Pre-authentication methods that change the Kerberos state machine or otherwise make significant changes to the Kerberos protocol should be Standards Track RFCs ๐. If someone thinks a particular method needs to be a Standards Track RFC, they can raise that as an objection during IETF review โ.
Several of the registrations below were made back when the Kerberos protocol was less mature, so they don't meet the current requirements for this registry ๐ฆ. They're included anyway, to accurately document what's known about these protocol code points and to avoid conflicts ๐ซถ.
Type Value Reference
----------------------------------------------------------------------
PA-TGS-REQ 1 [RFC4120]
PA-ENC-TIMESTAMP 2 [RFC4120]
PA-PW-SALT 3 [RFC4120]
[reserved] 4 [RFC6113]
PA-ENC-UNIX-TIME 5 (deprecated) [RFC4120]
PA-SANDIA-SECUREID 6 [RFC4120]
PA-SESAME 7 [RFC4120]
PA-OSF-DCE 8 [RFC4120]
PA-CYBERSAFE-SECUREID 9 [RFC4120]
PA-AFS3-SALT 10 [RFC4120] [RFC3961]
PA-ETYPE-INFO 11 [RFC4120]
PA-SAM-CHALLENGE 12 [KRB-WG.SAM]
PA-SAM-RESPONSE 13 [KRB-WG.SAM]
PA-PK-AS-REQ_OLD 14 [PK-INIT-1999]
PA-PK-AS-REP_OLD 15 [PK-INIT-1999]
PA-PK-AS-REQ 16 [RFC4556]
PA-PK-AS-REP 17 [RFC4556]
PA-PK-OCSP-RESPONSE 18 [RFC4557]
PA-ETYPE-INFO2 19 [RFC4120]
PA-USE-SPECIFIED-KVNO 20 [RFC4120]
PA-SVR-REFERRAL-INFO 20 [REFERRALS]
PA-SAM-REDIRECT 21 [KRB-WG.SAM]
PA-GET-FROM-TYPED-DATA 22 (embedded in typed data) [RFC4120]
TD-PADATA 22 (embeds padata) [RFC4120]
PA-SAM-ETYPE-INFO 23 (sam/otp) [KRB-WG.SAM]
PA-ALT-PRINC 24 (crawdad@fnal.gov) [HW-AUTH]
PA-SERVER-REFERRAL 25 [REFERRALS]
PA-SAM-CHALLENGE2 30 (kenh@pobox.com) [KRB-WG.SAM]
PA-SAM-RESPONSE2 31 (kenh@pobox.com) [KRB-WG.SAM]
PA-EXTRA-TGT 41 Reserved extra TGT [RFC6113]
TD-PKINIT-CMS-CERTIFICATES 101 CertificateSet from CMS
TD-KRB-PRINCIPAL 102 PrincipalName
TD-KRB-REALM 103 Realm
TD-TRUSTED-CERTIFIERS 104 [RFC4556]
TD-CERTIFICATE-INDEX 105 [RFC4556]
TD-APP-DEFINED-ERROR 106 Application specific [RFC6113]
TD-REQ-NONCE 107 INTEGER [RFC6113]
TD-REQ-SEQ 108 INTEGER [RFC6113]
TD_DH_PARAMETERS 109 [RFC4556]
TD-CMS-DIGEST-ALGORITHMS 111 [ALG-AGILITY]
TD-CERT-DIGEST-ALGORITHMS 112 [ALG-AGILITY]
PA-PAC-REQUEST 128 [MS-KILE]
PA-FOR_USER 129 [MS-KILE]
PA-FOR-X509-USER 130 [MS-KILE]
PA-FOR-CHECK_DUPS 131 [MS-KILE]
PA-AS-CHECKSUM 132 [MS-KILE]
PA-FX-COOKIE 133 [RFC6113]
PA-AUTHENTICATION-SET 134 [RFC6113]
PA-AUTH-SET-SELECTED 135 [RFC6113]
PA-FX-FAST 136 [RFC6113]
PA-FX-ERROR 137 [RFC6113]
PA-ENCRYPTED-CHALLENGE 138 [RFC6113]
PA-OTP-CHALLENGE 141 (gareth.richards@rsa.com) [OTP-PREAUTH]
PA-OTP-REQUEST 142 (gareth.richards@rsa.com) [OTP-PREAUTH]
PA-OTP-CONFIRM 143 (gareth.richards@rsa.com) [OTP-PREAUTH]
PA-OTP-PIN-CHANGE 144 (gareth.richards@rsa.com) [OTP-PREAUTH]
PA-EPAK-AS-REQ 145 (sshock@gmail.com) [RFC6113]
PA-EPAK-AS-REP 146 (sshock@gmail.com) [RFC6113]
PA_PKINIT_KX 147 [RFC6112]
PA_PKU2U_NAME 148 [PKU2U]
PA-SUPPORTED-ETYPES 165 [MS-KILE]
PA-EXTENDED_ERROR 166 [MS-KILE]
7.2. Fast Armor Types ๐ก๏ธ
FAST armor types are defined in Section 5.4.1. A FAST armor type is a signed 32-bit integer ๐ข. They're assigned by standards action, so no shortcuts ๐ โโ๏ธ.
Type Name Description
------------------------------------------------------------
0 Reserved.
1 FX_FAST_ARMOR_AP_REQUEST Ticket armor using an ap-req.
7.3. FAST Options ๐๏ธ
A FAST request includes a set of bit flags for additional options ๐ฉ. Bits 0-15 are critical, and the other bits are non-critical. Assigning bits greater than 31 may require special support in implementations ๐. Assigning FAST options requires standards action ๐.
Type Name Description
-------------------------------------------------------------------
0 RESERVED Reserved for future expansion of this
field.
1 hide-client-names Requesting the KDC to hide client
names in the KDC response
16 kdc-follow-referrals Reserved.
8. Security Considerations ๐
Okay this section is serious, bestie, so let's be careful ๐ค. The kdc-referrals option in the Kerberos FAST padata asks the KDC to act as the client and follow referrals. That can overload the KDC ๐. To limit the damage from denial of service using this option, KDCs MAY restrict the number of simultaneous active requests with this option for any given client principal ๐.
Now the Encrypted Challenge FAST factor. The challenge key is derived from the client secrets. The client secrets are known only to the client and the KDC, so verifying the EncryptedChallenge structure proves the client's identity. Verifying the EncryptedChallenge structure in the KDC reply proves that the expected KDC responded โจ. So as a pre-authentication mechanism, the Encrypted Challenge FAST factor offers these facilities: Client Authentication and KDC Authentication ๐ซถ. There is no un-authenticated cleartext introduced by the Encrypted Challenge FAST factor ๐.
FAST gives you an encrypted tunnel for pre-authentication conversations to take place in ๐. On top of that, FAST optionally authenticates the KDC to the client. It's the job of FAST factors to authenticate the client to the KDC. Care MUST be taken to design FAST factors so they're bound to the conversation ๐ฏ. If that doesn't happen, a man-in-the-middle may be able to cut&paste a FAST factor from one conversation into another ๐ฑ. The easiest way to prevent that is to bind each FAST factor to the armor key, which is guaranteed to be unique for each conversation ๐.
The anonymous PKINIT mode for obtaining an armor ticket does not always authenticate the KDC to the client before the conversation begins. Tracking the KDC verified state guarantees that by the end of the conversation, the client has authenticated the KDC. However, FAST factor designers need to consider the implications of using their factor when the KDC has not yet been authenticated. If this proves problematic in an environment, then the particular FAST factor should not be used with anonymous PKINIT ๐จ.
Existing pre-authentication mechanisms are believed to be at least as secure when used with FAST as they are when used outside of FAST ๐.
Part of this security is making sure that when pre-authentication methods checksum the request, they checksum the inner request rather than the outer request ๐ง. If a mechanism checksummed the outer request, a man-in-the-middle could observe it outside a FAST tunnel and then cut&paste it into a FAST exchange. There, the inner request, rather than the outer one, would be used to select attributes of the issued ticket ๐ญ. Attacks like that would typically invalidate auditing information or leave the client and KDC disagreeing about which ticket was issued ๐. Still, those attacks are unlikely to let an attacker who couldn't authenticate as a principal do so ๐ โโ๏ธ. FAST is believed to defend against these attacks in existing legacy mechanisms too ๐ก๏ธ. But since there's no standard for how legacy mechanisms bind the request to the pre-authentication or provide integrity protection, security analysis can be difficult ๐งฉ. In some cases, FAST may significantly improve the integrity protection of legacy mechanisms ๐.
The security of the TGS exchange depends on authenticating the client to the KDC ๐. In the AS exchange, that's done with pre-authentication data or FAST factors. In the TGS exchange, it's done by presenting a TGT and by using the session (or sub-session) key when constructing the request ๐๏ธ. Because FAST uses a request body in the inner request, encrypted in the armor key, rather than the request body in the outer request, it's critical that establishing the armor key is tied to the authentication of the client to the KDC ๐จ. If it isn't, an attacker could manipulate the options requested in the TGS request, for example by requesting a ticket with different validity or addresses ๐. The easiest way to bind the armor key to the client's authentication to the KDC is for the armor key to depend on the sub-session key of the TGT. That's exactly what the implicit TGS armor supported by this specification does ๐ . Future armor types designed for use with the TGS MUST either bind their armor keys to the TGT or provide another mechanism to authenticate the client to the KDC ๐ซถโจ.
9. Acknowledgements โจ
Okay, big thank-you moment ๐ซถ Sam Hartman wants to thank the MIT Kerberos Consortium for funding his time on this project, which is honestly so iconic of them ๐
Jeffrey Hutzelman gave a bunch of suggestions based on the early revisions of this document, and those led to some seriously significant improvements ๐ฅ
The idea of asking one KDC to chase down the referrals and hand back the final ticket comes from the requirements in [CROSS]. Main character research, literally ๐ง
Joel Weber had a proposal for a mechanism that works like FAST and makes a protected tunnel for Kerberos pre-authentication. Genius energy ๐
Srinivas Cheruku and Greg Hudson gave valuable review comments. Thank you, you two, you really made this better ๐ธ
10. References
10.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC3961] Raeburn, K., "Encryption and Checksum Specifications
for Kerberos 5", RFC 3961, February 2005.
[RFC4120] Neuman, C., Yu, T., Hartman, S., and K. Raeburn, "The
Kerberos Network Authentication Service (V5)",
RFC 4120, July 2005.
[RFC4556] Zhu, L. and B. Tung, "Public Key Cryptography for
Initial Authentication in Kerberos (PKINIT)",
RFC 4556, June 2006.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing
an IANA Considerations Section in RFCs", BCP 26,
RFC 5226, May 2008.
[RFC6112] Zhu, L., Leach, P., and S. Hartman "Anonymity Support
for Kerberos", RFC 6112, April 2011.
10.2. Informative References
[ALG-AGILITY] Astrand, L. and L. Zhu, "PK-INIT algorithm agility",
Work in Progress, August 2008.
[CROSS] Sakane, S., Zrelli, S., and M. Ishiyama , "Problem
statement on the cross-realm operation of Kerberos in
a specific system", Work in Progress, July 2007.
[EKE] Bellovin, S. and M. Merritt, "Augmented Encrypted Key
Exchange: A Password-Based Protocol Secure Against
Dictionary Attacks and Password File Compromise,
Proceedings of the 1st ACM Conference on Computer and
Communications Security, ACM Press.", November 1993.
[HW-AUTH] Crawford, M., "Passwordless Initial Authentication to
Kerberos by Hardware Preauthentication", Work
in Progress, October 2006.
[IEEE1363.2] IEEE, "IEEE P1363.2: Password-Based Public-Key
Cryptography", 2004.
[KRB-WG.SAM] Hornstein, K., Renard, K., Neuman, C., and G. Zorn,
"Integrating Single-use Authentication Mechanisms
with Kerberos", Work in Progress, July 2004.
[MS-KILE] Microsoft, "Kerberos Protocol Extensions", <http://
msdn.microsoft.com/en-us/library/cc206927.aspx>.
[OTP-PREAUTH] Richards, G., "OTP Pre-authentication", Work
in Progress, February 2011.
[PK-INIT-1999] Tung, B., Neuman, C., Hur, M., Medvinsky, A.,
Medvinsky, S., Wray, J., and J. Trostle, "Public Key
Cryptography for Initial Authentication in Kerberos",
Work in Progress, July 1999.
[PKU2U] Zhu, L., Altman, J., and N. Williams, "Public Key
Cryptography Based User-to-User Authentication -
(PKU2U)", Work in Progress, November 2008.
[REFERRALS] Hartman, S., Ed., Raeburn, K., and L. Zhu, "Kerberos
Principal Name Canonicalization and KDC-Generated
Cross-Realm Referrals", Work in Progress, March 2011.
[RFC4557] Zhu, L., Jaganathan, K., and N. Williams, "Online
Certificate Status Protocol (OCSP) Support for Public
Key Cryptography for Initial Authentication in
Kerberos (PKINIT)", RFC 4557, June 2006.
Appendix A. Test Vectors for KRB-FX-CF2 ๐ฆ
This informative appendix has the test vectors for the KRB-FX-CF2 function, and they cover several encryption types. Every case works the same way: the first key (k1) comes from string-to-key("key1", "key1", default_parameters), and the second key (k2) comes from string-to-key("key2", "key2", default_parameters). Both keys are the same enctype. The test vector you get is the hexadecimal encoding of the key that KRB-FX-CF2(k1, k2, "a", "b") produces. The peppers are one-octet ASCII strings.
Interop testing hit a lot of confusion around the [RFC3961] pseudo-random operations, so these vectors assume the following. The AES pseudo-random operation is aes-ecb(trunc128(sha-1(input))), where trunc128 truncates its input to 128 bits. The 3DES pseudo-random operation is des3-cbc(trunc128(sha-1(input))). The DES pseudo-random operation is des-cbc(md5(input)). As specified in RFC 4757, the RC4 pseudo-random operation is hmac-sha1(input).
Interop testing also showed ambiguity around the DES random-to-key operation. These vectors assume it distributes 56 bits into the high-7-bits of 8 octets and then generates parity.
These test vectors came from revision 22359 of the MIT Kerberos sources. The AES 256 and AES 128 vectors have been confirmed by multiple other implementors. The RC4 vectors have been confirmed by one other implementor. The DES and triple DES vectors have not been confirmed yet ๐
aes 128 (enctype 17): 97df97e4b798b29eb31ed7280287a92a
AES256 (enctype 18): 4d6ca4e629785c1f01baf55e2e548566
b9617ae3a96868c337cb93b5e72b1c7b
DES (enctype 1): 43bae3738c9467e6
3DES (enctype 16): e58f9eb643862c13ad38e529313462a7f73e62834fe54a01
RC4 (enctype 23): 24d7f6b6bae4e5c00d2082c5ebab3672
Appendix B. ASN.1 Module ๐
This is the full ASN.1 module, kept exactly as written.
KerberosPreauthFramework {
iso(1) identified-organization(3) dod(6) internet(1)
security(5) kerberosV5(2) modules(4) preauth-framework(3)
} DEFINITIONS EXPLICIT TAGS ::= BEGIN
IMPORTS
KerberosTime, PrincipalName, Realm, EncryptionKey, Checksum,
Int32, EncryptedData, PA-ENC-TS-ENC, PA-DATA, KDC-REQ-BODY,
Microseconds, KerberosFlags, UInt32
FROM KerberosV5Spec2 { iso(1) identified-organization(3)
dod(6) internet(1) security(5) kerberosV5(2)
modules(4) krb5spec2(2) };
-- as defined in RFC 4120.
PA-AUTHENTICATION-SET ::= SEQUENCE OF PA-AUTHENTICATION-SET-ELEM
PA-AUTHENTICATION-SET-ELEM ::= SEQUENCE {
pa-type [0] Int32,
-- same as padata-type.
pa-hint [1] OCTET STRING OPTIONAL,
pa-value [2] OCTET STRING OPTIONAL,
...
}
KrbFastArmor ::= SEQUENCE {
armor-type [0] Int32,
-- Type of the armor.
armor-value [1] OCTET STRING,
-- Value of the armor.
...
}
PA-FX-FAST-REQUEST ::= CHOICE {
armored-data [0] KrbFastArmoredReq,
...
}
KrbFastArmoredReq ::= SEQUENCE {
armor [0] KrbFastArmor OPTIONAL,
-- Contains the armor that identifies the armor key.
-- MUST be present in AS-REQ.
req-checksum [1] Checksum,
-- For AS, contains the checksum performed over the type
-- KDC-REQ-BODY for the req-body field of the KDC-REQ
-- structure;
-- For TGS, contains the checksum performed over the type
-- AP-REQ in the PA-TGS-REQ padata.
-- The checksum key is the armor key, the checksum
-- type is the required checksum type for the enctype of
-- the armor key, and the key usage number is
-- KEY_USAGE_FAST_REQ_CHKSUM.
enc-fast-req [2] EncryptedData, -- KrbFastReq --
-- The encryption key is the armor key, and the key usage
-- number is KEY_USAGE_FAST_ENC.
...
}
KrbFastReq ::= SEQUENCE {
fast-options [0] FastOptions,
-- Additional options.
padata [1] SEQUENCE OF PA-DATA,
-- padata typed holes.
req-body [2] KDC-REQ-BODY,
-- Contains the KDC request body as defined in Section
-- 5.4.1 of [RFC4120].
-- This req-body field is preferred over the outer field
-- in the KDC request.
...
}
FastOptions ::= KerberosFlags
-- reserved(0),
-- hide-client-names(1),
-- kdc-follow-referrals(16)
PA-FX-FAST-REPLY ::= CHOICE {
armored-data [0] KrbFastArmoredRep,
...
}
KrbFastArmoredRep ::= SEQUENCE {
enc-fast-rep [0] EncryptedData, -- KrbFastResponse --
-- The encryption key is the armor key in the request, and
-- the key usage number is KEY_USAGE_FAST_REP.
...
}
KrbFastResponse ::= SEQUENCE {
padata [0] SEQUENCE OF PA-DATA,
-- padata typed holes.
strengthen-key [1] EncryptionKey OPTIONAL,
-- This, if present, strengthens the reply key for AS and
-- TGS. MUST be present for TGS
-- MUST be absent in KRB-ERROR.
finished [2] KrbFastFinished OPTIONAL,
-- Present in AS or TGS reply; absent otherwise.
nonce [3] UInt32,
-- Nonce from the client request.
...
}
KrbFastFinished ::= SEQUENCE {
timestamp [0] KerberosTime,
usec [1] Microseconds,
-- timestamp and usec represent the time on the KDC when
-- the reply was generated.
crealm [2] Realm,
cname [3] PrincipalName,
-- Contains the client realm and the client name.
ticket-checksum [4] Checksum,
-- checksum of the ticket in the KDC-REP using the armor
-- and the key usage is KEY_USAGE_FAST_FINISH.
-- The checksum type is the required checksum type
-- of the armor key.
...
}
EncryptedChallenge ::= EncryptedData
-- Encrypted PA-ENC-TS-ENC, encrypted in the challenge key
-- using key usage KEY_USAGE_ENC_CHALLENGE_CLIENT for the
-- client and KEY_USAGE_ENC_CHALLENGE_KDC for the KDC.
END
Authors' Addresses ๐
Sam Hartman
Painless Security
EMail: hartmans-ietf@mit.edu
Larry Zhu
Microsoft Corporation
One Microsoft Way
Redmond, WA 98052
US
EMail: larry.zhu@microsoft.com
๐ฆ where this page comes from
- ietf: rfc6113 2011-04
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms