The result in Doha meant the Koreans advanced as Group E runners-up and avoided a last-16 showdown with pre-tournament favourites Japan. Instead they will play the winner of Group F, which Saudi Arabia currently lead ahead of Thailand.
Bahrain topped Group E and will face Japan after a 1-0 win over Jordan, who also went through to the last 16. Malaysia were eliminated despite a heroic effort that saw the world's 130th-ranked team score a 105th-minute equaliser from Romel Morales.
Jurgen Klinsmann's South Korea thought they had won it after Lee Kang-in equalised with an 83rd-minute free-kick and then Tottenham Hotspur's Son scored from the penalty spot in the 94th minute.
Jeong Woo-yeong gave the Koreans the lead in the 21st minute, only for Malaysia to come roaring back with two goals early in the second half from Faisal Halim and Arif Aiman, the latter from the spot.
Klinsmann named Wolverhampton Wanderers forward Hwang Hee-chan among the substitutes for the first time at the Asian Cup. Hwang, who has scored 10 goals in the Premier League this season, has been struggling with a hip injury.
South Korea had VAR to thank for their opening goal. Jeong thumped a header towards goal that Malaysia goalkeeper Syihan Hazmi initially looked to have clawed away with a fantastic save.
But the replay showed that the ball had crossed the line before Hazmi got a hand to it. It was a rare moment of ruthlessness from a Korean side that dominated possession but could not turn it into goals in the first half. Malaysia made them pay with a stunning equaliser six minutes after the restart.
Darren Lok robbed a sleeping Hwang In-beom on the edge of the box, and Halim turned Bayern Munich defender Kim Min-jae inside out before slotting the ball home from a tight angle.
And more was to come when a VAR check gave Malaysia a penalty after Seol Young-woo was ruled to have kicked Aiman. Aiman buried the spot-kick and some of their fans were in tears as they contemplated a famous win.
Halim almost scored again on the counter, with the Koreans pouring forward in desperate search of an equaliser. South Korea kept up the pressure and Lee delivered with his third goal of the tournament.
Captain Son then put South Korea ahead from the spot after substitute Oh Hyeon-gyu had been felled in the box in injury time. But Malaysia had the final say as Morales notched a famous equaliser.