Fiorentina, who had failed to win any of their previous six league matches since the return of coach Cesare Prandelli, were also helped by some calamitous defending by the hosts, with Leonardo Bonucci in particular suffering an off-day.
Dusan Vlahovic stunned the Turin side by giving the visitors the lead in the third minute before Alex Sandro put through his own goal and Martin Caceres added a third following more bad defending in the last quarter of an hour.
The defeat, Juve's worst at the Allianz Stadium since it opened nine years ago, left them fourth with 24 points after 13 games, seven behind leaders AC Milan, and raises questions about their ability to extend their run of nine successive titles.
Fiorentia are in 15th place on 14 points.
Vlahovic wasted another chance after Bonucci lost the ball and Juve's problems mounted when Cuadrado caught Gaetano Castrovilli's shin with a dangerous studs-up tackle.
The referee showed a yellow card but changed it to red after viewing the incident on the pitchside monitor.
Szczesny tipped away a Castrovilli effort after another Bonucci mistake but Juve also threatened with Ronaldo firing into the side-netting and also testing keeper Bartlomiej Dragowski with a long-range effort.
Ronaldo had a header disallowed for offside after the break before Juve fell apart in the closing stages.
Bonucci made a complete hash of an attempt to clear Cristiano Biraghi's cross and the ball hit Alex Sandro and flew into the goal in the 76th minute.
Five minutes later, Bonucci had his pocket picked by Ribery and the French veteran found Biraghi whose cross was tapped in by Caceres to complete a thoroughly miserable night for Juve.
Bonucci was excused by manager Andrea Pirlo for his less-than-stellar outing.
"A bad night happens to everyone but he's put in great performances so far," said Pirlo. "It can happen to anyone but he's our captain and we have great confidence in him."
Pirlo, whose side demolished Parma 4-0 away only three days ago, said his team were their own worst enemies as they fell behind early.
"We played badly because of our own failings," he said. "When that happens, you get into bad situations. In the game before Christmas you sometimes have the holidays on your minds and we went in with a relaxed attitude.
"Once you go a goal behind and down to 10 men, there's not much to talk about in terms of tactics and technique."
Prandelli, meanwhile, enjoyed his first win since returning for a second stint as Fiorentina coach one month ago.
"We thought we could take some risks, it was the right time to be more aggressive," he said. "To win and overcome fear you have to be bold -- if you are afraid, sooner or later you will suffer. And in the long run the work pays off."