Internet-Draft Bearer URIs August 2026
Thierry Expires 4 February 2027 [Page]
Workgroup:
Network Working Group
Internet-Draft:
draft-thierry-bearer-uri-00
Published:
Intended Status:
Experimental
Expires:
Author:
P. Thierry
Comonad Dev

Bearer URIs

Abstract

This specification describes several URI schemes to embed bearer tokens as authorization within URIs.

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on 4 February 2027.

Table of Contents

1. Introduction

1.1. Rationale

The research on access control has shown that between the two major paradigms of access control, access control lists (ACLs) are less expressive and usually open the possibility of confused deputy attacks, which include some the most problematic attack surfaces of the Web, like XSS and CSRF (cf. ACLs Don't). The ambient authority inherent to ACLs is also often critical in enabling privilege escalation, making one security flaw vastly more damaging.

The other paradigm, capability-based security, combines designation and permission, making it possible to prevent confused deputy attacks and create new patterns of access control, including composable security policies and safe delegation mechanisms. (cf. Capability Myths Demolished)

HTTP/S URIs could be used as capabilities, but as HTTP/S URIs are not treated as sensitive data by most systems, except for their authorization part (but the classical format login:password has been deprecated since, cf. [RFC3986], section 3.2.1), it opens up the possibility that capabilities would get leaked in various problematic places, including being stored in server logs and shown in browser address bars.

This specification describes URI schemes that make it possible to safely encode capabilities as URIs by combining an existing URI and a bearer token into a URI, called bearer-URI.

1.2. Conventions and Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [BCP14].

1.3. Syntax Notation

This specification uses the Augmented Backus-Naur Form (ABNF) notation of [RFC5234].

2. The bearer schemes

2.1. Principle of operation

When a bearer-URI-aware HTTP agent (like a browser or library) is asked to make an HTTP request to a resource identified by a bearer-http URI (with parameters like the method or the request body), it extracts from that bearer-URI the bearer token and the HTTP URI, and prepare the HTTP request with the given parameters but put the bearer token in the Authorization header with the Bearer authorization scheme: ([RFC6750]):

http.post("bearer-http://AViRTF9ppWiAtdnpVtVHDQ@example.com/foo", body="bar",
  headers={"Content-Type": "text/plain"})

would produce the following HTTP request:

POST /foo HTTP/1.1
Host: example.com
Content-Type: text/plain
Authorization: Bearer AViRTF9ppWiAtdnpVtVHDQ

bar

The URI embedded in an absolute bearer-URI is the same URI with only two transformations:

  • removal of the authority

  • replacement of the scheme

Table 1
Bearer URI scheme Embedded URI scheme
bearer-http http [RFC9110] (see Using bearer tokens without TLS about the security considerations)
bearer-https https [RFC9110]
bearer-ws ws [RFC6455] (see Using bearer tokens without TLS about the security considerations)
bearer-wss wss [RFC6455]

As far as the bearer-URI-aware agent is concerned, the URI of the designated resource MUST NOT be the embedded HTTP URI, but the bearer-URI (the retrieval URI is one source for a base URI).

2.2. Relative URI references

The normal algorithm from [RFC3986] (section 5.2) applies to relative references, which means that except for network-path references with a userinfo component, relative references reuse the same bearer token used to retrieve the resource representation where they appear.

For that reason, the bearer schemes include a dedicated syntax to use a relative path with a different token: bearer-https:NVW9YpUuEkZ367AyA-3MZw@./bar. Note that when such a relative bearer-URI is parsed by a generic URI parser, the whole content after the scheme will match the path-rootless rule of [RFC3986] (and the token won't be parsed by the authority rule).

To make a relative reference with an absolute path, a network-path reference can be used: //D-nX3h-tDq_VtaYQKYYlDw@/baz. If there could be ambiguity whether the base URI is a bearer-URI, it is valid for bearer-URIs to have an empty host, which creates a URI that is equivalent to a network-path reference, but with the scheme specified: bearer-https://D-nX3h-tDq_VtaYQKYYlDw@/baz.

2.3. Definitions

The four URI schemes are specified by the rules

  • bearer-http-uri

  • bearer-https-uri

  • bearer-ws-uri

  • bearer-wss-uri

bearer-http-uri      = "bearer-http" ":" bearer-path [ "?" query ] [ "#" fragment ]
bearer-https-uri     = "bearer-https" ":" bearer-path [ "?" query ] [ "#" fragment ]
bearer-ws-uri        = "bearer-ws" ":" bearer-path [ "?" query ]
bearer-wss-uri       = "bearer-wss" ":" bearer-path [ "?" query ]
bearer-path          = absolute-bearer-path / relative-bearer-path
absolute-bearer-path = "//" token "@" host [ ":" port ] path-abempty
token                = *( unreserved / pct-encoded / sub-delims )
relative-bearer-path = token "@" segment-rel "/" path-rootless
segment-rel          = "." / ".."

The definitions of the following rules are adopted from the generic syntax of URI:

host          = <host, see [RFC3986], Section 3.2.2>
port          = <port, see [RFC3986], Section 3.2.3>
path-abempty  = <path-abempty, see [RFC3986], Section 3.3>
path-rootless = <path-rootless, see [RFC3986], Section 3.3>
unreserved    = <unreserved, see [RFC3986], Section 2.3>
pct-encoded   = <pct-encoded, see [RFC3986], Section 2.1>
sub-delims    = <sub-delims, see [RFC3986], Section 2.2>
query         = <query, see [RFC3986], Section 3.4>
fragment      = <fragment, see [RFC3986], Section 3.5>

If the token component of the bearer-URI is empty, it means that the Authorization header MUST be absent from the request.

If the host component of the bearer-URI is empty, the URI is relative and is valid only if there is a known base URI (cf. [RFC3986], section 5.1). Resolving the relative bearer-URI consists in creating a target bearer-URI where every component is taken from the relative bearer-URI except the host, taken from the base URI.

3. Security Considerations

3.1. Using bearer tokens without TLS

[RFC6750] mandates the use of TLS [RFC9846] because transmitting bearer tokens on an unprotected channel is deemed too risky in the use case of OAuth. But fine grained capabilities have a wider use case than OAuth and may be used between services where security is guaranteed at a different layer, like IPsec [RFC6071] or when services are communicating on a dedicated virtual network (which is typical in some cloud deployments). For this reason, this specification describes the use of bearer tokens both with and without TLS.

Of course, bearer-http URIs SHOULD never be used over an unprotected channel. Doing so would make it possible for an observer anywhere on the path between the client and the server to store and reuse any capability that isn't otherwise limited in its use.

3.2. TODO: POLA

3.3. TODO: revocation

4. IANA Considerations

This specification defines several new URI schemes. Here are the informations for their registration to IANA according to [BCP35].

4.1. bearer-http

Scheme name
bearer-http
Status
Provisional
Applications/protocols that use this scheme name
TBD

4.2. bearer-https

Scheme name
bearer-https
Status
Provisional
Applications/protocols that use this scheme name
TBD

4.3. bearer-ws

Scheme name
bearer-ws
Status
Provisional
Applications/protocols that use this scheme name
TBD

4.4. bearer-wss

Scheme name
bearer-wss
Status
Provisional
Applications/protocols that use this scheme name
TBD

5. Acknowledgements

The idea of a bearer-URI was independently discovered by several people before this specification was imagined and written, and its final form draws a lot of elements from the work of Neil Madden (Towards a standard for bearer token URLs), Ariadne Conill (Demystifying Bearer Capability URIs) and Christine Lemmber-Webber.

The bearcap URI scheme was broader in that it was supposed to embed any URI where a bearer token might be used to create a capability URI. Using dedicated URI schemes to embed HTTP URIs has several desirable properties:

6. References

6.1. Normative References

[BCP14]
Best Current Practice 14, <https://www.rfc-editor.org/info/bcp14>.
At the time of writing, this BCP comprises the following:
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <https://www.rfc-editor.org/info/rfc2119>.
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <https://www.rfc-editor.org/info/rfc8174>.
[BCP35]
Best Current Practice 35, <https://www.rfc-editor.org/info/bcp35>.
At the time of writing, this BCP comprises the following:
Thaler, D., Ed., Hansen, T., and T. Hardie, "Guidelines and Registration Procedures for URI Schemes", BCP 35, RFC 7595, DOI 10.17487/RFC7595, , <https://www.rfc-editor.org/info/rfc7595>.
[RFC5234]
Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, DOI 10.17487/RFC5234, , <https://www.rfc-editor.org/info/rfc5234>.
[RFC6455]
Fette, I. and A. Melnikov, "The WebSocket Protocol", RFC 6455, DOI 10.17487/RFC6455, , <https://www.rfc-editor.org/info/rfc6455>.
[RFC6750]
Jones, M. and D. Hardt, "The OAuth 2.0 Authorization Framework: Bearer Token Usage", RFC 6750, DOI 10.17487/RFC6750, , <https://www.rfc-editor.org/info/rfc6750>.
[RFC9110]
Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, Ed., "HTTP Semantics", STD 97, RFC 9110, DOI 10.17487/RFC9110, , <https://www.rfc-editor.org/info/rfc9110>.
[RFC9846]
Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 9846, DOI 10.17487/RFC9846, , <https://www.rfc-editor.org/info/rfc9846>.

6.2. Informative references

[aclsdont]
Close, T., "ACLs Don't", <https://papers.agoric.com/papers/acls-dont/abstract/>.
[ariadneconill]
Conill, A., "Demystifying Bearer Capability URIs", <https://ariadne.space/2019/10/10/demystifying-bearer-capability-uris.html>.
[capmyths]
Miller, M. S., Yee, K., and J. Shapiro, "Capability Myths Demolished", <https://papers.agoric.com/papers/capability-myths-demolished/abstract/>.
[neilmadden]
Madden, N., "Towards a standard for bearer token URLs", <https://neilmadden.blog/2021/03/20/towards-a-standard-for-bearer-token-urls/>.
[RFC3986]
Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10.17487/RFC3986, , <https://www.rfc-editor.org/info/rfc3986>.
[RFC6071]
Frankel, S. and S. Krishnan, "IP Security (IPsec) and Internet Key Exchange (IKE) Document Roadmap", RFC 6071, DOI 10.17487/RFC6071, , <https://www.rfc-editor.org/info/rfc6071>.
[xkcd]
Munroe, R., "Password Strength", <https://xkcd.com/936/>.

Author's Address

Pierre Thierry
Comonad Dev