Around 6,000 planes have been grounded to undergo an urgent software update after a vulnerability was identified.