I am having a hard time to find where it is documented that the source port should be random and in the range 1024-65535.
In which RFC is this documented?
Edit:
First reference for privileged ports is in RFC2623
It seems that this is depending more on the TCP/IP implementation and it is a de-facto standard.
IANA is assigning the port numbers (RFC1700)
You are probably looking for RFC 6056 - Recommendations for Transport-Protocol Port Randomization ("Best Current Practice").
Technically there is no requirement that the ephemeral port be >1024 or random (you could build a system that always initiates connections from port 12 because you like the number 12), it's just not "normal" to do so (and an awful idea for a bunch of reasons, some of which are described in that RFC).
The RFC 6335 is explaining this:
The reserved ports:
The introduction explains the confusion:
It seems that Windows XP is not following RFC6335, but Solaris 10 does.
What voretaq7 said along with this but being pedantic there is a technical requirement. Historically daemons/servers in *nix are running on ports < 1024 (calling them system ports) thus in order to avoid conflict, source ports (User ports) are > 1024 (or to be precise 1024 - 49151) However that is not always the case as you say and it depends on the implementation. All in all the above link gives a list of RFC's but probably the most specific one is RFC5226 which describes the "Expert Review" process of IANA.