Imaam an-Nawawee rahimahullaah says in his book ‘Riyaadus-Saalihen’

256 – Chapter: What is Permissible From [the types] of Backbiting

Know that backbiting is permissible if it is due to a valid reason approved by the Islamic legislation, and it is not able to be attained [i.e. the valid reason] except by way of backbiting.

[translators note: Meaning: That a person has no other choice but to backbite in each of the following cases].

And that is in six cases:

(1) Complaining about oppression.

So it is permissible for an oppressed person to complain to the ruler, and the judge, and other than them – from those that have authority, or ability -, to aid him against his oppressor. So he says: “So-and-so oppressed me with such and such.”

(2) Seeking somebody’s help in changing an evil, and correcting sinful affairs by changing them into that which is legislated and good.

So he says to a person who can help him in that: “So-and-so does such-and-such; so prevent him from that.” And the like of that. And one’s intent in this case should be to reach the goal of removing the evil – and if he intends other than that, then it is forbidden to do so.

(3) When seeking a verdict.

So a person says to the scholar: “My father, or my brother, or my partner, or so-and-so oppressed me; is that [oppression] permissible for him to do? And what can I do to end such, and regain my rights, and prevent any [further] oppression?” And the like of these questions. So this is permissible if there is a need – however that which is safer and better is that a person says: “What do you say regarding a man, or a person, or a partner, that does such-and-such?” Because that way the goal is attained without specifying who it is. Even still, it is permissible to specify; as we will make further mention of in the narration of Hind inshaaAllaah.

(4) Warning the Muslims from evil, and advising them.

And that is of various different types:

From them: Criticizing those who have been criticized from the narrators (in the chains of narration) and witnesses (in a court of law). And that is permissible according to the consensus of the Muslims. Rather it is obligatory if there is a need to do so.

And from them: Seeking advice when looking to get married to a person, or having shares with him (in a business etc), or when entrusting somebody with something (such as money, gold etc), or when dealing with someone, or other than that, or when looking to move in to a residence –a person asking regarding his prospective neighbors. And it is obligatory upon the one being asked that he does not hide anything regarding that person’s situation. Rather he mentions the negative points, with the intention of advising the questioner.

And from them: If he sees a person of knowledge and understanding of the religion who frequents an innovator, or an open sinner – and takes knowledge from them – and it is feared that the person of knowledge & understanding will be negatively affected. [In such a case] it is upon him to advise him by making clear [that person’s] situation; with the condition that his intention is to advise. And this is from the things that people fall into error regarding, so it may be the case that that which leads a person to do such [backbiting] is envy and animosity, and the devil disguises that to him, and makes him think that it is advice. So [a person should] take note and be shrewd regarding this.

And from them: That a person has a position of authority but he does not carry out that which is obligatory upon him; such as if he is inappropriate for that position (unqualified), or he transgresses the bounds of his authority (i.e. he takes advantage of his position of power), or he is negligent, and the like of that. In this case it is obligatory to inform the ruler so that he is removed from that position, and someone who is suitable is appointed in his place. Or he [the ruler] knows of his situation so that he can be dealt with accordingly, and so he [the ruler] is not deceived by him. Rather he [the ruler] strives to admonish him, and encourage him with being upright, or he changes him [for someone else that is suitable].

(5) That a person is open with regards to his sin, or his innovation.

Such as the one who openly drinks wine, or steals other people’s things, or takes taxes [from people’s wealth] oppressively, or he takes charge of affairs of falsehood (such as innovations etc) – in [the like] of these cases it is permissible to mention about him that which he does openly, and it is forbidden to mention other than that from [his] faults – except if there is another [valid] reason to mention them [from the other five points].

(6) For the sake of identification.

So if a person was well- known by a ‘nickname’ such as ‘al-A`mash’ (the one who has severely impaired vision), or by ‘al-A`raj’ (the one who walks with a limp), or by ‘al-Asamm’ (the one who is deaf), or by ‘al-A`maa’ (the one who is blind), or by ‘al-Ahwal’ (the one who is cross-eyed); and other than that [from the nicknames] then it is permissible to identify them with that. However it is forbidden to call a person with such nicknames if the intent is to lower them. And if it is possible to identify them with other than that, that is better and foremost.

So these aforementioned six reasons the scholars have mentioned; most of them are agreed upon [between the scholars]. And the proof for them are the famous narrations.