by TekMol · 7y ago · 0 comments
<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.
https://developer.mozilla.org/en-US/docs/Web/Security/Subres...
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.
Also my comment above is not an endorsement of the methodology, it’s just a thing that happened.
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.
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?