I have been dealing with bud rot too, no worms but I am by the coast, what I do is cut 2” below the bud rot and mist straight peroxide(from the dollar store 3%) on the cut site. At night or evening, if you spray peroxide during the day it burns the plant. Some strains do better than others with the bud rot, and indoors is a totally different story for me. Shorter flowering time helps because they aren't exposed to the elements as long. I also use beneficial bacteria foliar sprays that would probably help a little more if I was consistent.
Bugs are good helpers at locating the bud rot, they always migrate to the bud rot I think because its soft and easy to nibble on. I thank them for helping me find it and send them on to bug heaven
It hurts to cut of those beautiful developing buds, but its better than loosing the entire plant to bud rot.
Oh How it hurts! If anyone has any tricks they use to prevent this I would love to hear them! Next year my number one goal for growing outdoor will be to prevent bud rot.