Hasaranga came on in the ninth over of the reduced 27-over match and claimed the wicket of Takudzwanashe Kaitano with the final ball of his first over before taking another three scalps in his next two overs.
Zimbabwe struggled to play the googly as the spinner went on to take three of the final four wickets to restrict the visitors to just 96.
The figures are the second-best by a Sri Lanka bowler with Chaminda Vaas's 8/19, against the same opposition 23 years ago, the best in men's ODI history.
Glenn McGrath's 7/15 remains the best figures in an ICC Men's Cricket World Cup.