Subject: [stir] "iat" value to use during PASSPorT construction

From: "Asveren, Tolga" <[email-masked]>
Date: Mon, 14 May 2018 09:17:43 +0000

RFC 8224 has the following in Section "4.1 PASSPorT Construction":

      Third, the JSON key "iat" MUST appear.  The authentication service

      SHOULD set the value of "iat" to an encoding of the value of the

      SIP Date header field as a JSON NumericDate (as UNIX time, per

      [RFC7519], Section 2), though an authentication service MAY set

      the value of "iat" to its own current clock time.  If the

      authentication service uses its own clock time, then the use of

      the full form of PASSporT is REQUIRED.  In either case, the

      authentication service MUST NOT generate a PASSporT for a SIP

      request if the Date header is outside of its local policy for

      freshness (sixty seconds is RECOMMENDED).

RFC 8225 has the following in Section "5.1.1 "iat" (Issued At) Claim":

   The JSON claim MUST include the "iat" (Issued At) claim ([RFC7519],

   Section 4.1.6).  As defined, the "iat" claim should be set to the

   date and time of issuance of the JWT and MUST indicate the date and

   time of the origination of the personal communications.  The time

   value should be of the NumericDate format as defined in [RFC7519],

   Section 2.  This is included for securing the token against replay

   and cut-and-paste attacks, as explained further in Section 10

   ("Security Considerations").

i- I see some conflict in RFC8225 text. It is mentioned that "iat" should be set based on issuance of JWT (which would be when PASSPorT is constructed). OTOH, it is also stated that it MUST indicate the date and time of the origination of the personal communication. The former seems to be  the right approach as what we would like to protect against cut-and-paste attacks is the PASSPorT in the context of a particular communication session. Coupling of PASSPorT with the communication session is provided through "orig"/"dest". "iat" should be set to the time of generation of PASSPorT IMHO. RFC8244 text seems to be O.K. if one accepts this interpretation as it has the notion of "local policy for freshness". The recommended value is on the very high end (anything more than a few seconds is too much in practice IMHO) but it is at least not mandating use of 60s.

ii- Aren't there legitimate cases where a communication session continues for some period of time and then due to change in its nature requires addition of PASSPorT, e.g. first there is an announcement/interaction with an automated system (which may last several minutes) and then the called-party is contacted during which PASSPorT is added (because, for example, organizational boundaries are crossed and there is a need to validate calling-party identity). For such cases there could be a legitimate and major discrepancy between Date and "current time". This is another argument in favor of considering "iat" as corresponding to PASSPorT generation rather than start of communication session IMHO. There could eb many other scenarios where similar discrepancy legitimately happens especially if one considers non-base claim types, e.g. "div".

So, the bottom line is I would like to get people's opinion about whether "iat" should pertain to the start of communication session or to the creation of PASSPorT.

Thanks,
Tolga

---

From: Chris Wendt <[email-masked]>
Date: Mon, 14 May 2018 10:30:52 -0400

Hi Tolga,

I think the 60sec recommendation is a default, however, i think once we get more operational experience to see what the delta offsets of time typically are, we will have a better sense of what value to use and whether to move to a smaller time window or not.  This should in general be considered local policy what you believe is an acceptable time window. You may also want to implement secondary TDOS/replay attack types of protection to help here as well and not solely depend on “iat” freshness within that short time window.

In regards to the other part of your question, 8224 is saying to use the PASSporT “iat” to correspond to the DATE value of the SIP.  The assumption is that the PASSporT is being created at/close to the initiation of the INVITE.  I think whether you interpret that as taking the DATE and setting it exactly to the “iat” or if you are generating a PASSporT “iat” as a specifically 8225 compliant function in isolation, either will generally work if you are using full form of passport.  From what i’m personally aware of, most implementations are following the former vs the latter.

-Chris

> On May 14, 2018, at 5:17 AM, Asveren, Tolga <[email-masked]> wrote:
> 
> RFC 8224 has the following in Section “4.1 PASSPorT Construction”:
>  
> RFC 8225 has the following in Section “5.1.1 “iat” (Issued At) Claim”:
>  
> i- I see some conflict in RFC8225 text. It is mentioned that “iat” should be set based on issuance of JWT (which would be when PASSPorT is constructed). OTOH, it is also stated that it MUST indicate the date and time of the origination of the personal communication. The former seems to be  the right approach as what we would like to protect against cut-and-paste attacks is the PASSPorT in the context of a particular communication session. Coupling of PASSPorT with the communication session is provided through “orig”/”dest”. “iat” should be set to the time of generation of PASSPorT IMHO. RFC8244 text seems to be O.K. if one accepts this interpretation as it has the notion of “local policy for freshness”. The recommended value is on the very high end (anything more than a few seconds is too much in practice IMHO) but it is at least not mandating use of 60s.
>  
> ii- Aren’t there legitimate cases where a communication session continues for some period of time and then due to change in its nature requires addition of PASSPorT, e.g. first there is an announcement/interaction with an automated system (which may last several minutes) and then the called-party is contacted during which PASSPorT is added (because, for example, organizational boundaries are crossed and there is a need to validate calling-party identity). For such cases there could be a legitimate and major discrepancy between Date and “current time”. This is another argument in favor of considering “iat” as corresponding to PASSPorT generation rather than start of communication session IMHO. There could eb many other scenarios where similar discrepancy legitimately happens especially if one considers non-base claim types, e.g.. “div”.
>  
> So, the bottom line is I would like to get people’s opinion about whether “iat” should pertain to the start of communication session or to the creation of PASSPorT.
>  
>  
> Thanks,
> Tolga
>  
>  
> _______________________________________________
> stir mailing list
> [email-masked] <mailto:[email-masked]>
> https://www.ietf.org/mailman/listinfo/stir <https://www.ietf.org/mailman/listinfo/stir>

---

From: "Asveren, Tolga" <[email-masked]>
Date: Tue, 15 May 2018 17:32:42 +0000

Ideally specifications should have a firm stand on the scope of “iat” IMHO. Ambiguity is something to avoid even if the immediately envisioned use cases could function with both interpretations (and honestly I even doubt that let alone the impact on future extensions/new claim types).

As I already indicated, what makes sense to me is that it for the “JSW”, not for the session therefore “current time” instead of Date needs to be used.

And as a side question: Is there really a practical concern regarding full-form being longer than the compact form? Are the extra few hundreds of octets really something causing heartburn considering that media associated with a session usually would require several magnitudes more?

Thanks,
Tolga

From: Chris Wendt <[email-masked]>
Sent: Monday, May 14, 2018 10:31 AM
To: Asveren, Tolga <[email-masked]>
Cc: [email-masked]
Subject: Re: [stir] "iat" value to use during PASSPorT construction

________________________________
NOTICE: This email was received from an EXTERNAL sender
________________________________

Hi Tolga,

-Chris

On May 14, 2018, at 5:17 AM, Asveren, Tolga <[email-masked]<mailto:[email-masked]>> wrote:

Thanks,
Tolga

_______________________________________________
stir mailing list
[email-masked]<mailto:[email-masked]>
https://www.ietf.org/mailman/listinfo/stir

---

From: "Asveren, Tolga" <[email-masked]>
Date: Thu, 17 May 2018 19:46:25 +0000

To add a bit more color:

The following is the most authoritative specification regarding “iat” generation in general IMHO:

RFC7519 JSON Web Token (JWT)

4.1.6.  "iat" (Issued At) Claim

   The "iat" (issued at) claim identifies the time at which the JWT was

   issued.  This claim can be used to determine the age of the JWT.  Its

   value MUST be a number containing a NumericDate value.  Use of this

   claim is OPTIONAL.

This text clearly states that “iat” is for the generation time of JWS.

So, I think both RFC8224/8225 need to be updated to prevent any ambiguity and be completely consistent with RFC7519.

Thanks,
Tolga

From: Asveren, Tolga
Sent: Tuesday, May 15, 2018 1:33 PM
To: Chris Wendt <[email-masked]>
Cc: [email-masked]
Subject: RE: [stir] "iat" value to use during PASSPorT construction

Thanks,
Tolga

From: Chris Wendt <[email-masked]<mailto:[email-masked]>>
Sent: Monday, May 14, 2018 10:31 AM
To: Asveren, Tolga <[email-masked]<mailto:[email-masked]>>
Cc: [email-masked]<mailto:[email-masked]>
Subject: Re: [stir] "iat" value to use during PASSPorT construction

Hi Tolga,

-Chris

Thanks,
Tolga

---

From: Chris Wendt <[email-masked]>
Date: Thu, 17 May 2018 19:40:14 -0400

There is a bunch of philosophical ratholes we could go down here, but the “issuance” of a JWT i don’t believe is strictly meant to correspond to the “exact” time that the JWT is constructed.  My understanding is that it is meant to represent the time the token is valid in the context of the application and the claims you are making for that application. 
In the context of STIR, the initiation of the INVITE and the corresponding signing of that INVITE should occur in a very small time delta, whether it happens on the same device or between the SIP UE and a network element receiving that INVITE shortly later.  I believe this scenario is completely appropriate within the scope of the definition of “issuance” time.

> On May 17, 2018, at 3:46 PM, Asveren, Tolga <[email-masked]> wrote:
> 
> To add a bit more color:
>  
> 4.1.6 <>.  "iat" (Issued At) Claim
> 
>  
> From: Chris Wendt <[email-masked] <mailto:[email-masked]>> 
> To: Asveren, Tolga <[email-masked] <mailto:[email-masked]>>
> Cc: [email-masked] <mailto:[email-masked]>
> On May 14, 2018, at 5:17 AM, Asveren, Tolga <[email-masked] <mailto:[email-masked]>> wrote:
>

---

From: "Asveren, Tolga" <[email-masked]>
Date: Fri, 18 May 2018 07:28:14 +0000

i- I don’t think we should discredit/undervalue “philosophical aspects”. This is actually what needs to be right. It is what we call “architecture”, isn’t it? It is the foundation for the procedures.
ii- Is there a rathole here? Yes, I think there is and that is because of the “confusion” in RFC8224/8225. So, it is a “self-inflicted damage”, not something which was unavoidable.
iii- It is pretty clear that “iat” pertains to JWS creation per RFC7519. It really is not a good idea to violate this.
iv- Are there practical cases where there would be a significant difference between session initiation time and JWS creation time, yes certainly and I already provided some examples. I am sure there are many more and who knows what the future will bring. Nonetheless, the real issue is that “iat” is not to assert session origination time even if there were no such cases and its use as such wouldn’t be a good idea IMHO.
v- What needs to be done?

  *   RFC8224/8225 should be updated so that use of “iat” as issuance time of JWS is clear and there are no violations.
  *   If there is a need to assert session origination time, then that should be a new JWS parameter defined for some claim type, for example “shaken”. Actually I would prefer that it is not tied to “shaken” and is a new claim type. The reason being that it may be needed even if one doesn’t want to use “shaken”.

I am planning to file errata for RFC8224/8225 and probably prepare a draft for a new claim type for session origination time -at least to gauge the interest-.

Thanks,
Tolga

From: Chris Wendt <[email-masked]>
Sent: Thursday, May 17, 2018 7:40 PM
To: Asveren, Tolga <[email-masked]>
Cc: [email-masked]
Subject: Re: [stir] "iat" value to use during PASSPorT construction

On May 17, 2018, at 3:46 PM, Asveren, Tolga <[email-masked]<mailto:[email-masked]>> wrote:

To add a bit more color:

   claim is OPTIONAL.

Thanks,
Tolga

From: Asveren, Tolga
Sent: Tuesday, May 15, 2018 1:33 PM
To: Chris Wendt <[email-masked]<mailto:[email-masked]>>
Cc: [email-masked]<mailto:[email-masked]>
Subject: RE: [stir] "iat" value to use during PASSPorT construction

Thanks,
Tolga

Hi Tolga,

-Chris

Thanks,
Tolga