Umm Salama bint Abu Umaya reported,

The Messenger of Allah ﷺ said something similar, except that he said, "Whoever denounces it is absolved, and whoever detests it is safe."

Muslim 4802

Sahih

و حدثني أبو الربيع العتكي حدثنا حماد يعني ابن زيد حدثنا المعلى بن زياد وهشام عن الحسن عن ضبة بن محصن

عن أم سلمة قالت

قال رسول الله ﷺ بنحو ذلك غير أنه قال فمن أنكر فقد برئ ومن كره فقد سلم

مسلم 4802صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Leadership
Chapter
Obligation to denounce rulers for what contradicts the Sharia while refraining from fighting them as long as they pray, and similar matters
Numbering
Darussalam 4802
Muslim 4802