If a mahram woman is in front of the worshipper, the prayer is valid
1 hadith
Hadith 132
423- وعن أبى النضر مولى عمر بن عبيد الله عن أبى سلمة بن عبد الرحمن عن عائشة زوج النبى صلى الله عليه وسلم أنها قالت: كنت أنام بين يدي رسول الله صلى الله عليه وسلم ورجلاي فى قبلته، فإذا سجد غمزني فقبضت رجلي، فإذا قام بسطتهما؛ قالت: والبيوت يومئذ ليس فيها مصابيح.
It is narrated from the wife of the Prophet, Sayyida Aisha (may Allah be pleased with her), that I used to sleep in front of the Prophet (peace be upon him) and my feet would be towards his qiblah. Then when the Prophet (peace be upon him) would go into prostration, he would touch my feet with his hand, and I would withdraw my feet. Then when he stood up, I would stretch out my feet again. In those days, there were no lamps in the houses.
Hadith Referenceموطا امام مالك رواية ابن القاسم / 132
Hadith Gradingزبیر علی زئی:سنده صحيح
Hadith Takhrij«423- متفق عليه ، الموطأ (رواية يحيیٰي بن يحيیٰي 117/1 ح 255 ، ك 7 ب 1 ح 2) التمهيد 166/21 ، الاستذكار : 226 ، و أخرجه البخاري (382) ومسلم (512/272) من حديث مالك به.»