The loophole in the 5th amendment to the U.S. Constitution is worse than that. It is wide enough to fly an entire fleet of drones through, in formation.
Firstly, there is no mention of citizenship. Secondly, the loophole covers any land force, sea force, or militia, and the service can be in any time of war (not necessarily currently engaged in battle) or any time of public danger. There is no mention of loyalty to the U.S. as enemy or ally.
Obviously, the intent of the loophole was to address the question "How can we possibly fight a war if 23 people have to hear evidence before every musket ball flies?" But thanks to poor bounds checking, the protection against arbitrary extrajudicial executions is severely weakened.
By a malicious reading of the amendment, I could argue that, by the tenets of Islam, every Muslim is a member of the militia, and that every member is called upon to wage war upon the unfaithful, heretics, and apostates. That is, they would all be "Militia, when in actual service in time of War or public danger." They don't even need to be at war against the U.S. The loophole does not specify.
It would seem that the source code for U.S. Government should be updated, and a patch released.