Stuttgart had done well to limit Bayern opportunities until their hard work was ruined in the 28th minute, when Mario Gotze capitalised on some hesitant defending to hammer home a loose ball.
© Getty Images
Despite continuing to look comfortable against the defending champions, Stuttgart's inability to cause problems for the hosts in the closing stages of the first half was a sign of things to come.
Predictably, Bayern were in control when the players returned for the second half, but missed an opportunity to double the lead when Robert Lewandowski fired over from a promising position.
Stuttgart wasted their best chance to claim a draw late on when Timo Werner, who left two Bayern defenders behind with an impressive piece of skill, curled the ball wide of the post.
Bayern would make their opponents pay late on as Ribery latched onto a pass from Lewandowski to wrap up the win with a fine finish on his return from injury.