Borussia Dortmund travel to Eintracht Frankfurt while Hoffenheim, who won at Schalke in the last round, have been rewarded with a home tie against Wolfsburg.
"We wanted a home game, but to be honest, we didn't necessarily want to face Bayern," said Hamburg's director of sport Oliver Kreuzer after his side were pitched with the holders, who have not lost in the league in 40 games.
Leverkusen, who are currently second in the Bundesliga, four points behind Bayern and six ahead of Dortmund, were given arguably the best draw, although Kaiserslautern chairman Stefan Kuntz has vowed to give them a game.
"It's a very tough draw for us and we would have preferred to play at home, but nobody is without a chance entirely in the cup," he said to sport1.de.
Hoffenheim and Wolfsburg will be bidding to keep open one route into Europe when they meet at the Rhein-Neckar-Arena.
"Wolfsburg are a top team, but they are not invincible," said Hoffenheim forward Kevin Volland.
"We're playing at home and we desperately want to use this advantage."