The question is about the standard, so I think the answer given to this question applies to yours too:
The standard is not always as coherent as we would like, since it is
a very large document, written (in practice) by a number of different
people, and despite all of the proof-reading that does occur.
As the same answer suggests, it's hard to say what is ill-formed.
My understanding is that the standard is simply not explicit about that, but there are other language features (as demonstrated by example by datenwolf) that imply it is not ill-formed, whatever it means:
the simple fact that STDIN and STDOUT are file handles means they can be opened and read/written in binary mode.