<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="rfc7991bis.rnc"?>
<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> -->


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

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="std"
  docName="draft-soni-auth-uri-00"
  ipr="trust200902"
  submissionType="IETF"
  xml:lang="en"
  version="3">

  <front>
    <title abbrev="auth URI">The auth URI scheme</title>

    <seriesInfo name="Internet-Draft" value="draft-soni-auth-uri-00"/>
   
    <author fullname="Soni Lasso Terense" initials="S." surname="Lasso">
      <address>
        <email>fakedme@gmail.com</email>
        <uri>https://soniex2.autistic.space/</uri>
      </address>
    </author>
   
    <date year="2024"/>

    <area>art</area>
    <workgroup>Internet Engineering Task Force</workgroup>

    <abstract>
      <t>This document describes an URI scheme capable of susbtituting userinfo
      in traditional URIs, in machine-to-machine contexts, allowing for the
      deprecation and, in some applications, complete elimination of userinfo from
      URIs.  In particular, the nature of the proposed
      URI scheme makes it unsuitable for use in semantic attacks, without
      compromising legitimate use-cases.</t>
    </abstract>
 
  </front>

  <middle>
    
    <section>
      <name>Introduction</name>
      <t>Userinfo in URIs has been around since the introduction of URIs, but this
      is widely considered a historical mistake, as, due to the way userinfo is
      constructed, it enables some semantic attacks on URIs
      <xref target="RFC3986" sectionFormat="parens" section="7.6" />.  Unfortunately,
      in machine-to-machine contexts, the ability to shove an userinfo-shaped peg
      into just about any URI-shaped hole turned out to be highly useful.  The auth
      URI builds on this context and enables the complete removal of the userinfo
      syntax in at least some applications.</t>
      
    <section>
      <name>Requirements Language</name>
      <t>The key words "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 <xref target="RFC2119"/>
        <xref target="RFC8174"/> when, and only when, they appear in
        all capitals, as shown here.</t>
    </section>
    </section>
    
    <section>
      <name>Background: Considerations for a new way of encoding authentication</name>
      <t>The primary goal of a replacement for the userinfo syntax should be mitigating
      and/or eliminating the userinfo-related semantic attacks currently applicable
      to URIs.  However, this does not preclude secondary goals such as improved
      support for secret storage (password managers).  Making it an URI enables
      the following features in alignment with the primary goal:</t>
    <t>The auth URI generally prohibits operating system-level handling.  When one
      program attempts to open an auth URI, the operating system MUST NOT open another
      program to handle the auth URI.</t>
    <t>Like userinfo, the auth URI shows up first/early in the URI, but unlike
      userinfo, it is not recognizable as a website or web address.  This makes the
      auth URI easier to identify as an auth URI or at least "not a normal web address"
      than the equivalent userinfo.</t>
    <t>The auth URI explicitly uses syntax that is not usually detected by
      existing link recognition/extraction systems or "linkifiers".  While this
      doesn't really add anything beyond the previously mentioned mitigations,
      it does help to reiterate that these URIs, while valid URIs, are not hyperlinks.</t>
    <t>Additionally, and in alignment with secondary goals, the auth URI can
      support "advanced" auth methods, including secret storage integration.</t>
  </section>

  <section>
    <name>The auth URI: syntax and semantics</name>
    <t>The auth URI is a meta-URI, in that it carries an URI within itself.  The
      auth URI syntax is defined here in Augmented BNF <xref target="RFC5234"/>,
        borrrowing the terms 'URI', 'unreserved', and 'pct-encoded' from
      <xref target="RFC3986"/>.</t>
        <sourcecode type="abnf" markers="false">
          <![CDATA[
authURI             = "auth" ":" auth-method "?" auth-query "&&" URI
auth-query          = [ auth-qattr *("&" auth-qattr) ]
auth-q-res-avail    = ":" / "[" / "]" / "@" / "!" / "$" /
                      "'" / "(" / ")" / "*" / "+" / "," / "="
auth-qchar          = unreserved / auth-q-res-avail / pct-encoded
auth-attr-name-char = ALPHA / DIGIT / "-" / "_"
auth-method-nm-char = ALPHA / DIGIT / "-" / "_"
auth-qattr          = 1*auth-attr-name-char "=" *auth-qchar
auth-method         = 1*auth-method-nm-char
          ]]>
        </sourcecode>
        <t>As an additional requirement, the embedded URI MUST NOT contain userinfo.</t>
        <t>Semantically, the auth URI attaches auth details (not necessarily credentials
        themselves, but possibly how to locate the credentials) to the embedded
        URI.  This embedded URI MAY itself be another auth URI, and an implementation
          MAY retry auth with the inner details, but SHOULD limit the maximum number
          of retries.  An implementation MUST be able to parse at least 3 auth URIs
          before an embedded URI.</t>
        <section anchor="fragment-handling">
          <name>Fragment Handling</name>
          <t><xref target="RFC3986" section="3.5" /> specifies how fragments should
          be handled, and said specification is reiterated by
          <xref target="RFC8820" section="2.5"/>.  For the sake of clarification,
          the auth URI does not affect fragment resolution.  However, care must
          be taken when parsing auth URIs with RFC3986 libraries: the fragment
          identifier will be extracted with the full URI and any "%23" in the
          embedded URI MUST NOT be unescaped before further parsing.</t>
        </section>
  </section>

  <section anchor="info-method">
    <name>The "info" method</name>
    <t>The "info" method is a direct replacement for traditional userinfo.  As such,
    it takes two attributes: "name" and "ad" (short for "auth data").  As with
    traditional userinfo, only the "name" attribute is required.  As with
    traditional userinfo, applications are encouraged to not render in cleartext
    the value of the "ad" attribute.</t>
  </section>
    
    <section anchor="IANA">
      <name>IANA Considerations</name>
      <t>In accordance with the guidelines and registration procedures for new
      URI schemes <xref target="RFC7595"/>, this section provides the information needed
        to register the 'auth' URI scheme.</t>
      <t>Scheme name: auth</t>
      <t>Status: Permanent</t>
      <t>Applications/Protocols that use this scheme name: At the time of writing,
        no applications use this scheme name.  The intent is for this scheme to gradually
        replace userinfo in applications that currently make use of userinfo.</t>
      <t>Contact: Soni L., fakedme@gmail.com</t>
      <t>Change controller: [Note to RFC Editor: Replace with standard IETF language]</t>
      <t>References: RFC XXXXX [Note to RFC Editor: Replace with final RFC number]</t>
      <t>Additionally, in accordance IANA Considerations <xref target="RFC8126"/>,
        the IANA is asked to create a registry for auth URI methods.</t>
      <t>Registry Name: 'auth' URI Methods</t>
      <t>Registry Group: Uniform Resource Identifiers (URI) Schemes</t>
      <t>Registry Information: Method Name, References</t> 
      <t>Assignment Policy: IETF review</t>

      <section>
        <name>Initial assignments</name>
        <section>
          <name>The 'info' method</name>
          <t>Method Name: info</t>
          <t>References: This document, <xref target="info-method"/>.</t>
        </section>
      </section>
    </section>
    
    <section anchor="Security">
      <name>Security Considerations</name>
      <t>Borrowing from <xref target="RFC2718" section="2.4"/>, the 'auth' URI must
      consider the following:</t>
      <t>Does the user need to be warned that such a thing is happening without
      an explicit request? This will generally depend on the auth method used,
      but in particular the "info" method does not require it.</t>
      <t>Is it possible to fake URLs of this type in a dangerous way? No.  In fact,
      the primary purpose of the auth URI is to forbid this.</t>
      <t>Are there mechanisms for identifying the requester? None that are known.</t>
      <t>Does the mechanism contains passwords or other security information that are
      passed inside the referring document in the clear? Yes, but no more than
      existing mechanisms, and only for compatibility purposes.  This last point
      should sufficiently meet the requirements of <xref target="RFC3552" />.</t>
    </section>

    <section anchor="Interoperability">
      <name>Interoperability Considerations</name>
      <t>The 'auth' URI explicitly breaks interoperability with existing
        userinfo-based systems, possibly necessitating conversions between them.</t>
      <t>Also, as described in <xref target="fragment-handling" />, care must be
        taken when parsing the embedded URI.</t>
    </section>

    <section anchor="Encoding">
      <name>Encoding considerations</name>
      <t>[genuinely unsure what to put here... it's not entirely uncommon to find
      binary data encoded in an userinfo?]</t>
    </section>
  </middle>

  <back>
    <references>
      <name>References</name>

      <references>
        <name>Normative References</name>
        
        <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"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7595.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3986.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8820.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5234.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3552.xml"/>
        
      </references>
 
      <references>
        <name>Informative References</name>

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7512.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7565.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2718.xml"/>
        
      </references>
    </references>

    <section anchor="Acknowledgements" numbered="false">
      <name>Acknowledgements</name>
      <t>Many of the ABNF rules in this document were adapted from
      <xref target="RFC7512"/>.  Some of the structure of this text was adapted
        from <xref target="RFC7565"/>.</t>
    </section>
 </back>
</rfc>
