A woman travelled by sea and vowed that if Allah delivered her safely, she would fast for a month. Allah delivered her, but she did not fast before she died. Her daughter, or her sister, came to the Messenger of Allah ﷺ, and he instructed her to fast on her behalf.
أن امرأة ركبت البحر، فنذرت إن نجاها الله أن تصوم شهرا. فنجاها الله فلم تصم حتى ماتت. فجاءت ابنتها- أو أختها- إلى رسول الله ﷺ فأمرها أن تصوم عنها.
Abu Dawud (3308) and Nasai (3816) narrated it, and Ibn Khuzayma (2054) graded it sahih, all of them from the hadith of Saeed bin Jubayr, from Ibn Abbas, who related it. Its chain of transmission is sahih. There are other hadiths with the same meaning, see the book of fasting.