TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Firefox 90 supports Fetch Metadata Request Headers

260 点作者 ykat7将近 4 年前

13 条评论

jefftk将近 4 年前
Very happy to see this landing in Firefox!<p>For the people wondering what the motivation is, <a href="https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;fetch-metadata&#x2F;#intro" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;fetch-metadata&#x2F;#intro</a> has a good summary:<p><i>Interesting web applications generally end up with a large number of web-exposed endpoints that might reveal sensitive data about a user, or take action on a user’s behalf. Since users&#x27; browsers can be easily convinced to make requests to those endpoints, and to include the users&#x27; ambient credentials (cookies, privileged position on an intranet, etc), applications need to be very careful about the way those endpoints work in order to avoid abuse.</i><p><i>Being careful turns out to be hard in some cases (&quot;simple&quot; CSRF), and practically impossible in others (cross-site search, timing attacks, etc). The latter category includes timing attacks based on the server-side processing necessary to generate certain responses, and length measurements (both via web-facing timing attacks and passive network attackers).</i><p><i>It would be helpful if servers could make more intelligent decisions about whether or not to respond to a given request based on the way that it’s made in order to mitigate the latter category. For example, it seems pretty unlikely that a &quot;Transfer all my money&quot; endpoint on a bank’s server would expect to be referenced from an img tag, and likewise unlikely that evil.com is going to be making any legitimate requests whatsoever. Ideally, the server could reject these requests a priori rather than delivering them to the application backend.</i><p><i>Here, we describe a mechanism by which user agents can enable this kind of decision-making by adding additional context to outgoing requests. By delivering metadata to a server in a set of fetch metadata headers, we enable applications to quickly reject requests based on testing a set of preconditions. That work can even be lifted up above the application layer (to reverse proxies, CDNs, etc) if desired.</i>
anonymfus将近 4 年前
Does that mean that the quest of finding a working direct link to the image&#x2F;video will soon become impossible?
评论 #27809849 未加载
评论 #27810411 未加载
评论 #27814163 未加载
wronex将近 4 年前
How is this different from the origin header? Does the origin header not tell the webbserver if the requested originated from the same website? Is the origin header flawed in some way?
评论 #27809550 未加载
评论 #27809476 未加载
评论 #27814574 未加载
评论 #27814197 未加载
ec109685将近 4 年前
This is FUD:<p>&gt; Hence the banking server or generally web application servers will most likely simply execute any action received and allow the attack to launch.<p>While these are useful headers, there are protections today via XSRF tokens to prevent these attacks that all major sites implement, so it isn’t likely your bank is vulnerable.
评论 #27813067 未加载
ajb将近 4 年前
The original CORS protection is enforced by the browser, not the server. That means that it is much harder for it to cause a privacy problem. Given that this only works if you are using a browser anyway (any other user agent can spoof all this) I don&#x27;t see how there can be any security gain from the server doing the enforcement. Which leaves me wondering whether the increased flexibility is worth the potential privacy issue.
评论 #27815059 未加载
gentleman11将近 4 年前
Pardon my ignorance. I thought the way to deal with csrf was csrf tokens. It seems like you would still have to ignore the headers and rely on the token in your logic if ever they disagreed. I’m not sure how to use these new headers
评论 #27813155 未加载
amluto将近 4 年前
I’m quite surprised that Sec-Fetch-Dest doesn’t have a “form” type for form submissions, and the spec makes almost no mention of forms. Does this spec finally allow a simple header check to squash CSRF form posts or not?
mousepilot将近 4 年前
For me, recent firefox releases have been MISERABLE. I guess it could just be my computers but the browser constantly locks, no performance whatsoever, and just no help on troubleshooting anywhere.<p>I went with the long term support releases and have had a better experience. Course, still no sound lol but I use Chrome when I want sound. I still like Firefox, just can&#x27;t use recent releases.
rob-olmos将近 4 年前
Some example code on how to use these headers to allow&#x2F;reject requests:<p><a href="https:&#x2F;&#x2F;web.dev&#x2F;fetch-metadata&#x2F;#step-5:-reject-all-other-requests-that-are-cross-site-and-not-navigational" rel="nofollow">https:&#x2F;&#x2F;web.dev&#x2F;fetch-metadata&#x2F;#step-5:-reject-all-other-req...</a>
TazeTSchnitzel将近 4 年前
Does this essentially solve XSRF? Would it no longer be necessary to use XSRF tokens?
评论 #27811342 未加载
评论 #27811583 未加载
评论 #27814208 未加载
barbazoo将近 4 年前
In the example, couldn&#x27;t the call from attacker.com to banking.com be thwarted by CORS headers defined by the server?
评论 #27811546 未加载
AtNightWeCode将近 4 年前
So basically CORS headers that works as expected. Excellent.
forgotmypw17将近 4 年前
Is there anything Mozilla&#x2F;Firefox has done in the past 10 years that at least CAN BE ARGUED is for the improvement of the user&#x27;s experience?<p>I&#x27;ve been following their work pretty closely, but I&#x27;m at a loss trying to think of anything...
评论 #27815505 未加载
评论 #27815486 未加载