The surgery was performed by Dr. James Andrews in Pensacola, Fla. Hanrahan won't pitch again in 2013 and could miss part of the '14 season.
He is a free agent at the end of this season. The right-hander had a frustrating first season with the Red Sox, posting a 9.82 ERA in nine games.
Ian Browne is a reporter for MLB.com. Read his blog, Brownie Points, and follow him on Twitter @IanMBrowne. This story was not subject to the approval of Major League Baseball or its clubs.