California Civil Code section 1556 states "All persons are capable of contracting, except minors, persons of unsound mind, and persons deprived of civil rights", so that would go beyond just capital felons. Montana says the same thing, as does Idaho and South Dakota. Oklahoma law (15 O.S. §11) is a bit more complex
All persons are capable of contracting, except minors, persons of unsound mind, and persons deprived of civil rights, however, persons sentenced to imprisonment under the Department of Corrections for any term, during confinement under said sentence, may make employment contracts, subject to the approval of the Director of the Department of Corrections, when this benefits the vocational training or release preparation of the prisoner; provided however, such persons during confinement shall not be eligible to receive benefits under the unemployment compensation law.
There may be jurisdictional differences: I can't find any statutory provision along these lines for Washington state. It used to be true in Oregon, but I don't know if this has survived. It is not true in North Dakota, which excluded those deprived of civil rights from its law.