@kasiaaus if these spiders were found near a broken mud nest it’s likely the grub is a wasp larva. If you found it out in the open with no nest nearby it’s likely this is a fly larva. An example that target spiders are the small-headed flies (Family Acroceridae). Unfortunately, I’ve never seen them ID’d in these instances & the only way to ensure identification is truly accurate would be to raise it and see what hatches after the larva pupates.
Thank you @DiBickers. I did not see any mud nest nearby so it is probably a fly larva. The spider with the parasite was on a gum tree trunk about 1.5m off the ground.