It's currently codified in USC 50 (the same thing which says "deadly force authorized") and goes like this
The wording is somewhat clear any person, which means it also applies to Civilians, not just military personnel...Any person who in time of war is found lurking as a spy or acting as a spy in or about any place, vessel or aircraft, within the control or jurisdiction of any of the armed forces of the United States, or in or about any shipyard, any manufacturing or industrial plant, or any other place or institution engaged in work in aid of the prosecution of the war by the United States, or elsewhere, shall be tried by a general court-martial or by a military commission and on conviction shall be punished by death.
Hmmm...