Abdullah bin Abbas reported,

A woman traveled 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

Sahih

حدثنا عمرو بن عون أخبرنا هشيم عن أبي بشر عن سعيد بن جبير

عن ابن عباس

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

أبو داود 3308صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Oaths and vows
Chapter
Fulfilling a vow on behalf of the deceased
Numbering
Darussalam 3308
Abu Dawud 3308