Request Header Originated With
draft-request-header-originated-with-00

Document Type Active Internet-Draft (individual)
Last updated 2018-12-20
Stream (None)
Intended RFC status (None)
Formats plain text pdf xml html bibtex
Stream Stream state (No stream defined)
Consensus Boilerplate Unknown
RFC Editor Note (None)
IESG IESG state I-D Exists
Telechat date
Responsible AD (None)
Send notices to (None)
httpbis                                                        N. Riffat
Internet-Draft                                         December 20, 2018
Intended status: Standards Track
Expires: June 23, 2019

                     Request Header Originated With
                draft-request-header-originated-with-00

Abstract

   This document proposes a new Request Header that must be initiated
   every time a user-agent sends XMLHttpRequest.  The aim of this header
   is to limit the possibilities of XSS to RCE and preventing Javascript
   from stealing CSRF tokens on other URLs of same domain.  This will
   allow developers to block request if it wasn't supposed to be sent
   via XMLHttpRequest.

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 June 23, 2019.

Copyright Notice

   Copyright (c) 2018 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of

Riffat                    Expires June 23, 2019                 [Page 1]
Internet-Draft       Request Header Originated With        December 2018

   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Limitations . . . . . . . . . . . . . . . . . . . . . . .   2
     1.2.  Goals . . . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.3.  Examples  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .   5
   3.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   5
   4.  Security Considerations . . . . . . . . . . . . . . . . . . .   5
   5.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   5
     5.1.  Normative References  . . . . . . . . . . . . . . . . . .   5
     5.2.  Informative References  . . . . . . . . . . . . . . . . .   5
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   5

1.  Introduction

   Request header is the base on which the server determines what data
   should be delivered to the user agent.  Any request header can be
   initiated or manipulated by Javascript except the forbidden ones i.e.
   Origin, Cookie, Access-Control-Request-Headers etc.

   The proposed header is similar to "X-Requested-With" header which is
   initiated every time during an Ajax call by jQuery but it can be
   controlled and tampered using Javascript.  While the proposed header
   should be a forbidden header just like Origin, Cookie etc so it
   doesn't get manipulated using Javascript.

1.1.  Limitations

   This idea to limit the impact of XSS will not be effective if the
   request is naturally supposed to be sent via XMLHttpRequest i.e. JSON
   APIs

1.2.  Goals

   The proposed request header can provide an extra defensive measure to
   limit the impact of XSS including followings.

   1.  Will limit the impact of XSS on the vulnerable URL only.

   2.  Kill or reduce the possibility of XSS that can lead to RCE in
       some cases i.e. Wordpress.

Riffat                    Expires June 23, 2019                 [Page 2]
Internet-Draft       Request Header Originated With        December 2018

   3.  It will not impact any of current user-agent or server side
       functionality and will be totally be dependent upon developers if
       they want to implement this new technique.

   4.  Allow developers to check either the request was originated via
       XMHttpRequest or standard HTTP.

1.3.  Examples

   Since Wordpress is the most popular CMS around so it has been
   impacted a lot in terms of XSS to RCE.  So following example is based
   on recent Wordpress XSS to RCE attacks and how the proposed header
   could prevent this.  Wordpress is a secured CMS by itself but it is
   incomplete without custom scripts i.e. plugins and themes and it is
Show full document text