A woman came to the Prophet ﷺ and said, "My sister has died, and she owed two consecutive months of fasting."He asked, "If your sister had a debt, would you pay it off on her behalf?"She replied, "Yes."He said, "Then the debt owed to Allah is even more deserving of being fulfilled."
حدثنا أبو سعيد الأشج حدثنا أبو خالد الأحمر عن الأعمش عن سلمة بن كهيل ومسلم البطين عن سعيد بن جبير وعطاء ومجاهد
جاءت امرأة إلى النبي ﷺ فقالت إن أختي ماتت وعليها صوم شهرين متتابعين قال أرأيت لو كان على أختك دين أكنت تقضينه قالت نعم قال فحق الله أحق
Agreed upon by Bukhari and Muslim. Muslim narrated it in the Book of Fasting, chapter on making up fasts on behalf of the deceased, hadith no. 1148, from Ashaj in abridged form, and Bukhari narrated it in the Book of Fasting, chapter on one who dies while owing a fast, hadith no. 1953, through the hadith of Amash with the same wording. On this subject there are also narrations from Burayda [Muslim, no. 1149] and Ibn Umar (perhaps he is referring to the hadith that follows, no. 718) and Ayesha [Bukhari, no. 1952, and Muslim, no. 1147].