I heard the Messenger of Allah ﷺ say, "Whoever fasts Ramadan, knows its limits, and guards himself against what he ought to guard against during it, will have his previous sins forgiven."
حدثنا علي بن إسحاق أخبرنا عبد الله يعني ابن مبارك أخبرنا يحيى بن أيوب عن عبد الله بن قريط أن عطاء بن يسار حدثه أنه
سمعت رسول الله ﷺ يقول من صام رمضان وعرف حدوده وتحفظ مما كان ينبغي له أن يتحفظ فيه كفر ما كان قبله
No references are available.
Its chain of transmission is hasan. Abdullah bin Qurayt was considered unknown by some, but Abu Hatim mentioned him without finding fault with him, and Ibn Hibban listed him among the trustworthy narrators, as did Haythami in 1/298. See also Ta'jil, Ikmal of Husayni, and al-Thiqat and al-Jarh.