Yahya related to me from Malik from Yazid ibn Khusayfa that Urwa ibn az-Zubayr said that he heard A'isha, the wife of the Prophet ﷺ say, "The Messenger of Allah ﷺ said, 'When a mumin is afflicted by something, even a thorn, it removes (or effaces) his wrong actions.' " Yazid did not know which of them Urwa said.
أَنَّهُ قَالَ سَمِعْتُ عَائِشَةَ زَوْجَ النَّبِيِّ ﷺ تَقُولُ قَالَ رَسُولُ اللَّهِ ﷺ لاَ يُصِيبُ الْمُؤْمِنَ مِنْ مُصِيبَةٍ حَتَّى الشَّوْكَةُ إِلاَّ قُصَّ بِهَا أَوْ كُفِّرَ بِهَا مِنْ خَطَايَاهُ لاَ يَدْرِي يَزِيدُ أَيَّهُمَا قَالَ عُرْوَةُ