The Irish fly-half picked up the problem during last Friday’s 29-19 pre-season defeat at Ulster.
And Hanrahan, who is set to be Stephen Myler’s main competition for the 10 shirt this season, will now be sidelined.
Saints welcome Bath to Franklin’s Gardens for the Aviva Premiership opener on Saturday.
And Mallinder said: “Unfortunately, JJ has hurt his ankle. He did that last week and he’ll be out for a few weeks.”
Super Zaib helps Steelbacks to chase down Eagles
'Seamless' start to new era at Saints
Saints players can show what they are made of during hectic start to season
Aussie Kelly eager to learn 'new tricks' from Northants' bowling 'geniuses'
Northamptonshire share spoils with Warwickshire after 'turgid' final day
Saints will also be without Christian Day (ruptured bicep) and Tom Stephenson (broken leg) this weekend.
But Teimana Harrison, who missed the defeat to Ulster with a knock, will be available.
“Teimana had a niggle from training so we left him out as a precaution, but he’ll be fit and raring to go this weekend,” Mallinder said.