25 U.S. Code § 1303. Habeas corpus

The privilege of the writ of habeas corpus shall be available to any person, in a court of the United States, to test the legality of his detention by order of an Indian tribe.