My understanding is that if it is a malfunction, broken parts, and not intentional it is not illegal. If you alter a gun to fire more than once with a single pull of trigger it is illegal. However, believe it or not, the BATF is not normally that interested in going after guns that double (fire two shots).
The gun is broken and not illegal. I have had people tell me they had .22's semi-autos that went full auto. Many handguns will when the disconnector wears out.
A gunsmith can repair these without a letter of permission or any other hassle.