"He has been advised two to three weeks rest by the doctors so he is out of the World Cup," Pakistan Cricket Board (PCB) spokesman Raza Kitchlew said.
He said the tour selection committee has sought to replace Hafeez with 25-year-old opener Nasir Jamshed who has played 45 ODIs.
"A request with medical reports has been sent to the ICC technical committee for inducting Jamshed into the squad," Kitchlew said.
Hafeez, 34, has been one of Pakistan's key player, having scored 4542 runs and taken 122 wickets in 155 One-day internationals.
He became the second Pakistan player to miss the World Cup through injury after left-arm paceman Junaid Khan pulled out with a hamstring injury and was replaced by Rahat Ali.
Hafeez, who is not allowed to bowl because of his illegal action, was due to undergo an official bowling assessment on Feb 16 in Brisbane but another PCB official said it was unlikely that the player would undergo the test on that day.
Pakistan begin their World Cup campaign against arch-rivals India next Sunday at Adelaide.
Image: Mohammad Hafeez
Photograph: Dinuka Liyanawatte/Reuters
Pakistan contract dispute not affecting Cup preparations: PCB
Injuries, suspensions plague unpredictable Pakistan's World Cup charge
Pakistan's Junaid ruled out of World Cup
Rahat to replace Junaid in Pakistan's World Cup squad: PCB
Williamson, Henry give New Zealand series win over Pakistan