Source
Taken from: Fatāwā Amunpuri by Shaykh Ghulām Muṣṭafā Ẓahīr AmunpuriQuestion
What is the ruling on taking an oath over an unlawful act, and what is the ruling regarding fulfilling it?Answer
Taking an oath over an unlawful act is itself unlawful. However, if such an oath has already been taken, then breaking it is obligatory, and upon breaking it, expiation (kaffārah) must also be offered.Evidence from the Sunnah
❀ Sayyidunā ʿAbd al-Raḥmān bin Samurah رضي الله عنه narrated that the Messenger of Allah ﷺ said:إذا حلفت على يمين ورأيت غيرها خيرا منها فأت الذى هو خير وكفر عن يمينك.
“When you take an oath regarding something, then you see that something else is better than it, then do what is better and offer expiation for your oath.”
Reference: Ṣaḥīḥ al-Bukhārī: 6722
Reference: Ṣaḥīḥ Muslim: 1652