In a breathtaking individual display, the Scotland striker took his personal tally for the season to 12 in all competitions after Charlton had twice come from behind to equalise, with the result taking Brian McDermott's side to within a point of the top six after enduring a difficult few weeks.
It ensured Chris Powell's Charlton suffered a first defeat in five and they now find themselves just three points clear of the relegation zone, although if it had not have been for McCormack they could easily have taken all three points on another day.
Charlton went into the game having not conceded a single goal for more than 400 minutes of Championship football.
A delay of half an hour due to torrential rain before kick-off left parts of the pitch soaking wet and both sides encountered difficulties throughout.
But there was certainly no hindrance for McCormack in the 17th minute when he latched on to a superb flick-on from Dexter Blackstock to fire home the opening goal.
Charlton almost hit back through Simon Church but the Welsh striker saw one effort cannon back off the post before being denied by a brilliant point-blank save from Paddy Kenny.
The hosts finally got their reward when Cameron Stewart lashed home a stunning volley just before the break and they were unlucky not to go in ahead moments later after Callum Harriot came close.
Yet all their hard work was undone less than two minutes after the restart when Harriot pulled back left-back Danny Pugh in the box and McCormack hammered his penalty straight down the middle, leaving goalkeeper Ben Hamer with no chance.
Charlton pressed for an equaliser as Harriot was denied by Kenny and Dorian Dervite fired wide from a corner.
They looked the more likely to win it when Johnnie Jackson side-footed home Church's cross from the left, but the home supporters were stunned three minutes later when former Cardiff and Motherwell striker McCormack completed his first ever hat-trick in professional football.
He smashed the ball past Hamer from a tight angle following a corner to send a significant Leeds following into raptures.
Charlton struggled to create another chance as they went in search of a third equaliser and the game was settled in the final minute when McCormack curled home a sumptuous free-kick after skipper Rudy Austin had been felled on the edge of the box.
His four-goal return means McCormack is now the Championship's top scorer with 11, having found the net six times in his last two appearances.