Here's a big problem with secret spying programs in the US: To dismantle them with a lawsuit, someone has to prove that their privacy rights were infringed. And that proof is almost always a secret.

That's the Catch-22 that an appeals court served up Friday to plaintiffs who for the last two years have been attacking the NSA's metadata collection program authorized under section 215 of the Patriot Act. The plaintiffs are led by constitutional lawyer and conservative activist Larry Klayman, who had sued the Obama administration for violating his fourth amendment privacy rights. In 2013, a lower court granted his request for an injunction to stop the NSA's spying on his data. But the Obama administration appealed that ruling, and an appellate court has now thrown out that injunction based on a familiar and vexing problem for those who sue the government's secret spying apparatus: The plaintiffs couldn't sufficiently prove that the NSA secretly spied on them.

"In order to establish his standing to sue, a plaintiff must show he has suffered a 'concrete and particularized' injury," wrote judge Janice Rogers Brown in her opinion. "In other words, plaintiffs here must show their own metadata was collected by the government...the facts marshaled by plaintiffs do not fully establish that their own metadata was ever collected."

'The problem is that you can’t get a court to answer the question of whether a government’s activities are illegal until you prove something that the government won’t allow you to prove.'

Klayman first launched his lawsuit, after all, in the wake of Edward Snowden's revelations that the NSA had interpreted the Patriot Act to allow the collection of any American's metadata.

But Judge Brown pointed out, for instance, that Snowden had leaked a document showing that the NSA was collecting metadata from all users of Verizon's Business Network Services—not Verizon Wireless, of which Klayman was a customer. Though the NSA has since claimed that virtually every wireless carrier was fair game for that domestic spying program, Brown argued Klayman's inability to prove his communications were included in that spying still removed his grounds for an injunction.

In fact, Klayman's quandary—how to prove you were the subject of secret spying when that spying is, well, secret—is one that's long represented a hurdle to anyone challenging the legality of the NSA's intelligence programs. "This case is the example of the Kafkaesque nightmare that plaintiffs trying to challenge unlawful surveillance find themselves in," says Alan Butler, an attorney with the Electronic Privacy Information Center. "The problem of blanket government secrecy is that you can’t get a court to answer the question of whether a government’s activities are illegal until you prove something that the government won’t allow you to prove."

One judge in Friday's appellate ruling went so far as to defend the NSA's right not to reveal whether a plaintiff had actually been spied on or not. "Plaintiffs complain that the government should not be allowed to avoid liability simply by keeping the material classified," wrote Stephen Williams. "But the government’s silence regarding the scope of bulk collection is a feature of the program, not a bug."

That "standing" requirement, that surveillance plaintiffs must prove that the government specifically spied on them, even has a recent stamp of approval from the Supreme Court. In 2013 the court dismissed a lawsuit brought against the Office of the Director of National Intelligence by a group of journalists, human rights workers, attorneys, and labor organizations who argued their international electronic communications had been swept up in the NSA's Prism program. The Court ruled that the plaintiffs lacked standing: No matter how likely that the plaintiff group's communications had been intercepted, they couldn't prove that they'd been spied on or point to any specific eavesdropped communications.

Only people who are spied on and then actually prosecuted have a chance to fight the constitutionality of the surveillance targeting them.

The issue came up again more recently, too, in the Electronic Frontier Foundation's long-running lawsuit against the NSA for warrantless wiretapping revealed by the New York Times in 2005. In February of this year, a federal court in San Francisco dismissed many of the lawsuit's claims, ruling in part that the EFF lacked standing; The judge in the case wrote that he couldn't dig into the question of whether the EFF itself was spied on without "risking exceptionally grave damage to national security."

The perversity of that situation, points out CATO Institute research fellow Julian Sanchez, is that only people who are spied on and then actually prosecuted have a chance to fight the constitutionality of the surveillance targeting them. Innocent spying victims whose data is sucked up in intelligence collection rather than criminal prosecution will never have that chance.

"The outcome is this bizarre situation where you could have thousand or millions of people subject to surveillance, but maybe only one or two who are actually prosecuted as terrorists have the opportunity to challenge it," says Sanchez. "The people with the best case that their rights have been violated, who are spied on despite innocence of any wrongdoing, are the ones guaranteed never to have a day in court."

It's important to note that despite the Obama administration's win on the standing issue in Klayman's case, the court's ruling still isn't much of a win for the NSA. In a separate court case, a judge ruled that its metadata program was never authorized by Congress. And Congress has already officially ended the program by passing the USA Freedom Act. The NSA is set to cease its metadata collection in November.

Even in Klayman's case, Friday's ruling doesn't end the suit. Instead, it merely dismisses the request for a preliminary injunction Klayman had asked for, which would immediately end the collection of his information. Now his lawsuit will proceed in the lower court.

But the question of standing still presents a larger problem: plaintiffs' inability to get an American court to actually rule on whether the NSA's activities are constitutional under the Fourth Amendment's privacy protections. "We need to know: this is a search; this isn’t a search; this is lawful; this isn't lawful. We need a decision that addresses this question on its merits," says EPIC's Butler. "Kicking the can down the road to the point where the question becomes moot is unfortunate, because it takes away that chance to find clarity about what the law really is."