News for hackers. Stuff that matters.
Re:Issue 914451: Autofill does not respect autocomplete="off" by TekMol on Sunday October 13, 2019 @03:20AM (#21238943)
I guess this will lead to a horrible coding style where instead of having this in the form:

    <input name="email">
We will see stuff like this:

    <input name="16fkr9547kancot944128sddfksdf934998aafccugt75">
Where developers use some type of abstraction that generates a random id for each field and then assigns it to the original value server side or in javascript.

Just like they already randomise asset filenames to avoid caching.

Re:Issue 914451: Autofill does not respect autocomplete="off" by wiredfool on Sunday October 13, 2019 @03:30AM (#21238989)
I’m doing this with a field where I provide server side autocomplete of an item. It sucks, but I can’t find a better workaround.
Re:Issue 914451: Autofill does not respect autocomplete="off" by masklinn on Sunday October 13, 2019 @06:17AM (#21239590)
MDN literally mentions jquery.disableAutoFill which basically does that for you under the cover (scrambling the name on display, and unscrambling on submission).
Re:Issue 914451: Autofill does not respect autocomplete="off" by StavrosK on Sunday October 13, 2019 @04:07AM (#21239152)
Your comment about randomizing filenames got me thinking. It would be great if we could add a cache key to the HTML element, that way we could cache everything forever with the same filenames and still invalidate things by just making the key being the SHA of the deploy. Too bad that's not a thing.
Re:Issue 914451: Autofill does not respect autocomplete="off" by jstanley on Sunday October 13, 2019 @04:13AM (#21239176)
Re:Issue 914451: Autofill does not respect autocomplete="off" by StavrosK on Sunday October 13, 2019 @04:42AM (#21239266)
Subresource integrity is for ensuring that you got the right file (it fails if you didn't), it doesn't do anything with the cache, unfortunately.
Re:Issue 914451: Autofill does not respect autocomplete="off" by jstanley on Sunday October 13, 2019 @05:18AM (#21239382)
Really?

Seems like it would be crazy not to use it for caching.

Re:Issue 914451: Autofill does not respect autocomplete="off" by summm on Sunday October 13, 2019 @06:21AM (#21239605)
The problems are 1) side channels. Caching those would mean that a malicious script could use timing to find out if the user accessed specific other websites. Also it enables a channel for cross-domain communication. 2) malicious user tracking would not work as well anymore, which would be good but Google probably will not support that. Currently they get all those nice http log entries from sites that only include fonts etc.
Re:Issue 914451: Autofill does not respect autocomplete="off" by Natanael_L on Sunday October 13, 2019 @09:29AM (#21240246)
For sensitive files with known names, you should be able to set that the cache is only valid for requests from the same host website (as the server might decide to send another response when the host is different). That would fix the sidechannel.
Re:Issue 914451: Autofill does not respect autocomplete="off" by ProfSarkov on Sunday October 13, 2019 @03:56AM (#21239114)
It's like Internet Explorer 6 all over again. SAD.
Re:Issue 914451: Autofill does not respect autocomplete="off" by donatj on Sunday October 13, 2019 @03:50AM (#21239080)
lol, years and years ago (like 2005) as an attempt at stopping XSS and CSRF attacks and bots I came up with a system that named all the inputs a salted MD5 of the intended name with the salt randomly generated then stored in the users server side session.

It’s still a reasonably effective solution for CSRF, though there are much simpler options, but today’s bots largely have cookie jars so you will likely need a CAPTCHA.

Re:Issue 914451: Autofill does not respect autocomplete="off" by Thorrez on Sunday October 13, 2019 @04:00AM (#21239130)
How would it stop XSS? Is it meant to stop attackers from getting JS execution on your site, or to mitigate the attackers' abilities after they have JS execution? I don't see how it would do either.
Re:Issue 914451: Autofill does not respect autocomplete="off" by donatj on Sunday October 13, 2019 @04:53AM (#21239303)
I mean both CSRF and XSS. If your inputs are named something different on everyone’s machine, per session, you can only XSS yourself. Not very useful, you can already do in many other ways.

Also my comment above is not an endorsement of the methodology, it’s just a thing that happened.

Re:Issue 914451: Autofill does not respect autocomplete="off" by Thorrez on Sunday October 13, 2019 @02:29PM (#21241948)
Why can you only XSS yourself? If an attacker has javascript execution on the website, the javascript can identify forms not just via their names, but by relation to other elements in the DOM tree. The javascript can for example do

document.querySelector("form > input");

That doesn't rely on names at all. Just like a human can use eyes to find the right input, the javascript can use the DOM tree to find the right input.

I understand that it provides CSRF protection. It's basically a CSRF token embedded in the name.

Re:Issue 914451: Autofill does not respect autocomplete="off" by donatj on Tuesday October 15, 2019 @03:22AM (#21256264)
You misunderstand. Specifically on sites without cross-user visible content, the JavaScript needs to get into the system via an input, POST or GET. When every user input is named something different, you have no ability to send a link with a JavaScript payload.
Re:Issue 914451: Autofill does not respect autocomplete="off" by Thorrez on Tuesday October 15, 2019 @10:22PM (#21266447)
Hmm, I guess it could provide some protection against some types of XSS, but it's not comprehensive. It doesn't provide any protection against stored XSS. And even for reflected XSS, it assumes the only dynamic thing in your URL is form inputs.

An example of something dynamic in your URL that's not a form input would be links to various articles posted through some type of CMS. For example http://example.com/article?id=foo or even http://example.com/article/foo . In both cases if foo doesn't exist, a badly-written error page could print out "Error, foo was not found" without escaping foo.

Re:Issue 914451: Autofill does not respect autocomplete="off" by justicz on Sunday October 13, 2019 @04:14AM (#21239178)
Maybe they mean CSRF? Then things make more sense since you can’t guess the field names cross-origin.
Re:Issue 914451: Autofill does not respect autocomplete="off" by xg15 on Sunday October 13, 2019 @04:24AM (#21239220)
> Just like they already randomise asset filenames to avoid caching.

But why? Isn't the whole point of caching to improve delivery if static assets?

Did they run into staleness problems? Then why not use if-modified-since/if-none-match?

Re:Issue 914451: Autofill does not respect autocomplete="off" by noselasd on Sunday October 13, 2019 @04:32AM (#21239239)
You are assuming browsers(there are many more than chrome&ff) ,proxies, etc. do caching correctly.
Re:Issue 914451: Autofill does not respect autocomplete="off" by summm on Sunday October 13, 2019 @06:25AM (#21239612)
And you are assuming web devs could configure their servers properly. Anyway, it all boils down to the mentality of lowest common denominator: using that workaround, nobody has any incentive to fix their proxy.
Re:Issue 914451: Autofill does not respect autocomplete="off" by mxxx on Monday October 14, 2019 @06:21PM (#21253502)
Yep. We recently noticed this problem after renaming form fields for the purpose of accessibility (screen readers)