It is from the Sunnah of the Prophet that we take the light of guidance regarding this crucial issue, which is one that requires urgent attention due to it being one of the most important matters that will assist in preserving the Muslim community with regards to its religion and chastity.
Abu Hurayrah reported: “The Messenger of Allah said: “Every member of my nation will be forgiven, except those who expose their wrongdoings. An example of this is that of a man who commits a sin at night which Allah then conceals, but, the next morning, he goes and says (to people): ‘I committed such and such a sin last night’ - while Allah had kept it secret. During the night Allah had concealed it, but in the morning he tore up the cover provided by Allah Himself.” [Al-Bukhari & Muslim]
Those who openly expose their sins to others will be deprived from the forgiveness of Allah. Imaam An-Nawawi said: “It is permissible to speak openly about those who openly expose the sins that they commit, or innovations they propagate.”
Such a person would sit in a gathering and say: “I committed such and such a sin last night” and then give details, whilst the Messenger of Allah said: “Refrain from these filthy matters (i.e. sins) that Allah has forbidden, and if one of you is tried by committing any of them, then let him conceal them as Allah has concealed them for him.” [Al-Hakim]
Why is this? It is because openly exposing one's sins is a way of slighting the rank of Allah; it is Allah who forbade such sins to be committed and who informed us of this through His Messenger . Thus, the one who openly exposes his disobedience is expressing indifference regarding the legislation of Allah, the rank of His Messenger and the feelings of the righteous within the Muslim community. To do this is therefore nothing except dogged arrogance.
Openly exposing sins and bragging about them is a common practice amongst people nowadays, and has replaced repenting from them and concealing them from others. If one sins, he should not even inform a single person, and must repent and resolve never to commit the same sin again. One may, however, inform a scholar or a wise friend in order to seek his help and receive advice on how to refrain from and resist such sins, as well as to receive guidance on matters that would protect him from being tempted again and to inform him of deterrents that would prevent him from falling into the same mistake again.
Another specific permissible reason for one exposing his sin is to do so in order to seek the Islamic ruling regarding what he has committed; the proof for this is the story of the man who had sexual intercourse with his wife during the daytime one Ramadan during the lifetime of the Messenger of Allah . The man then went and informed the Prophet of what he had done so that he would know what the ruling was and what he should therefore do regarding this sin. The Prophet did not condemn him for telling him what he had done and instructed him as to what to do for expiation.
Exposing sins and bragging about them encourages others to commit them and imitate the sinners. The prohibition of openly committing sins is a great wisdom, because Allah knows that such acts move others and motivate them to indulge in the same evil; it also makes sinning more attractive to people, decorating it in their eyes. This is why openly exposing one's sins is so perilous.
The Islamic scholars mentioned many rulings related to those who openly expose their sins to others, such as the prayer behind such people to be disliked (i.e., such people may not lead congregational prayers). Some scholars even went as far as to state that one must repeat his prayer if he prays behind such a person. Ibn Abu Zayd was asked whether or not a sinner can lead people during congregational prayers, to which he answered: “If he is one who openly and persistently exposes his sins to others, then he may not.” This means that he should not be given the opportunity to lead to begin with, and if he is already leading, then people must strive to remove and replace him, because this person is unfit for leadership.
On the other hand, if one openly exposes a sin of his unintentionally then he is pardoned due to it occurring accidentally. Imam Malik was asked about this and answered: “This is something that anyone could (accidentally) do … (but) nothing is similar to the evil of he who persistently and openly exposes his sins.”
An issue related to this is that of visiting such a person when he is sick; visiting a sick Muslim is highly rewardable by Allah, and it is a right that a Muslim has over other Muslims, but the Islamic scholars said regarding the one who openly exposes his sins: “He is not to be visited, so that this (shunning) acts as a means of making him repent from such evil, and in order for others to refrain from such an act when they see how badly he is treated; but, (one may visit him) if the intention is to admonish and advise him.”
Another ruling regarding such a person is concerning praying the funeral prayer over him; the Islamic scholars stated that he is not to be prayed over as a deterrent for others, so that they will not follow in his footsteps. In this regard, Imam Ibn Taymiyyah said: “People should refrain from praying over the dead person who was known to openly expose his sins to others as a means to prevent others from acting like him.” Only the common people should pray over such a person, because he was still a Muslim, but people of piety and knowledge should be absent.
What is the ruling of backbiting such people and revealing their sins? Generally, it is recommended to conceal the sins of others because the Prophet said: “Whoever covers up the fault of a Muslim, Allah will cover up his fault(s) on the Day of Resurrection.” [Al-Bukhari & Muslim]
The exception to this narration applies only for the one who openly exposes his sins, as the scholars stated; this is because it becomes recommended for others to expose him to people so that they can avoid dealing with him. Concealing the faults of such a person could encourage him to commit more evil.
As for backbiting such people, Imam Ahmad said: “He who openly exposes his sins to others has no protection against backbiting (i.e. it is not prohibited to backbite him).” On the other hand, Imam An-Nawawi stated that it is permitted, but only regarding the sins he exposed to others and nothing else, so that people can be warned against him.
Additionally, if he is likely to take heed as a result of people boycotting him, then people should boycott him by not talking to him, not visiting him, not responding to him when he salutes with Salam and so on. This is because exposition of sins is a matter taken very seriously in Islam.
One is obliged Islamically to respond to invitations to wedding feasts because the Prophet said: “He who does not respond to and honour the dinner invitation of a wedding has disobeyed Allah and His Messenger.” Nonetheless, this obligation does not apply to the invitations of those who openly expose their sins.