Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:4:148

Allah does not like the public mention of evil except by one who has been wronged. And ever is Allah Hearing and Knowing.  

God does not like the utterance of evil words out loud, by any person, that is to say, He will punish him for it, unless a person has been wronged, in which case He would not punish him for uttering it out loud, when he is informing ˹others˺ of the wrong done to him by the wrong-doer or summoning ˹them˺ against him. God is ever Hearer, of what is said, Knower, of what is done.
القرآن:٤:١٤٨

لَا يُحِبُّ اللَّهُ الْجَهْرَ بِالسُّوءِ مِنَ الْقَوْلِ إِلَّا مَنْ ظُلِمَ ۚ وَكَانَ اللَّهُ سَمِيعًا عَلِيمًا  

{لا يحب الله الجهر بالسوء من القول} من أحد أي يعاقبه عليه {إلا من ظُلم} فلا يؤاخذه بالجهر به بأن يخبر عن ظلم ظالمه ويدعو عليه {وكان الله سميعا} لما يقال {عليما} بما يفعل.