Internet-Draft HttpOnlyPrefix February 2025
Weiss Expires 29 August 2025 [Page]
Workgroup:
Network Working Group
Internet-Draft:
draft-httponlyprefix-weiss-http-latest
Published:
Intended Status:
Informational
Expires:
Author:
Y. Weiss
Shopify

HttpOnly cookie prefix

Abstract

This draft introduces the __HttpOnly and __HttpOnlyHost cookie name prefixes that ensure the cookie was set with an HttpOnly attribute.

About This Document

This note is to be removed before publishing as an RFC.

The latest revision of this draft can be found at https://yoavweiss.github.io/httponly_prefix/draft-httponlyprefix-weiss-http.html. Status information for this document may be found at https://datatracker.ietf.org/doc/draft-httponlyprefix-weiss-http/.

Source for this draft and an issue tracker can be found at https://github.com/yoavweiss/httponly_prefix.

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 29 August 2025.

Table of Contents

1. Introduction

There are cases where it's important to distinguish on the server side between cookies [COOKIES] that were set by the server and ones that were set by the client.

One such case is cookies that are normally always set by the server, unless some unexpected code (an XSS exploit, a malicious extension, a commit from a confused developer, etc.) happens to set them on the client.

This draft add a signal that would enable servers to make such a distinction.

More specifically, it defines the __HttpOnly and __HttpOnlyHost prefixes, that make sure that a cookie is not set on the client side using script.

1.1. Conventions and Definitions

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 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

2. Server Requirements

These requirements apply to cookies set in Set-Cookie response headers by the server, as well as ones received in a Cookie request header from the client.

3. User Agent Requirements

These requirements apply to cookies received in a Set-Cookie response header from the server.

4. Security Considerations

There are no particular security considerations. These new prefixes will only limit the ability of non-compliant cookies to be set. They do not open up new capabilities for server to set cookies where they previously could not.

5. IANA Considerations

This document has no IANA actions.

6. Normative References

[COOKIES]
"Cookies HTTP State Management Mechanism", , <https://datatracker.ietf.org/doc/draft-ietf-httpbis-rfc6265bis/>.
[RFC2119]
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/rfc/rfc2119>.
[RFC8174]
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/rfc/rfc8174>.

Acknowledgments

TODO acknowledge.

Author's Address

Yoav Weiss
Shopify