Sunan Abi Dawud, Book 12, Hadith 31 (Abu Dawud 2077)

Narrated Ali ibn AbuTalib:

(The narrator Isma'il said: I think ash-Sha'bi attributed this tradition to the Prophet) The Prophet (ﷺ) said: Curse be upon the one who marries a divorced woman with the intention of making her lawful for her former husband and upon the one for whom she is made lawful.