The Blues began the second half with a bang - Jason Tovey crossing the whitewash - but Leinster hit back through the boot of Madigan.
The 23-year-old fly-half's penalty proved the final word on the contest, ending Cardiff's two-game winning run in the league and lifting Leinster up to second, within nine points of leaders Ulster.
Leinster won the first meeting between the two sides this season 59-22 and were ahead at the Arms Park after five minutes when Madigan slotted the game's first penalty for a 3-0 lead.
Dafydd Hewitt thought he had made a dangerous burst into space only to be pulled back for a forward pass but the Blues got themselves on the scoreboard when fly-half Rhys Patchell sent over a penalty of his own.
The 19-year-old, who is expected to make his Wales Under-20 debut this month, passed up the chance to nudge Cardiff Blues ahead when he missed with a second penalty attempt on 17 minutes.
The Blues were handed a man advantage soon after when Tom Denton was yellow carded following a tackle on James Down but it was Leinster who were next to add to their haul.
After Cardiff conceded a penalty just inside their own half Madigan stepped up and his kick just managed to creep over to put Leinster 6-3 up.
Blues full-back Tovey then knocked on close to his own line and while Leinster's attempt to cross the try-line was repelled, Madigan took his haul to nine points with a third penalty.
Restored to full strength with Denton's return, Leinster pressed on and got the try they were looking for before the break when scrum-half Boss finished off a powerful surge.
Madigan converted to put Leinster 16-3 up and added a further two points on the stroke of half-time after Murphy picked the ball up off the back of the scrum to send the visitors in at the break 23-3 up.
Patchell spurned the chance to reduce the deficit after the break with an unsuccessful penalty attempt but sustained pressure in the Leinster 22 resulted in Tovey touching down.
Patchell failed to add the extras but did slot a penalty as the Blues closed the score to 23-11 and when the fly-half scampered over the comeback looked to be on - only for play to be called back for a knock on.
Madigan opened up the gap again with his penalty of his own to halt the Cardiff resurgence but failed with a drop goal attempt soon after as Leinster saw the game out.
|Cardiff Blues Score Card|
|Leinster Rugby Score Card|