Dalil

Quran An-Nisa 4:15

وَٱلَّٰتِي يَأۡتِينَ ٱلۡفَٰحِشَةَ مِن نِّسَآئِكُمۡ فَٱسۡتَشۡهِدُواْ عَلَيۡهِنَّ أَرۡبَعَةٗ مِّنكُمۡۖ فَإِن شَهِدُواْ فَأَمۡسِكُوهُنَّ فِي ٱلۡبُيُوتِ حَتَّىٰ يَتَوَفَّىٰهُنَّ ٱلۡمَوۡتُ أَوۡ يَجۡعَلَ ٱللَّهُ لَهُنَّ سَبِيلٗا

Translation

Those who commit immorality [i.e., unlawful sexual intercourse] of your women - bring against them four [witnesses] from among you. And if they testify, confine them [i.e., the guilty women] to houses until death takes them or Allāh ordains for them [another] way.