The 28-year-old, whose contract at Bayern expired in June, wore Stuttgart's colours as a youngster between 2000 and 2002 before joining the record Bundesliga champions.
"No one should forget their roots, and I never have," said Badstuber. "VfB was and is a special club to me and immediately struck an emotional chord with me once again. The region, the fans, the spirit of optimism… I can hardly wait to get stuck in here!"
Badstuber has been beset by injury problems in recent seasons, but was able to make ten starts in the 2016/17 Rückrunde while on loan at Schalke. His experience - 31 caps for Germany and 129 appearances in the Bundesliga will make him a valuable addition to the VfB squad, given that all of his fellow centre-backs - with the exception of Timo Baumgartl - are yet to play in the top flight.
"In Holger Badstuber, we've signed a player of exceptional quality," enthused Stuttgart marketing director Jochen Röttgermann. "Holger knows the Bundesliga and VfB, and along with his sporting abilities brings a wealth of experience to our squad. We're delighted that he'll soon be wearing the VfB shirt again."