Worm in bird feathers

We have some parent and juvenile blackbirds in our garden who happy to come within a few inches of our hand to eat. One of them has a very visible worm seemingly tangled into her feathers, on top of tail/behind wing. I thought for a minute she was storing it there! Is this an accident, i.e. she likely has flicked it there and it has got tangled, or is it some sort of parasite? It looks just like an earthworm. Thanks.