The wife of Sinan bin Salama al-Juhani asked him to put a question to the Messenger of Allah ﷺ. Her mother had died without performing the Hajj, and she wanted to know whether it would suffice for her mother if she performed the Hajj on her behalf.He replied, "Yes. If her mother had a debt and she paid it off on her behalf, would it not be accepted from her? So let her perform the Hajj on behalf of her mother."
أمرت امرأة سنان بن سلمة الجهني أن يسأل رسول الله ﷺ أن أمها ماتت ولم تحج أفيجزئ عن أمها أن تحج عنها؟ قال: نعم لو كان على أمها دين فقضته عنها ألم يكن يجزئ عنها؟ فلتحج عن أمها.
Nasai (2633) narrated it from Imran bin Musa, who said, Abdul-Warith narrated to us, Abu Tayah narrated to us, he said, Musa bin Salama Hudhali narrated to me, that Ibn Abbas said (as mentioned). Its isnad is sahih, and Abu Tayah is Yazid bin Humayd Dubi, well known by his kunyah, and he is among the narrators found in all the major collections. Ahmad (2518) narrated it through his route in a long hadith, and Ibn Khuzayma (3034) graded it sahih from this same route, and it contains a story.