<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-stir-identity-header-errors-handling-08" number="9410" submissionType="IETF" category="std" consensus="true" tocInclude="true" sortRefs="true" symRefs="true" updates="" obsoletes="" xml:lang="en" version="3">

  <!-- xml2rfc v2v3 conversion 3.17.0 -->
  <front>
    <title abbrev="Identity Header Errors Handling for STIR">Handling of Identity Header Errors for Secure Telephone Identity Revisited (STIR)</title>
    <seriesInfo name="RFC" value="9410"/>
    <author initials="C." surname="Wendt" fullname="Chris Wendt">
      <organization>Somos Inc.</organization>
      <address>
        <email>chris-ietf@chriswendt.net</email>
      </address>
    </author>
    <date year="2023" month="July"/>
    <area>art</area>
    <workgroup>stir</workgroup>
    <keyword>Identity</keyword>
    <keyword>multiple errors</keyword>
    <keyword>passport</keyword>
    <keyword>reason header field</keyword>
    <abstract>
      <t>This document extends the current error-handling procedures for mapping of
verification failure reasons to 4xx codes for Secure Telephone Identity Revisited (STIR)
and the Authenticated Identity Management in the Session Initiation
Protocol (SIP). 
It extends the ability to use the Reason header field as an option for conveying
an error associated with an Identity header field 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 field for scenarios that use multiple Identity header fields, where some may have errors and others may not. The handling of those situations is also defined.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>The STIR framework as described in <xref target="RFC7340"/> is an authentication framework for asserting a telephone number or URI-based identity using a digital signature and certificate-based framework, as described <xref target="RFC8225"/> and <xref target="RFC8226"/>, respectively.  
<xref target="RFC8224"/> describes the use of the STIR framework in the SIP protocol <xref target="RFC3261"/>. It defines both a) the authentication service that creates a PASSporT <xref target="RFC8225"/> and delivers it in an Identity header field, and b) the verification service that correspondingly verifies the PASSporT and embedded originating identity.</t>
      <t>This document is concerned with errors in validating PASSporTs and Identity header fields and how they are communicated in special cases. This document also defines a solution to help address the potential issue of multiple Identity header fields and the plurality of potential verification errors. 
Additionally, it addresses the issue of the current 4xx error response, i.e., the call is terminated when a verification error is present. In some deployments, it may be the case that the policy for handling errors dictates that calls should continue even if there is a verification error. 
For example, in many cases of inadvertent or operational errors that do not represent any type of identity falsification attempt, the preferred policy may be to continue the call despite the unverified identity. In these cases, the authentication service should still be notified of the error so that corrective action can be taken to fix any issues. This specification will discuss the use of the Reason header field in subsequent provisional (1xx) responses in order to deliver the error back to the authentication service or other SIP path network equipment responsible for error handling.</t>
      <t>To handle multiple Identity header fields where 
 some in a call may be verified while others may not (i.e., they have 
 errors), this document defines a method by which an identifier is added 
 to the header so that the authentication service can uniquely identify 
 which Identity header field is being referred to in
 the case of an error.</t>
    </section>
    <section anchor="terminology">
      <name>Terminology</name>
        <t>
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>
    </section>
    <section anchor="reason-header-field-protocol-stir">
      <name>Reason Header Field Protocol "STIR"</name>

      <t>This document defines a new Reason header field <xref target="RFC3326"/> protocol, "STIR", for STIR applications using SIP as defined in <xref target="RFC8224"/>. 
The use of "STIR" as a Reason header field protocol with the error defined in <xref target="RFC8224"/> causes codes to allow the use of multiple Reason header fields as detailed in <xref target="RFC3326"/> and updated in <xref target="RFC9366"/>. Any provisional SIP response message or final response message, with the exception of a 100 (Trying), <bcp14>MAY</bcp14> contain one or more Reason header fields with a STIR-related cause code defined in <xref target="RFC8224"/> or future specifications. The use of multiple Reason header fields is discussed in more detail later in the document.</t>
    </section>
    <section anchor="use-of-provisional-response-to-signal-errors-without-terminating-the-call">
      <name>Use of Provisional Response to Signal Errors without Terminating the Call</name>
      <t>In cases where local policy dictates that a call should continue regardless of any verification errors that may have occurred, including 4xx errors described in <xref sectionFormat="of" target="RFC8224" section="6.2.2"/>, the verification service <bcp14>MUST NOT</bcp14> send the 4xx as a response. Rather, it should include the error response code and reason phrase in a Reason header field in the next provisional or final response it sends to the authentication service.</t>
      <t>Example Reason header field:</t>
      <artwork><![CDATA[
Reason: STIR ;cause=436 ;text="Bad Identity Info"
]]></artwork>
    </section>
    <section anchor="handling-of-a-verification-error-when-there-are-multiple-identity-header-fields">
      <name>Handling of a Verification Error When There Are Multiple Identity Header Fields</name>
      <t>In cases where a SIP message includes multiple Identity header fields and one of those Identity header fields has an error, the verification service <bcp14>MUST</bcp14> include the error response code and reason phrase associated with the error in a Reason header field, defined in <xref target="RFC3326"/>, in the next provisional or final responses sent to the authentication service. The reason cause in the Reason header field <bcp14>MUST</bcp14> represent the error that occurred when verifying the contents of the Identity header field. For a SIP INVITE containing multiple Identity header fields, the "ppi" parameter for the Reason header field is <bcp14>RECOMMENDED</bcp14>. As defined in <xref target="RFC8224"/>, the STIR error codes used in responses are based on an error associated with a specific Identity header field representing a single error occurring with the verification and processing of that Identity header field. 
The association of a "ppi" parameter with a Reason header field <xref target="RFC3326"/> using the protocol value of "STIR" defined in this document <bcp14>MUST</bcp14> only identify a single cause code <xref target="RFC3326"/> in the context of a call dialog <xref target="RFC3261"/> corresponding only to the STIR-related error codes defined in <xref target="RFC8224"/> or future documents defining STIR-related error codes. The associated PASSporT object can be included either 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 <xref target="RFC8225" sectionFormat="of" 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; this is discussed in <xref target="Security"/>.</t>

      <t>Example Reason header field with a full form PASSporT:</t>
      <artwork><![CDATA[
Reason: STIR ;cause=436 ;text="Bad Identity Info" ;ppi= \
"eyJhbGciOiJFUzI1NiIsInR5cCI6InBhc3Nwb3J0IiwieDV1I \
joiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUub3JnL3Bhc3Nwb3J0LmNlciJ9.eyJ \
kZXN0Ijp7InVyaSI6WyJzaXA6YWxpY2VAZXhhbXBsZS5jb20iXX0sImlhdC \
I6IjE0NDMyMDgzNDUiLCJvcmlnIjp7InRuIjoiMTIxNTU1NTEyMTIifX0.r \
q3pjT1hoRwakEGjHCnWSwUnshd0-zJ6F1VOgFWSjHBr8Qjpjlk-cpFYpFYs \
ojNCpTzO3QfPOlckGaS6hEck7w"
]]></artwork>
      <t>Example Reason header field with a compact form PASSporT:</t>
      <artwork><![CDATA[
Reason: STIR ;cause=436 ;text="Bad Identity Info" ;ppi= \
"..rq3pjT1akEGjHCnWSwUnshd0-zJ6F1VOgFWSjHBr8Qjpjlk-cpFYpFYs \
ojNCpTzO3QfPOlckGaS6hEck7w"
]]></artwork>
    </section>
    <section anchor="handling-multiple-verification-errors">
      <name>Handling Multiple Verification Errors</name>
      <t>If there are multiple Identity header field verification errors being reported, the verification service <bcp14>MUST</bcp14> include a corresponding number of Reason header fields per error.  These Reason header fields should include a "ppi" parameter, including the 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 <xref target="RFC3326"/> is updated in <xref target="RFC9366"/>, allowing multiple Reason header fields with the same protocol value. For this specification, "STIR" should be used for any STIR error defined in <xref target="RFC8224"/> or future specifications.</t>
      <t>Example Reason header fields for two identity info errors:</t>
      <artwork><![CDATA[
Reason: STIR ;cause=436 ;text="Bad Identity Info" ;ppi=     \
"..rq3pjT1hoRwakEGjHCnWSwUnshd0-zJ6F1VOgFWSjHBr8Qjpjlk-cpFY \
pFYsojNCpTzO3QfPOlckGaS6hEck7w"

Reason: STIR ;cause=438 ;text="Invalid Identity Header" ;ppi=  \
"..rJ6F1VOgFWSjHBr8Qjpjlk-cpFYpFYsq3pjT1hoRwakEGjHCnWSwUnsh \
d0-zckGaS6hEck7wojNCpTzO3QfPOl"
]]></artwork>
    </section>
    <section anchor="removal-of-the-reason-header-field-by-authentication-service">
      <name>Removal of the Reason Header Field by Authentication Service</name>
      <t>When an authentication service <xref target="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). Then, it <bcp14>MUST</bcp14> remove the identified Reason header field to avoid the PASSporT information from going upstream to a User Agent Client (UAC) or User Agent Server (UAS) that may not be authorized to see claim information contained in the PASSporT for privacy or other reasons.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>IANA has registered the following new protocol value (and associated protocol cause) in the "Reason Protocols" registry under <eref target="http://www.iana.org/assignments/sip-parameters" brackets="angle"/>:</t>

<table anchor="iana1"> 
  <thead>
    <tr>
      <th>Protocol Value</th>   
      <th>Protocol Cause</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>         
    <tr>
      <td>STIR</td>
      <td>STIR Error code</td>
      <td><xref target="RFC8224"/></td>
    </tr>
  </tbody>
</table>

      <t>IANA has also registered a new header field parameter name in the 
"Header Field Parameters and Parameter Values" registry under <eref target="https://www.iana.org/assignments/sip-parameters" brackets="angle"/>:</t>

<table anchor="iana2">
  <thead>
    <tr>
      <th>Header Field</th>   
<th>Parameter Name</th> 
<th>Predefined Values</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>         
    <tr>
      <td>Reason</td>
      <td>ppi</td>
      <td>No</td>
      <td>RFC 9410</td>
    </tr>
  </tbody>
</table>

    </section>
    <section anchor="Security">
      <name>Security Considerations</name>
      <t>This specification discusses the use of a PASSporT as an identifier for cases where there are multiple identity header field errors occurring 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 upstream beyond the authentication service that originally signed the PASSporT(s) in the resulting error Reason header field. This specification states that the authentication service <bcp14>MUST</bcp14> remove the Reason header field with the PASSporT to protect the security (e.g., use of a 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 the full and compact form of the PASSporT to be used as the error identifier, use of the compact form is <bcp14>RECOMMENDED</bcp14> to avoid  the potential exposure of call information contained in the full form of the PASSporT.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>

<!-- [I-D.ietf-sipcore-multiple-reasons] Published as RFC 9366 -->

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9366.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3261.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3326.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8224.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8225.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8226.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7340.xml"/>
      </references>
    </references>
    <section anchor="acknowledgements" numbered="false">
      <name>Acknowledgements</name>
      <t>The author would like to thank <contact fullname="David Hancock"/> for help identifying these error scenarios, as well as <contact fullname="Jon Peterson"/>, <contact fullname="Roman Shpount"/>, <contact fullname="Robert Sparks"/>, <contact fullname="Christer Holmberg"/>, and others in the STIR Working Group for their helpful feedback and discussion.</t>
    </section>
  </back>
</rfc>
