Some rotten clove which has to be thrown away.
I submerged onions with sign of rotting and pungent smell into water with baking soda (half to one tablespoon per glass of water), and able to flush out a few tiny worm. The worms only died after submerged in the water solution for an hour.