Yasir had tested positive for banned substance chlorthalidone in November.
The International Cricket Council said it accepted his claim of mistakenly taking his wife's medication instead of his own, but stressed their "zero-tolerance approach to doping".
The ban is backdated to 27 December - when Yasir was provisionally suspended - and will run until 27 March.
"I assure all fans and followers of the Pakistan cricket team that I have never taken a performance-enhancing substance nor have I ever had the intent of masking any such substance," said the 29-year-old.
"However, I acknowledge that I should have taken extra precautions to ensure that my blood pressure medication was stored separately from my wife's medication so that there was no possibility of it being mistaken for my own. Therefore, I accept the consequences imposed upon me."
Yasir will miss the Asia Cup and the World Twenty20, while his first major outing following his return could be with Pakistan's touring party to England this summer.
The ICC's general manager Geoff Allardice said the announcement "reminds all international cricketers that they remain personally responsible for ensuring that anything they eat, drink or put into their bodies does not result in an anti-doping rule violation".
Since making his international debut in 2011, he has played in 12 Tests and 15 one-day internationals.
He took 12 wickets as Pakistan beat Australia 2-0 in a Test series in 2014, and doubled that tally in a 2-1 win over Sri Lanka in 2015.
Pakistan leg-spinner Yasir Shah has been given a three-month ban after admitting to a doping offence.