Whether eating worms is haram (forbidden) or halal (permissible) in Islam depends on the specific school of thought and interpretation of Islamic law.
Some Islamic scholars permit the consumption of certain types of insects, including worms, under specific conditions. For example, Abu al-Barakat Ahmed al-Dardir mentioned worms as among the permissible insects. This perspective often draws from the principle that things are permissible unless explicitly forbidden.
However, other scholars consider all insects, including worms, as haram due to their perceived impurity or repulsiveness. This view relies on a broader interpretation of dietary restrictions in the Quran and Sunnah, emphasizing cleanliness and avoiding potentially harmful or offensive foods.
Therefore, there is no single, universally agreed-upon answer to this question within Islam. It depends on the specific scholar or school of thought consulted. It is best to consult with a trusted religious authority for a definitive answer based on your specific circumstances and adherence to a particular school of Islamic jurisprudence.