He said to the Prophet ﷺ, "Teach me a supplication to recite in my prayer."The Prophet ﷺ said, "Say, 'O Allah, I have wronged myself greatly, and none forgives sins but You. So grant me forgiveness from Yourself and have mercy on me. Indeed, You are the Forgiving, the Merciful.'"In another narration, "to recite in my prayer and in my home."
أنه قال للنبي ﷺ: علمني دعاء أدعو به في صلاتي، قال: قل: اللهم إني ظلمت نفسي ظلما كثيرا، ولا يغفر الذنوب إلا أنت، فاغفر لي مغفرة من عندك، وارحمني إنك أنت الغفور الرحيم. وفي رواية: أدعو به في صلاتي وبيتي
Bukhari narrated it in the Book of Supplications (6326), and Muslim in the Book of Remembrance and Supplication (2705), both of them via Layth (that is, Ibn Saad), who said, Yazid bin Abu Habib narrated to me, from Abu Khayr, from Abdullah bin Amr bin As, from Abu Bakr Siddiq, and he related it.The other version in Muslim comes via Abdullah bin Wahb, who said, a man he named, along with Amr bin Harith, informed me, from Yazid bin Abu Habib, with the same wording. Regarding the unnamed man, Hafiz said in Fath al-Bari (2/320), Ibn Khuzayma clarified in his version that he was Ibn Lahia.I say, he left him unnamed because of his weakness, but he came paired with Amr bin Harith, who is a trustworthy and reliable memorizer of hadith.