Imaam An-Nawawi (rahimahullah) wrote an entire chapter in Riyah us-Saliheen on the cases where backbiting is permissible (for valid reasons approved by the Shariah). He provided six cases when backbiting can be allowed (along with ahadith from Bukhari and Muslim as proof), thus explaining exceptions to the general rule that backbiting is forbidden.
Chapter 256 – Some cases where it is permissible to Backbite
[Backbiting is permissible only for valid reasons approved by Shari`ah. These reasons are as follows:]
1. It is permissible for an oppressed person to speak before the judge or someone in a similar position of authority to help him or her establish his or her rights by telling him `so-and-so wronged me and has done such and such to me’ etc.
2. It is permissible to seek somebody’s assistance in forbidding evil and helping someone change his or her immoral conduct. One can say to the person who can offer such assistance, `so-and-so does such and such evil deeds. Can you exhort him?’ etc. This is permissible as long as one intends to forbid evil. If, however, one intends something else apart from this, then this act becomes unlawful.
3. One who seeks legal verdict on a certain matter may point out the defaults of another person or relate something else. One in this case can say to the Mufti (religious scholar who issues verdicts): “My father or brother (for example) treated me unjustly. Can I get my right established?” etc. This is permissible to say only if need be, but it is better to say `What do you think of someone who did such and such?’ This does not mean, however, that naming the person in question is not permissible, Hadith No. 1535 makes this point clear.
4. One who criticizes those who openly commit acts of disobedience, such as drinking wine, gambling, engaging in immoral habits, fornication, hypocrisy, and making mischief.
5. It is permissible to call into question the narrators of Hadith, and witnesses in the court when the need arises. It is also permissible to mention the bad qualities of somebody for marriage purposes in case an advice is sought. Also, if one has noticed that a “seeker of knowledge” frequently goes to the gatherings of an innovator in religion and one fears that this “seeker of knowledge” may be affected by this so-called scholar, then he must in this case give counsel to the “seeker of knowledge” by telling him about the “innovator,” etc.
6. It is permissible to use names such as “Al-a’mash” which means ‘the blear-eyed’ to talk about people who are known by such names for the sake of identification and not for disparaging people and underestimating them. To identify them without resorting to such names is however better.
1531. ‘Aishah (may Allah be pleased with her) said: A man sought permission for audience with the Prophet (sallallaahu ’alayhi wa sallam). He said, “Give him permission but he is a bad member of his tribe.”
[Al-Bukhari and Muslim].
1532. ‘Aishah (may Allah be pleased with her) said: The Messenger of Allah (sallallaahu ’alayhi wa sallam) said, “I do not think that so-and-so understands anything of our Faith.”
Al-Bukhari said: Al-Laith bin Sa’d, who is one of the narrators of this Hadith, said: The two men mentioned by the Prophet (sallallaahu ’alayhi wa sallam) in this Hadith were hypocrites (i.e., they revealed Faith and concealed disbelief).
1533. Fatimah bint Qais (may Allah be pleased with her) said: I came to the Prophet (sallallaahu ’alayhi wa sallam) and said to him: “Muawiyah and Abul-Jahm sent me a proposal of marriage.” The Messenger of Allah (sallallaahu ’alayhi wa sallam) said, “Muawiyah is destitute and he has no property, and Abul-Jahm is very hard on women.”
[Bukhari and Muslim].
1534. Zaid bin Al-Arqam (may Allah be pleased with him) said: We set out on a journey along with the Messenger of Allah (sallallaahu ’alayhi wa sallam) and we faced many hardships. ‘Abdullah bin Ubaiy (the chief of the hypocrites at Al-Madinah) said to his friends: “Do not spend on those who are with the Messenger of Allah (sallallaahu ’alayhi wa sallam) until they desert him.” He also said: “If we return to Al-Madinah, the more honourable (meaning himself, i.e., Abdullah bin Ubaiy) will drive out therefrom the meaner (meaning Messenger of Allah (sallallaahu ’alayhi wa sallam)).” I went to the Messenger of Allah (sallallaahu ’alayhi wa sallam) and informed him about that and he sent someone to ‘Abdullah bin Ubaiy. He asked him whether he had said that or not. Abdullah took an oath that he had not done anything of that sort and said that it was Zaid who carried a false tale to the Messenger of Allah (sallallaahu ’alayhi wa sallam). Zaid said: I was so much perturbed because of this until this Verse was revealed verifying my statement:
“When the hypocrites come to you (O Muhammad (sallallaahu ’alayhi wa sallam)), they say: ‘We bear witness that you are indeed the Messenger of Allah.’ Allah knows that you are indeed His Messenger, and Allah bears witness that the hypocrites are liars indeed.” (63:1) Then the Messenger of Allah (sallallaahu ’alayhi wa sallam) called the hypocrites in order to seek forgiveness for them from Allah, but they turned away their heads.
[Al-Bukhari and Muslim].
1535. ‘Aishah (May Allah be pleased with her) said: Hind, the wife of Abu Sufyan, said to the Prophet (sallallaahu ’alayhi wa sallam): Abu Sufyan is a niggardly man and does not give me and my children adequate provisions for maintenance unless I take something from his possession without his knowledge. The Prophet (sallallaahu ’alayhi wa sallam) said to her, “Take from his possessions on a reasonable basis that much which may suffice for you and your children.”
[Al-Bukhari and Muslim].