The foam is there to improve electrical isolation. This is probably more of an electrical breakdown than an overheat, maybe a crack in the capacitor casing and has 'arced' through the foam. Maybe when it was assembled there was too much pressure in that region - maybe
Fingers crossed, replacing those two parts should bring you closer to a working scope.
When you replace the HV cap, be sure to carefully clean the surroundings with alcohol - especially anything that appears to have blackened. Carbon / soot is very conductive! Remove the existing foam, it should be replaced but I'm at a loss for a replacement at the moment, maybe Andy (DA) or David (factory) knows of something that could be used ...
BTW, it was very good that you followed your nose!
dc