United had 17 attempts on goal but only three on target with Patrick Bamford inadvertently blocking a goalbound effort from Jack Harrison on the line.
Cardiff then took the lead through Junior Hoilett in the 35th minute after a loose pass from Kalvin Phillips and a rocket of a shot from Robert Glatzel doubled the Bluebirds advantage with 19 minutes left but again after Leeds had given away possession.
United consequently stay second and behind leaders West Brom on goal difference and seven points ahead of third-placed Fulham ahead of next weekend's clash against the Cottagers at Elland Road. Brentford are only one point further back in fourth.
Cardiff made a reasonably bright start with the Bluebirds looking to open up Leeds from set pieces and Hoilett fired just wide but the Whites held firm.
United then began to up the ante with Ben White heading just over and Luke Ayling went close to opening the scoring when flicking a header across goal that needed clearing off the line via Will Vaulks.
A Whites opener looked imminent but from nothing, a loose Phillips pass fell straight to Hoilett who closed in on United's defence before firing past Illan Meslier from the edge of the box in the 36th minute.
Leeds took time to regather their stride but the Whites looked destined to equalise on the stroke of half-time when Harrison fired in a firm low shot from a Tyler Roberts cross but the ball hit Bamford on the line when otherwise looking likely to go in.
United again pressed at the start of the second half and a Helder Costa cross flew through the area only needing a touch but Cardiff then had a chance to double their advantage when Callum Paterson glanced a header just wide.
Yet only a superb save from Smithies denied the Whites a leveller just after the hour as the Bluebirds 'keeper sprinted across his line to somehow keep out a shot from Roberts at a tight angle following a Bamford flick-on.
Bamford was then let down by a heavy touch attempting to latch on to a through ball from Costa before Joe Ralls fired wide at the other end.
But after United again lost possession, Cardiff doubled their lead as substitute Glatzel fired a thumping shot past Meslier in the 71st minute and Glatzel should have added another soon after only to dither when free in the box.
United's afternoon was summed up in the closing stages when Bamford could only poke a cross from Phillips wide before Harrison blazed over from close range in the third minute of added time.
Cardiff City: Smithies; Sanderson, Nelson, Morrison, Bennett; Adomah (Mendez-Laing 65), Vaulks (Tomlin 84), Bacuna, Ralls (Pack 75), Hoilett (Smith 83); Paterson (Glatzel 65). Subs: Etheridge, Flint, Smith, Whyte, Ward.
Leeds United: Meslier, Ayling (Alioski 62), White, Cooper, Dallas, Phillips, Klich (Gotts 84), Harrison, Costa (Poveda 76), Roberts, Bamford. Subs: Miazek, Berardi, Struijk, Davis, Shackleton, Stevens.
Referee: Andy Woolmer.