Abdullah bin Abbas reported,

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.

Azami 7130

Sahih

عن ابن عباس

أن امرأة ركبت البحر، فنذرت إن نجاها الله أن تصوم شهرا. فنجاها الله فلم تصم حتى ماتت. فجاءت ابنتها- أو أختها- إلى رسول الله ﷺ فأمرها أن تصوم عنها.

الأعظمي 7130صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Oaths and vows
Chapter
Vows
Section
Fulfilling a fasting vow on behalf of the deceased
Numbering
Jami al-Kamil 7130 (2nd edition)