Some states have "rent withholding laws" which allow you to withhold rent, however in some states, there is a requirement that the rent be paid to an escrow agent to be held until the repairs are made.
In operation, the Rent Withholding Act, 35 P.S. § 1700-1, allows tenants whose leased premises are declared to be Unfit For Human Habitation by an authorized code enforcement agency to escrow rent with an approved escrow agent. Rent is to be deposited in escrow monthly for a period of six months- or until sufficient repairs are made by the landlord or tenant to justify the removal of the Unfit designation- whichever comes first. If the Unfit designation is not removed after six months, all funds then in escrow are returned to the tenant to keep. A new six-month period then begins and the process repeats itself at six-month intervals until, if ever, the Unfit designation is removed. If the premises is removed from Unfit status before the end of any six-month period the landlord is given all of the funds then held in escrow.
During the period of 'unfitness' the tenant may withdraw from the escrow account such funds as are necessary to make repairs and/or pay for utilities which are the landlord's responsibility but for which he or she refuses to pay. Although not stated in the Act, a property which is Unfit solely because of the lack of a utility should remain Unfit even though the tenant has used the escrowed rent to have the utility restored, otherwise, the tenant would lose the right to use the rent for the utility if the Unfit designation were lifted. The Unfit designation should only be removed when the landlord resumes the obligation to pay for the utility. The Utilities Service Tenants Rights Act should, however, provide tenants with necessary protection should the Unfit designation be lifted before the landlord resumes payment for the utility.
Tenants cannot legally be evicted for any reason whatsoever, including nuisance and waste, while their escrow payments are current. Leases, oral or written, are extended as necessary until the Unfit designation is removed. The Act is remedial insofar as it allows a tenant to use the escrowed rent to make repairs, and punitive insofar as it penalizes a landlord for allowing the premises to fall into such a state of disrepair by depriving him or her of any profits from the premises.