Abu Ubaidah said: A person in a state of major ritual impurity (junub) may pass through the mosque, but he should not sit in it. As evidence, he recited this verse: «﴿وَلَاجُنُبًاإِلَّاعَابِرِيسَبِيلٍ﴾» .
Hadith Referenceسنن دارمي / من كتاب الطهارة / 1205