The Prophet (blessings and peace of Allah be upon him) said: âI do not permit a menstruating woman or a person who is junub to enter the mosque.â And Allah, may He be exalted, says (interpretation of the meaning): âO you who believe! Approach not As‑Salaah (the prayer) when you are in a drunken state until you know (the meaning) of what you utter, nor when you are in a state of Janaaba (i.e. in a state of sexual impurity and have not yet taken a bath), except when travelling on the road (without enough water, or just passing through a mosque), till you wash your whole bodyâ al-Nisaâ 4:43. An exception is made for people who are junub who are just passing through, and the same applies to menstruating women. The menstruating woman should not sit in the mosque, but she may pass through. There is nothing wrong with one who is passing through going from one door to another, or going in to get something from the mosque, such as a small mat or a book or a vessel and so on. When the Prophet (blessings and peace of Allah be upon him) told âAaâishah to hand him a small mat -- referring to a prayer mat made of papyrus on which he (blessings and peace of Allah be upon him) used to pray -- she told him that she was menstruating, and he said to her: âYour menstruation is not in your hand.â What is meant is that there is nothing to prevent her going into the mosque to get something; rather what is forbidden is for her to sit in the mosque. As for her passing through or going to get something, there is nothing wrong with that, and this hadeeth indicates that. End quote.
Shaykh âAbd al-âAzeez ibn Baaz (may Allah have mercy on him).
Fataawa Noor âala al-Darb, 2/678