Can't you tell by looking if it is closed or open cell? Does it look like a "sponge" (open cell) or the sort of PU foam used for gap filling that comes in an uncontrollable aerosol can, or expanded polystyrene tiles (closed cell). My guess is that it would be the latter. Does it look like a structural material (i.e. pretty strong) or thermal insulation (gives way to thumbnail). If the latter I'd feel happier cutting it back to something solid and then bedding the washer in a liberal quantity of silicone or other sealant.
I also have a technique for recovering from a leak around the waste which developed a few weeks after I'd put the shower in, presumably because I'd failed to tighten the nut adequately or bed the washers in sealant, or the (plastic) nut jumped one thread on the waste. If you warm up mixed araldite to ~ 100 C it becomes almost as runny as single cream (it also sets quite quickly, use the 24 hour one not the "rapid"). So, you preheat your adhesive and hardener separately (they get much more runny) then mix. then you can dribble the mix from above between the tray and the waste fitting. Helps if you heat the waste to "too hot to touch" using a hot air gun. Once you have used the "hot araldite" technique a few times you can do a surprisingly neat job. Rather like welding, but without a mask and with a bit more time. In this case it saved me from a major recovery exercise, I would either have had to take some ceiling below down and then excavate upwards through floorboards to expose the waste, or take out the shower tray upon which I had built a timber surround, with doors, plasterboard and tiling. Only web anonymity makes me happy to admit this!