One way to get the sources is to download the JBoss AS source and then build it. One of the first things done by the build is to download all of the external libraries into the thirdparty directory. For the libraries other JBoss projects the build usually also downloads a source JAR file. Juts unpack the source JAR.
I was looking at the 5.x source when I replied (I don't seem to have a 4.2.3 source build on this system), so I figured I better verify this for 4.2.3. On that release, the EJB3 sources are in the JBoss AS source download in the ejb3 directory.