Heat a large frying pan and put the duck legs and their fat, skin-side down, in the pan. Cook over a medium heat for 10 minutes until the skins turn golden and crispy. Turn and cook for a further 2–3 minutes until the legs are heated through. Drain on kitchen paper, then tear the meat into small pieces and discard the bones.
Meanwhile, pour the coconut milk into a pan with the stock, fish sauce, star anise, chilli flakes, ginger and half the chopped coriander and bring to simmering point. Leave to bubble gently for 10 minutes to allow the flavours to infuse. Stir in the lime juice.
Cook the noodles in unsalted boiling water for about 3 minutes or according to the instructions on the packet, then drain and heap into serving bowls.
Scatter over the duck meat and pour over the hot coconut broth. Sprinkle with the coconut shavings, cashews and remaining coriander. Serve immediately.