The core of the problem, as I see it, is that congress is full of pansies who don't want to define the dead zone area that exists.
If war is declared, the people caught on the battlefield are POWs.
If they are individuals inside of our borders, they get the rights our Constitution demands and are criminals.
Terrorists aren't fighting us because they are aligned with a country. They are fighting us because they are aligned with an ideal. In our borders, the Constitution gives them rights.
Outside our borders?
What defines a "battlefield"?
What is "terrorism"?
What defines a "war"? After all, Vietnam was not a war under our Constitution because Congress never declared it, but was a "military action." And the people captured were covered by the Geneva Convention.
This is a gray area that, if defined, the "LEGAL" problem would "go away."