The French midfielder picked up the problem on international duty last month, but scored two and created two on his Bundesliga return as Bayern ran riot on Saturday.
And Ribery expressed his relief at marking his comeback with such an accomplished performance as the league leaders recorded their 11th successive win in all competitions and extended their league unbeaten run to 40 matches, ensuring they will enter the mid-season break at the summit.
"It was a good game by the team," he said. "I am back - I am glad that I managed a game.
"It was great to be back from the start on the pitch.
"The pain in the rib is as good as gone, so I could play freely."
The 30-year-old was joined in finding the back of the net by Daniel van Buyten, Mario Mandzukic, Thomas Muller and Mario Gotze, as well as an Assani Lukimya-Mulongoti own goal that set the ball rolling in the 21st minute.
"With this team, it just makes great fun," he continued. "We must continue to play as well against (Manchester) City on Tuesday (in the UEFA Champions League)."
Bayern will hope to extend their run of consecutive of 10 Champions League wins when they host the English side.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.