We are taught not to publicize our sins, as the Holy Prophet sas stated:
All the sins of my followers will be forgiven except those of the mujahirin [those who commit a sin openly or disclose their sins to the people](Sahih al-Bukhari, Book 78, Hadith 99; Sahih Muslim,Book 55, Hadith 68)
However, we are also taught not to conceal testimony even if it is against ourselves, as Allah Almighty says:
O ye who believe! Be strict in observing justice, and be witnesses for Allah, even though it be against yourselves or against parents and kindred.(Surah an-Nisa’, 4:136).
If we reveal a sin when there is no need to reveal it, then we publicize sin and harm the morals of society. If however, we conceal a sin when there is a need to reveal it, then we deprive someone of their due right just to save ourselves. Someone who is considering us as a future spouse has the right to know those shortcomings of ours that are relevant in making a life decision that is best for them and us. If we hide something important, they will inevitably find out and may feel betrayed.
As to which shortcomings are relevant and significant enough, and when to reveal them, this has to be decided with taqwa.
O ye who believe! Fear Allah and say the straightforward word.(Surah al-Ahzab, 33:71)
Also, we must respect the privacy of the other party and not tell anyone else what they confided in us about any of their shortcomings. The Holy Prophet sas said:
Meetings are confidential.(Sunan Abi Dawud, Book 42, Hadith 4851).
When the Holy Prophet sas sent a proposal of marriage to Hadrat Umme Salamara, she did not hesitate to share what she considered to be a relevant shortcoming with her future husband because he had a right to know. Since the Holy Prophet sas had other wives, she feared that she may not be able to adjust and responded:
“I am of jealous temperament.” The Holy Prophet sas said, “Go back to her and tell her: As for your saying that you are a jealous woman, I will pray to Allah for you to take away your jealousy.”
(Sahih Muslim, Book 11, Hadith 4; Sunan an-Nasa’i, vol. 4, Book 26, Hadith 3256)
Once, the Holy Prophet sas advised a woman against a proposal she received, saying:
As from Abu Jahm he is a man who habitually beats women.(Sahih Muslim,Book 18, Hadith 60; Sunan Ibn Majah, vol. 3, Book 9, Hadith 1869)
He did not hesitate to share a fault in a prospective husband with her. It was her right to know before making a decision that would affect the rest of her life. Thus, if someone asks us about someone we know who they are considering for marriage, we should honestly tell them their relevant qualities and faults that we know for certain because it is their right to know.
The principle is: if concealing a sin infringes on someone’s right, then it should be revealed to them. If revealing a sin is not of benefit and is not anyone’s business, it should be kept hidden.