I heard the Messenger of Allah ﷺ say, "Allah tests His servant with illness until it wipes away every sin from him."
سمعت رسول الله ﷺ يقول: إن الله ليبتلي عبده بالسقم، حتى يكفر ذلك عنه كل ذنب.
No references are available.
Hakim narrated it (1/347-348) via Ibn Wahb, who said, "Abdul-Rahman bin Salman Hajri informed me, from Amr bin Abu Amr, from Maqburi, from Abu Hurairah," and he related it as such. Munziri attributed it to him in Targhib wal-Tarhib (5161). Hakim said, "Sahih according to the standard of the two Shaykhs."The correct view is that Bukhari did not narrate from Abdul-Rahman bin Salman Hajri, rather only Muslim narrated from him. Moreover, there is disagreement about him. Bukhari said, "There is something questionable about him." while Nasai said, "There is no harm in him."