5-7, 6-1 to cement his place in the last four at the O2 Arena in London.
The top two players from each group qualify for the semi-finals and after top seed Rafa Nadal pulled out through injury Federer is now a massive odds-on favourite to win the tournament. Understandably, the fans at the O2 Arena continue to treat him like a minor deity, for even at 36 years old he plays with more verve and insouciance than anyone else.
Sock earlier on Monday kept his hopes alive after coming from 4-2 down in the final-set tiebreak to overhaul Wimbledon finalist Marin Cilic 5-7 6-2 7-6 (7-4) and claim his first-ever win at the elite eight-man event. Although Cilic edged ahead 4-2, Sock held his nerve, winning five points in a row to seal the victory.
"But I love playing here in London, it's an fantastic atmosphere, you make me feel like home".
Federer plays Cilic on Thursday afternoon, clearly created to ramp up day-time ticket sales in a tournament shredded by the absence of the injured Andy Murray, Novak Djokovic, Stan Warwinka, Milos Raonic and Kei Nishikori, as well as the less-than-surprising departure of Rafael Nadal after limping to heroic defeat on one good knee against David Goffin on Monday - and Sock plays Zverev in the evening TV slot. I'm here to win matches.
The next break point didn't come until the 11th game.
"Definitely not a great record, but I felt that I played even well past year", Cilic said.
"He had a really nice season, especially the beginning, now the end". You make me feel at home.
The ageless Swiss resisted a sprited challenge from German prodigy Alexander Zverev to close in on an unprecedented seventh season-ending championship with a 7-6 (8-6) 5-7 6-1 victory on Tuesday night.
Cilic, playing in his third ATP Finals, made the first breakthrough in the decider to help the Croatian move to a 3-0 lead but Sock recovered his composure to claim three games on the bounce, including a fourth break of Cilic's serve.
"It's been an interesting morning so far, the fire alarm went off at 4am and we had to exit the building".