Hadith
وَحَدَّثَنِي أَبُو الرَّبِيعِ الْعَتَكِيُّ، حَدَّثَنَا حَمَّادٌ، - يَعْنِي ابْنَ زَيْدٍ - حَدَّثَنَا الْمُعَلَّى بْنُ، زِيَادٍ وَهِشَامٌ عَنِ الْحَسَنِ، عَنْ ضَبَّةَ بْنِ مِحْصَنٍ، عَنْ أُمِّ سَلَمَةَ، قَالَتْ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم . بِنَحْوِ ذَلِكَ غَيْرَ أَنَّهُ قَالَ " فَمَنْ أَنْكَرَ فَقَدْ بَرِئَ وَمَنْ كَرِهَ فَقَدْ سَلِمَ " .
Another version of the tradition narrated on the same authority attributes the same words to the Messenger of Allah (ﷺ) except that it replaces kariha with ankhara and vice versa
Sahih
Sahih Muslim 4802 ·Book 33, Hadith 99·Also available on sunnah.com·