[Machine] The Messenger of Allah ﷺ said, "Wudu is made from what comes out, not what goes in." And it is narrated from Ata ibn Abi Rabah that he said about the one who performs wudu and a worm comes out of his anus, "Wudu is still valid." And Hasan and a group also said the same.
أَنَّ رَسُولَ اللهِ ﷺ قَالَ الْوُضُوءُ مِمَّا خَرَجَ وَلَيْسَ مِمَّا دَخَلَ وَرُوُّينَا عَنْ عَطَاءِ بْنِ أَبِي رَبَاحٍ أَنَّهُ قَالَ فِي الَّذِي يَتَوَضَّأُ فَيَخْرُجُ الدُّودُ مِنْ دُبُرِهِ قَالَ عَلَيْهِ الْوُضُوءُ وَكَذَلِكَ قَالَ الْحَسَنُ وَجَمَاعَةٌ