In Rasul v Bush (2004), the Supreme Court held that the detainees had the right to counsel and to challenge their detentions at an impartial tribunal, according to habeas corpus.
In Boumediene v. Bush (2008), the Supreme Court held that the detainees' right to habeas corpus could not be taken away by the Military Commission Act of 2006, which they ruled was unconstitutional.