Many services still restrict the special characters allowed in passwords and similar with the argument that it prevents injection attacks. Now, there are many good arguments against this such as avoiding unnecessary obstructions, character choice increasing the security of chosen passwords, and so on. Here, I am only interested in the following argument:
Any system that checks whether a password conforms with character restrictions is potentially subject to injection attacks itself. If you do not understand your system well enough to prevent code injection, this is a potential security hole. Therefore you cannot rely on restricting special characters to fully prevent injection attacks. (Mind the fully: Obviously, injection attacks after the special-character filter are prevented.)
A variant of this argument comparing character restriction and input sanitization would be:
Whether you apply sanitization or character restriction to user input, it should be the very first thing you do. Both of these mechanisms are possibly subject to code injection themselves, but if you do not understand your system well enough to make these systems safe from code injection, you can also not say which one is better. Therefore, there is no reason to prefer character restriction over sanitisation. (Since this is about vulnerabilities in the mechanism and not imperfection of its result, applying both yields no benefit.)
Are these arguments valid or is there something I am missing?