The France international was making his first start of the season after suffering with back and knee injuries and he contributed Bayern's third goal in a comfortable 3-1 success for the holders at the Imtech Arena.
However, the match ended on a sour note when a Hamburg supporter ran onto the pitch and hit Ribery with a scarf, before making a hand gesture towards the 31-year-old and being led away by stewards.
The incident drew an immediate apology from Hamburg on Twitter, while Ribery himself brushed aside the altercation.
"Fortunately nothing much happened," he told German TV station ARD.
"It was a difficult situation, I didn't see him coming."
Ribery's goal came via a deflection from Johan Djourou and, though he admits there was an element of luck, he was happy with the team's performance.
"It was my first game from the start so it wasn't easy," he added. "I'm delighted the team played so well, and I think I had a good game too.
"I was a bit lucky with my goal, but it was super for me and the team. We have to keep it up, all of us together."
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.