One of my personal pet peeves is websites that use an e-mail parser on the client side which allows a + in e-mail addresses, and then use some other parser somewhere in their chain of things that happen on the back end that does not.
Everything fails silently, accounts are created I don't have access to, and it generally just sucks.
I’m hopeful someone on here could point me to a solution.
thrums.shrimps.0m@icloud.com if you do not want to share publicly
More likely because Windows has historically used \ rather than the / that's standard in Unixish systems. Windows people are used to typing \, so it's indeed somewhat helpful for the browser to accept either (e.g., in file:// URLs).
What should be instead is an absolutely clear serialization format into a byte string of ANY data structure that must processed by two different programs.
Parsers are programs, they should "parse" bytes, not strings, like we humans do.
For parsing proper, `bison --xml` is useful if you're allergic to code-generation. I don't have an equivalent for lexing.
I disagree. Hindsight is 20/20, it's now obvious to me that using two different parsers for the same thing in a single process can cause bugs, but it didn't occur to me before reading about it.
Now that I'm aware of this, in particular, I'll be extra careful not to parse something manually if something already does it in whatever I'm working on and there's an API for it.
URLs and paths are the canonical (ah!) example of this: it's tempting to just take the string and split by "/". Whoever who has never done this should throw the first stone.
And people who have never written any parser may not clearly see this stuff.
For a sufficiently large project it's not always obvious that another implementation of something exists. And it's not always easy to search for a concept. You might use different words for it than the other person that implemented it.
And even if you find it, it might have a weird badly thought out API and similar implementation, making it likely people reimplement it anyway.
They are called parser differentials
But this is not about injection. This is about parsing mismatch, when you use different parsers that produce different results for the same thing. The article is about URLs, curl's author has a good article on this too and this is the (biggest?) motivation behind providing an URL parsing API in libcurl.
https://daniel.haxx.se/blog/2022/01/10/dont-mix-url-parsers/
(and that's ignoring extensions)
Postgres is sanest but even it casefolds in the wrong direction.
I'd say that it's the only one that casefolds on the right direction.
We don't need to keep using the upper-case only idioms from the 80's. We can have legible text nowadays. (And yes, it's non-standard, but there are plenty of things that are best done by ignoring the SQL standard.)