101 points · by oftenwrong · 6y ago · 73 comments
On the other hand, our Maps still worked on all 5 Blackberries that people were still using.
Edit: Thank you, though, for your effort. I'm not sure if it still works, but I did use the Google Maps client for some time, loaded one .cod file at a time...
-- written from my Bold 9900
It was really annoying.
Google APIs have always been some of the worst.
It honestly felt like ever time I had to use the maps API for a client, you'd changed the whole thing.
As I recall, the cap on redirects was 10, and then Darin (who had previously worked on Firefox) was like "no, you have to allow up to 30 or you break the New York Times". And so, it was upped to to 30. Intuitively I'd think a site that redirected you 10 times was broken, but I guess someone built one that needed more.
PS: Looking online now to confirm my facts, I see one claim that both Chrome and FF limit redirects to 20. So either my memory exaggerated it as 30 or they both managed to lower the limit at some point.
We never let economics solve this problem, because nobody pays for web browsers with money. If there was a $10 "sorry, The New York Times violates standards so we don't support it" and a $100 "we'll work around any bug large or small to make it work for our customer" browser sites would be spending money to let the $10-browser-owners see their ads. But, every browser is run as a charity, so nobody gets to pay the actual costs of the workarounds (except maybe in terms of more security vulnerabilities, higher RAM usage, etc.)
I'm not saying this is good or bad, it's just how it is. Browsers are free and will be blacklisted by sites that don't like how they behave. So the incentive for browsers is to do what the sites want, rather than to strictly conform to standards. Shrug.
nytimes.com > https://nytimes.com
https://nytimes.com > https://www.nytimes.com
And from there, who knows. Some websites append a trailing slash; sometimes they removed it. Some websites send you to /index.php or /home.aspx rather than sitting in the root.Subpages may use a redirect to update a slug if there's been a title change. Or maybe the website just moved to a new format altogether and is updating old links.
I have seen examples of 4 or 5 legitimate redirects to send users to the correct place. I'm having trouble coming up with 10 possible reasons, though.
This goes counter to the robustness principle: Be conservative in what you do, be liberal in what you accept from others (https://en.wikipedia.org/wiki/Robustness_principle).
Strictly failing is a good thing, generally. Accepting arbitrary query parameters is pretty much a de facto exception though
So there is a tradeoff between strict validation and allowing future expansion and upgrades. By all means strictly validate the parameters you need, but maybe don't reject parameters you don't recognise.
[1]: https://oauth.net/2/pkce/ [2]: https://tools.ietf.org/html/draft-ietf-oauth-security-topics... [3]: https://tools.ietf.org/html/rfc6749#page-19
TLS 1.2 has a field for the protocol version during negotiation. The spec says that you're supposed to proceed with the lower version if the other party claims a version higher than yours.
Turns out in practice that some implementations just decided to give up instead. This meant that it wasn't possible to increase the version number for TLS 1.3, because advertising it would break a lot of people's connectivity. Instead, TLS 1.3 uses the 1.2 version, and added ANOTHER field containing the real version.
So Google introduced GREASE in RFC 8701. Long story short, Chrome now advertises a bunch of bogus extension values, thus making sure that implementations can't simply ignore unknown values.
This makes it a lot more likely that future cipher additions will not break older clients, which is pretty damn important for something as critical as TLS.
Of course, this often comes up in collaborative coding exercises (work, open source), so seeing a discussion on the topic would be helpful.
Anyone have a link to such a discussion?
Firstly you want to have a clear distinction between "Things that it's fine to just ignore because you don't understand them" and "Things that if you don't understand them that means you're screwed, abort". For example in PNG some of the bitflags cunningly concealed in the capitalisation of the extension chunk names indicate whether it's OK to just ignore the chunk if you don't understand it, and whether it's OK to just copy this chunk across into a modified image without understanding it. In X.509 there's a bitflag that means "If you don't understand this part of the certificate then you mustn't rely on the certificate at all".
Then you need a way for people to agree on how to allocate the extensions. The IETF has an impressive array of different mechanisms available, from "You need to actually write and publish a Standards Track document" to "First Come First Served" which suit different purposes. Consider just copying some or all of them. https://tools.ietf.org/html/rfc8126
TLS had big problems with (non-)interoperability and as a security feature couldn't just shrug and put up with never moving forward so it had to endure painful upgrades each time. This time they got GREASE (RFC 8701) to try to stop this ever happening again. Basically they agree how to extend things, then, reserve some of the extension namespace and routinely shove crap into it on purpose. Things that properly understand how extensions work will go "Eh, I don't understand this" and ignore the crap. Everything else explodes, and you catch the explosions early because they happen everywhere all the time with all the GREASE you're using.
GREASing new features has become a go-to strategy and you should consider this too. For example Encrypted Client Hello (the current iteration of ESNI) is intended to be used for all connections. Basically every server you talk to, you always say "Also here's an encrypted hello". Maybe the server can read it and the plaintext hello was just a dummy - maybe it just reads the plaintext hello, an eavesdropper can't tell. So if they want to block encrypted hello, they have to block everything, even though probably very few servers will offer this feature at first.
edit: I don't think considering the principle as bad is a sensible approach as it doesn't mean to ignore errors in theory.
You don't have to imagine it, this actually happened. I don't remember the details, but back in the HTML 4 era, there was XHTML, and if you gave it an XML media type, many browsers would parse it as XML and reject the entire document if there was any error (and display nothing at all but an error message).
There were a number of articles and blog posts about this back in the day.
https://tools.ietf.org/id/draft-iab-protocol-maintenance-04....
(Shame this draft just expired before being finalised.)
Nowadays the w3c and es committees work hard to try and ensure no ambiguity is left in the spec, and have tests available early on, and do interop comparisons between engines to see if there’s anything missed.
Like if twitter adds these s=NN parameters, that means you can't use an s=NN parameter for your own purposes.
Of course, it all comes with the problem of needing to define up-front which query parameters your app accepts. Easy in a small app, wildly impractical in a large one with plenty of legacy code.
For a web page it might be a mistake. For an API it's often not a mistake, depending on the utility of the API. eg analytics reporting.
For a vague parameter like "s", my bet it's probably due to bad code rather than intentionally added. eg. someone constructs a URL but forgets to escape the components, and later (or downstream) some other programmer decides to "fix" it by using encodeuri (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...), which "works", but mangles the url
I'm not really sure why we'd want a world where the server doesn't know about all query args, but seems like we're already stuck with this.
E.g. I don’t want anyone’s campaign tracking tokens in the referer of our outbound links, or in URLs being shared around by copy-paste from the address bar.
However I also don’t want to inadvertently create a mechanism for someone to mechanically enumerate our routes (which we already see routinely attempted via return-path parameters), or walk into any similar trap besides.
Forgetting to update this ended up be a common source of bugs.
Probably, your service doesn’t have any ‘utm_*’-parameters not intended but I could see ‘fbcid’ being used for other ids than just Facebook clients and ‘s’ is so generic that it must clash with thousands of services!
https://en.wikipedia.org/wiki/Robustness_principle
That said, query parameters on a GET are one thing, but unexpected arguments on CLIs are another, especially when the command can change/delete files, so I can see both sides of this.
Some people want strict requirements, but "whatever works for the end-user" usually wins.
...and as a result, we got monstrosities like user agent strings. But that's something we need to deal with I guess
> In general, any laxness in actual implementations of a system can create a similar spiral of de facto requirements.
Those "de facto requirements" mean that writing something simple becomes inordinately complex because noone fixes broken clients. And you can't test changes because you don't have access to these broken clients.
It also leads to nasty bugs. For example, if you ignore extra parameters and provide defaults for others, now a misspelled parameter will silently fail.
The best example is how hard it is to write a browser. The standards are very complex, but it's magnified by the complexity of supporting "real," namely broken, HTML and CSS. That's contributing to the browser mono-culture.
https://github.com/greatsuspender/thegreatsuspender/issues/5...