Lewis Hamilton and Fernando Alonso were handed 20-second penalties following the Malaysian Grand Prix at Sepang.