Why does Firefox not always send the HTTP Origin header for POST requests?

后端 未结 2 1272
旧巷少年郎
旧巷少年郎 2021-01-01 19:23

I\'m exploring the idea of HTTP Origin checks as CSRF protection for Drupal at https://www.drupal.org/node/1803712

Now I was testing how the Origin header arrives wi

相关标签:
2条回答
  • 2021-01-01 20:12

    Is isn't implemented yet. There's a discussion here: https://bugzilla.mozilla.org/show_bug.cgi?id=446344

    0 讨论(0)
  • 2021-01-01 20:13

    The default on Firefox is not to send HTTP_ORIGIN.

    The reason is a bug that causes hangs on some mobile Firefox versions if the network.http.sendOriginHeader configuration variable (accessible via about:config) is enabled. (For details see https://developer.mozilla.org/en-US/Firefox/Experimental_features#Security and the link provided by Marco's comment https://bugzilla.mozilla.org/show_bug.cgi?id=446344.)

    There is a proposal to enable FF sending HTTP_ORIGIN by default, but the TODO list is long (see https://bugzilla.mozilla.org/show_bug.cgi?id=1424076). So it will probably take years until FF will generally send HTTP_ORIGIN even without Javascript code enabling CSRF.

    Some FOSS OSes preconfigure their FF ports to send HTTP_ORIGIN by default. BTW, MS Edge also does not send HTTP_ORIGIN without explicitly enabling CSRF using Javascript.

    For this reason I have implemented a security setting of my site which enables the users to disallow POST transactions from browsers that do not provide HTTP_ORIGIN.

    0 讨论(0)
提交回复
热议问题