Peace be upon you. According to Grand Ayatollah Sistani, if the woman is known for adultery and has not repented, the contract is considered invalid as a precaution. On the other hand, Grand Ayatollah Khamenei states that it is permissible if she is a legally married woman (thayyib) and is either Muslim or from the People of the Book, although it is discouraged, especially if she is known for promiscuity. If one proceeds with this, they should prevent her from engaging in immoral acts. The term 'known for adultery' refers to someone who openly expresses their willingness to engage in adultery or is recognized among people for such behavior.