Are dead worms najis?

Ustadh AbdulAziz al-Haqqan
No. The scholars state that creatures with no flowing blood, like a certain type of worms, flies, and ants, do not become najis by dying. The evidence is the command of the Prophet ﷺ in the hadith of the fly: «إِذَا وَقَعَ الذُّبَابُ فِي شَرَابِ أَحَدِكُمْ فَلْيَغْمِسْهُ كُلَّهُ ثُمَّ لِيَطْرَحْهُ» Meaning: "When a fly falls into the drink of one of you, let him dip it fully, then remove it." (al-Bukhārī) Had its death defiled the drink, dipping it would mean spoiling the food. The exception: whatever emerges from filth itself, such as cockroaches, is najis alive and dead — and some scholars held certain other worms become najis at death.