Identity Header Errors Handling
Chris Wendt
Somos
chris-ietf@chriswendt.net
15 September 2022
ART
STIR Working Group
Identity
This document extends STIR and the Authenticated Identity Management in the Session Initiation Protocol (SIP) error handling procedures to include the mapping of verification failure reasons to STIR defined 4xx codes so the failure reason of an Identity header field can be conveyed to the upstream authentication service when local policy dictates that the call should continue in the presence of a verification failure. This document also defines procedures that enable a failure reason to be mapped to a specific Identity header for scenarios that use multiple Identity header fields where some may have errors and others may not and the handling of those situations is defined.
Introduction
[RFC8224] in Section 6.2.2 discusses future specifications for enhancement of how errors are communicated and the handling of multiple Identity header fields. This specification provides some additional mechanisms for solutions to address these problems.
In some deployments of STIR and specifically using SIP [RFC3261] as defined by [RFC8224], one issue with the current error handling, specifically with the use of the defined 4xx error responses, is that when an error occurs with the verification of the Identity header field or the PASSporT contained in the Identity header field and a 4xx response is returned, the call is then terminated. It may be the case that the policy for handling errors dictates that calls should continue even if there is a verification error, in the case of, for example inadvertent errors, however the authentication service should still be notified of the error so that corrective action can be taken. This specification will discuss the use of the Reason header field in subsequent provisional (1xx) responses in order to accomplish this.
For the handling of multiple Identity header fields and the potential situation that some of the Identity header fields in a call may pass verification but others may have errors, this document provides a mechanism to add an identifier so that the authentication service can identify which Identity header field is being referred to in the case of an error.
Terminology
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
Reason header field protocol "STIR"
This document defines a new Reason header field [RFC3326] protocol "STIR" for STIR applications using SIP as defined in [RFC8224]. The use of "STIR" as a reason header field protocol with the [RFC8224] defined error cause codes allows the use of multiple Reason header fields defined in [RFC3326] and updated in [I-D.ietf-sipcore-multiple-reasons]. Any SIP Response message, with the exception of a 100 (Trying), MAY contain one or more Reason header fields with a STIR related cause code defined in [RFC8224] or future specifications. The use of multiple Reason header field is discussed in more detail later in the document.
Use of provisional error responses to signal errors without terminating the call
In cases where local policy dictates that a call should continue regardless of any verification errors that may have occured, including 4XX errors described in [RFC8224] Section 6.2.2, then the verification service SHOULD NOT send the 4XX as a response, but rather include the error response code and reason phrase in a Reason header field, defined in [RFC3326], in the next provisional or final responses sent to the authentication service.
Example Reason header field:

Reason: STIR ;cause=436 ;text="Bad Identity Info"

Handling of a verification error when there are multiple Identity header fields
In cases where a SIP message includes multiple Identity header fields and one of those Identity header fields has an error, the verification service SHOULD include the error response code and reason phrase associated with the error in a Reason header field, defined in [RFC3326], in the next provisional or final responses sent to the authentication service. The reason cause in the Reason header field SHOULD represent the error that occurred when verifying the contents of the Identity header field. The association of a Reason header field and error to a specific Identity header field is accomplished by adding a PASSporT identifier, "ppi", parameter containing the PASSporT string as an identifier for the identity header and corresponding PASSporT that generated the error to the Reason header field. The "ppi" parameter for the Reason header field is optional, but RECOMMENDED, in particular for cases that a SIP INVITE contains multiple Identity header fields. As implied and defined in [RFC8224], error codes associated with STIR targeted at authentication services that produced a specific identity header represent a single error occurring with the verification and processing of that identity header. Therefore the association of a "ppi" parameter with a Reason header using "STIR" protocol MUST only identify a single cause code in the context of a call dialog defined in [RFC8224] or in future documents defining STIR related errors. The PASSporT can be included in full form or in compact form, where only the signature of the PASSporT is included with two periods as a prefix as defined in [RFC8225] Section 7 to identify the reported Identity header field with an error. Compact form is the recommended form as full form may include information that could have privacy or security implications in some call scenarios as discussed in Section 9.
Example Reason header field with full form PASSporT:

Reason: STIR ;cause=436 ;text="Bad Identity Info" ;ppi= \
"eyJhbGciOiJFUzI1NiIsInR5cCI6InBhc3Nwb3J0IiwieDV1I \
joiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUub3JnL3Bhc3Nwb3J0LmNlciJ9.eyJ \
kZXN0Ijp7InVyaSI6WyJzaXA6YWxpY2VAZXhhbXBsZS5jb20iXX0sImlhdC \
I6IjE0NDMyMDgzNDUiLCJvcmlnIjp7InRuIjoiMTIxNTU1NTEyMTIifX0.r \
q3pjT1hoRwakEGjHCnWSwUnshd0-zJ6F1VOgFWSjHBr8Qjpjlk-cpFYpFYs \
ojNCpTzO3QfPOlckGaS6hEck7w"

Example Reason header field with compact form PASSporT:

Reason: STIR ;cause=436 ;text="Bad Identity Info" ;ppi= \
"..rq3pjT1akEGjHCnWSwUnshd0-zJ6F1VOgFWSjHBr8Qjpjlk-cpFYpFYs \
ojNCpTzO3QfPOlckGaS6hEck7w"

Handling multiple verification errors
If there are multiple Identity header field verification errors being reported the verification service SHOULD include corresponding Reason header fields with "ppi" parameters including full or compact form of the PASSporT with cause and text parameters identifying each error. As mentioned previously, the potential use of multiple Reason header fields defined in [RFC3326] is updated in [I-D.ietf-sipcore-multiple-reasons] allowing multiple Reason header fields with the same protocol value, for this specification being "STIR".
Example Reason header fields for two identity info errors:

Reason: STIR ;cause=436 ;text="Bad Identity Info" ;ppi=     \
"..rq3pjT1hoRwakEGjHCnWSwUnshd0-zJ6F1VOgFWSjHBr8Qjpjlk-cpFY \
pFYsojNCpTzO3QfPOlckGaS6hEck7w"

Reason: STIR ;cause=436 ; text="Bad Identity Info" ;ppi=    \
"..rJ6F1VOgFWSjHBr8Qjpjlk-cpFYpFYsq3pjT1hoRwakEGjHCnWSwUnsh \
d0-zckGaS6hEck7wojNCpTzO3QfPOl"

Removal of the Reason header field by Authentication Service
When an Authentication Service [RFC8224] receives the Reason header field with a PASSporT it generated as part of an Identity header field and the authentication of a call, it should first follow local policy to recognize and acknowledge the error (e.g. perform operational actions like logging or alarming), but then MUST remove the identified Reason header field to avoid the PASSporT information from going upstream to a UAC or UAS that may not be authorized to see claim information contained in the PASSporT for privacy or other reasons.
IANA Considerations
This document requests the definition of a new protocol value (and associated protocol cause) to be registered by the IANA into the "Reason Protocols" sub-registry under http://www.iana.org/assignments/sip-parameters as follows:

Protocol Value   Protocol Cause            Reference
--------------   ---------------           -----------
STIR             STIR Error code           RFC 8224

This document also requests the definition of a new header field parameter name to be registered by IANA into the Header Field Parameters and Parameter Values sub-registry under https://www.iana.org/assignments/sip-parameters as follows:

Header Field   Parameter Name   Predefined Values  Reference
------------   --------------   -----------------  ---------
Reason         ppi               No                RFC THIS

Security Considerations
This specification discusses the use of a PASSporT as an identifier for cases where there is multiple identity header errors occuring as part of the Reason header field response. For some call scenarios (e.g. diversion based call flows) the signer of the PASSporT(s) may not be the first hop initiator of the call. In those cases, there may be some security or privacy concerns associated with PASSporT information that is passed beyond the authentication service that originally signed the PASSporT(s) in the resulting error Reason header field. This specification states the authentication service MUST remove the Reason header field with the PASSporT to protect the security (e.g. use of potentially still fresh PASSporT for replay attacks) and privacy of any potential information that could be passed beyond the authentication service response back in the direction of the call initiator. While this specification allows for both full and compact form of the PASSporT to be used as the error identifier, use of the compact form can avoid many of the security and privacy concerns.

Normative References
[I-D.ietf-sipcore-multiple-reasons]

Multiple SIP Reason Header Field Values
Robert Sparks
23 August 2022
Internet-Draft draft-ietf-sipcore-multiple-reasons-01
[RFC3261]

SIP: Session Initiation Protocol
J. Rosenberg
H. Schulzrinne
G. Camarillo
A. Johnston
J. Peterson
R. Sparks
M. Handley
E. Schooler
June 2002
RFC 3261
DOI 10.17487/RFC3261
[RFC3326]

The Reason Header Field for the Session Initiation Protocol (SIP)
H. Schulzrinne
D. Oran
G. Camarillo
December 2002
RFC 3326
DOI 10.17487/RFC3326
[RFC8224]

Authenticated Identity Management in the Session Initiation Protocol (SIP)
J. Peterson
C. Jennings
E. Rescorla
C. Wendt
February 2018
RFC 8224
DOI 10.17487/RFC8224
[RFC8225]

PASSporT: Personal Assertion Token
C. Wendt
J. Peterson
February 2018
RFC 8225
DOI 10.17487/RFC8225
[RFC2119]

Key words for use in RFCs to Indicate Requirement Levels
S. Bradner
March 1997
BCP 14
RFC 2119
DOI 10.17487/RFC2119
[RFC8174]

Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words
B. Leiba
May 2017
BCP 14
RFC 8174
DOI 10.17487/RFC8174
Acknowledgements
Would like to thank David Hancock for help to identify these error scenarios and Jon Peterson, Roman Shpount, Robert Sparks and STIR working group for helpful feedback and discussion.