<?xml version='1.0' encoding='utf-8'?> encoding='UTF-8'?>

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

<?rfc sortrefs="yes"?>
<?rfc subcompact="no"?>
<?rfc symrefs="yes"?>
<?rfc toc="yes"?>
<?rfc tocdepth="3"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" docName="draft-ietf-sidrops-rrdp-same-origin-04" number="9674" ipr="trust200902" xml:lang="en" symRefs="true" sortRefs="true" submissionType="IETF" consensus="true" updates="8182" obsoletes="" tocInclude="true" version="3">

  <front>
    <title abbrev="RRDP Same-Origin Policy">Same-Origin Policy for the RPKI Repository Delta Protocol (RRDP)</title>
    <seriesInfo name="RFC" value="9674"/>
    <author fullname="Job Snijders" initials="J." surname="Snijders">
      <organization>Fastly</organization>
      <address>
        <postal>
          <street/>
          <code/>
          <city>Amsterdam</city>
          <country>Netherlands</country>
        </postal>
        <email>job@fastly.com</email>
      </address>
    </author>

    <date />

    <area>ops</area>
    <workgroup>SIDROPS</workgroup> month="November" year="2024"/>

    <area>OPS</area>
    <workgroup>sidrops</workgroup>

    <keyword>same-origin</keyword>
    <keyword>RPKI</keyword>
    <keyword>RRDP</keyword>

    <abstract>
      <t>
        This document describes a Same-Origin Policy (SOP) requirement for RPKI Resource Public Key Infrastructure (RPKI) Repository Delta Protocol (RRDP) servers and clients.
        Application of a SOP in RRDP client/server communication isolates resources such as Delta and Snapshot files from different Repository Servers, reducing possible attack vectors.
        This document updates RFC 8182.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro">
      <name>Introduction</name>

      <t>
        This document specifies a Same-origin policy Same-Origin Policy (SOP) requirement for RPKI Repository Delta Protocol (RRDP) servers and clients.
        The SOP concept is a security mechanism to restrict how a document loaded from one origin can cause interaction with resources from another origin.
        See <xref target="RFC6454"/> for an overview of the concept of an "origin".
        Application of a SOP in RRDP client/server communication isolates resources such as Delta and Snapshot files from different Repository Servers, reducing possible attack vectors.
        Another way to avoid undesirable implications (as described in <xref target="issue"/>) would be for a future version of the RRDP protocol to use relative URIs instead of absolute URIs.
        This document updates <xref target="RFC8182"/>.
      </t>

      <section anchor="requirements">
        <name>Requirements Language</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>

    <section title="Implications anchor="issue">
      <name>Implications of cross-origin resource requests Cross-Origin Resource Requests in RRDP" anchor="issue"> RRDP</name>
      <t>
        The first RRDP protocol specification did not explicitly disallow 'cross-origin' URI references from the Update Notification file (<xref target="RFC8182" section="3.5.1"/>) towards Delta (<xref target="RFC8182" section="3.5.3"/>) and Snapshot (<xref target="RFC8182" section="3.5.2"/>) files, and it was silent on the topic of HTTP Redirection (<xref target="RFC9110" section="15.4"/>).
      </t>
      <t>
        The implication of cross-origin references in Update Notification files is that one Repository Server can reference RRDP resources on another Repository Server and in doing so inappropriately increase the resource consumption for both RRDP clients and the referenced Repository Server.
        An adversary could also employ cross-origin HTTP Redirects towards other Repository Servers, causing similar undesirable behavior.
      </t>
    </section>

    <section title="Changes

    <section>
      <name>Changes to RFC 8182"> 8182</name>
      <t>
        To overcome the aforementioned issue described in <xref target="issue"/>, RRDP Repository Servers and Clients MUST <bcp14>MUST</bcp14> apply a Same-Origin Policy to both the URIs referenced in an Update Notification File and any HTTP Redirects.
      </t>
      <section title="New
      <section>
	<name>New Requirements for RRDP Repository Servers"> Servers</name>
        <t>
          The following checklist items are added to <xref target="RFC8182" section="3.5.1.3"/>:
        </t>
        <t>NEW</t>
        <blockquote>
          <ul>
            <li>
              The
          <ul spacing="normal">
            <li>The "uri" attribute in the snapshot element and optional delta
            elements MUST <bcp14>MUST</bcp14> be part of the same origin (i.e.,
            represent the same principal), meaning referenced URIs MUST
            <bcp14>MUST</bcp14> have the same scheme, host, and port as the
            URI for the Update Notification File specified in the referring
            RRDP SIA AccessDescription.
            </li>
            <li>
              The AccessDescription.</li>
            <li>The Repository Server MUST NOT <bcp14>MUST NOT</bcp14> respond with
            HTTP Redirects towards locations with an origin different from the
            origin of the Update Notification File specified in the referring
            RRDP SIA AccessDescription.
            </li> AccessDescription.</li>
          </ul>
        </blockquote>
      </section>
      <section title="New
      <section>
	<name>New Requirements for Relying Parties using RRDP"> Using RRDP</name>
        <t>
          The following adds to <xref target="RFC8182" section="3.4.1"/>:
        </t>
        <t>NEW</t>
        <blockquote>
          <ul>
            <li>
              The
          <ul spacing="normal">
            <li>The Relying Party MUST <bcp14>MUST</bcp14> verify whether the
            "uri" attributes in the Update Notification File are of the same
            origin as the Update Notification File itself.  If this
            verification fails, the file MUST <bcp14>MUST</bcp14> be rejected and
            RRDP cannot be used, used; see Section <xref target="RFC8182" section="3.4.5"/> section="3.4.5" sectionFormat="bare"/>
            for considerations.  Implementations SHOULD <bcp14>SHOULD</bcp14> log a
            message when cross-origin referrals are detected.
            </li>
            <li>
              The
            <li>The Relying Party MUST NOT <bcp14>MUST NOT</bcp14> follow HTTP
            Redirection following that results from attempts to download Update
            Notification, Delta, and Snapshot files if the target origin is
            different from the origin of the Update Notification File
            specified in the referring RRDP SIA AccessDescription.  If this
            verification fails, the RRDP session MUST <bcp14>MUST</bcp14> be
            rejected and RRDP cannot be used, used; see Section <xref target="RFC8182" section="3.4.5"/>
            section="3.4.5" sectionFormat="bare"/> for considerations.  Implementations SHOULD
            <bcp14>SHOULD</bcp14> log a message when cross-origin redirects
            are detected.
            </li>
          </ul>
        </blockquote>
      </section>
    </section>

    <section title="Deployability

    <section>
      <name>Deployability in the Internet&apos;s current RPKI"> Internet's Current RPKI</name>
      <t>
        Analysing
        Analyzing the <xref target="rpkiviews"/> archives for the period from April to September 2024, only one RRDP server (reached following the TALs Trust Anchor Locators (TALs)  of the five Regional Internet Registries) employed a same-origin HTTP redirect.
        In the period October 2021 - October 2024 no RRDP Repository Servers were observed which that employed cross-origin URIs in Update Notification Files.
      </t>
      <t>
        This means that imposing a requirement for the application of a Same-Origin Policy does not cause any existing commonly-used commonly used RRDP Repository Server operations to become non-compliant.
      </t>
    </section>

    <section anchor="security">
      <name>Security Considerations</name>
      <t>
        This document addresses an oversight in the original RRDP protocol specification: cross-origin Cross-origin requests are detrimental as they allow one repository operator to increase resource consumption for other repository operators and RRDP clients.
      </t>
    </section>

    <section anchor="iana" title="IANA Considerations"> anchor="iana">
      <name>IANA Considerations</name>
      <t>
        No
        This document has no IANA actions required. actions.
      </t>
    </section>
  </middle>

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

        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/> href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6454.xml"/> href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6454.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/> href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8182.xml"/> href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8182.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9110.xml"/> href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9110.xml"/>
      </references>

      <references>
        <name>Informative References</name>

        <reference anchor="rpki-client" target="https://www.rpki-client.org/">
          <front>
            <title>rpki-client</title>
            <author fullname="Claudio Jeker"/>
            <author fullname="Job Snijders"/>
            <author fullname="Kristaps Dzonsons"/>
            <author fullname="Theo Buehler"/>
            <date/>
          </front>
        </reference>

        <reference anchor="rpki-prover" target="https://github.com/lolepezy/rpki-prover">
          <front>
            <title>rpki-prover</title>
            <author fullname="Mikhail Puzanov"/>
            <date/>
          </front>
        </reference>

       <reference anchor="FORT-validator" target="https://fortproject.net/en/validator">
          <front>
            <title>FORT validator</title>
            <author fullname="Alberto Leiva"/>
            <date/>
          </front>
        </reference>

        <reference anchor="Routinator" target="https://github.com/NLnetLabs/routinator/">
          <front>
            <title>Routinator</title>
            <author>
              <organization>NLNet Labs</organization>
            </author>
            <date/>
          </front>
        </reference>

        <reference anchor="rpkiviews" target="http://www.rpkiviews.org/"> target="https://www.rpkiviews.org">
          <front>
            <title>rpkiviews</title>
            <author fullname="Job Snijders"/>
            <date month="October" year="2024" /> Snijders" initials="J" surname="Snijders"/>
            <date/>
          </front>
        </reference>

      </references>
    </references>

    <section anchor="acknowledgements"> anchor="acknowledgements" numbered="false">
      <name>Acknowledgements</name>
      <t>
        The author wishes to thank
        <contact fullname="Theo Buehler"/>,
        <contact fullname="Claudio Jeker"/>,
        <contact fullname="Alberto Leiva"/>,
        <contact fullname="Tim Bruijnzeels"/>,
        <contact fullname="Ties de Kock"/>,
        <contact fullname="Martin Hoffmann"/>,
        and
        <contact fullname="Mikhail Puzanov"/>
        for their helpful feedback, comments, and implementation work.
        The author wishes to thank
        <contact fullname="Keyur Patel"/>,
        <contact fullname="Meral Shirazipour"/>,
        <contact fullname="Niclas Comstedt "/>,
        <contact fullname="Dan Harkins"/>,
        <contact fullname="Erik Kline"/>,
        <contact fullname="Roman Danyliw"/>,
        and
        <contact fullname="Éric Vyncke"/>
        for their review.
      </t>
    </section>

    <section removeInRFC="true">
      <name>Implementation status</name>
      <t>
        This section records the status of known implementations of the protocol defined by this specification at the time of posting of this Internet-Draft, and is based on a proposal described in RFC 7942.
        The description of implementations in this section is intended to assist the IETF in its decision processes in progressing drafts to RFCs.
        Please note that the listing of any individual implementation here does not imply endorsement by the IETF.
        Furthermore, no effort has been spent to verify the information presented here that was supplied by IETF contributors.
        This is not intended as, and must not be construed to be, a catalog of available implementations or their features.
        Readers are advised to note that other implementations may exist.
      </t>
      <t>
        According to RFC 7942, "this will allow reviewers and working groups to assign due consideration to documents that have the benefit of running code, which may serve as evidence of valuable experimentation and feedback that have made the implemented protocols more mature.
        It is up to the individual working groups to use this information as they see fit".
      </t>

      <ul>
        <li>
          OpenBSD's <xref target="rpki-client"/>
        </li>
        <li>
          Mikhail Puzanov's <xref target="rpki-prover"/>
        </li>
        <li>
          FORT project's <xref target="FORT-validator"/>
        </li>
        <li>
          NLNet Labs' <xref target="Routinator"/>
        </li>
      </ul>
    </section>

  </back>

</rfc>