The 30-year-old spent a brief spell at Ashton Gate earlier in the year, but had been expected to feature for Middlesbrough this season.
However, he has played just once for the Riverside outfit in the new campaign and will now seek regular football with their Championship rivals.
City boss Derek McInnes told Sky Sports News: "Last season I felt he came in and gave us a real lift; hopefully he can do something similar this time around. Of course his loan spell was curtailed early last time and I think he feels he has unfinished business here.
"He was desperate to come back and now we have him for the next three months. Stephen is experienced at Championship level, has battling qualities, defends his box and can be the first-ball winner. He'll be very dominant and a good professional to have about the place.
"This position is one we've been looking to strengthen for some time and it's great we've got someone who can come in, is desperate to play and also knows all about us too."
Bristol City occupy 17th spot in the Championship table.