The hosts took the lead after 19 minutes when Matthew Connolly was left unmarked at the back post to nod home a corner.
The visitors came within inches of getting an equaliser just after the half-hour mark when Emanuel Ledesma fired in a dipping free kick, but his effort struck the crossbar.
Scott McDonald squandered a fine chance to level the sides in first-half stoppage time, but he could only put his shot over when he should have at least made the keeper work.
McDonald had another chance right at the start of the second half but again couldn't find the net, this time David Marshall making the save.
Boro continued to push for an equaliser and perhaps should have had it when Lukas Jutkiewicz had a shooting chance, but he blazed his volley over the top.
Marvin Emnes had two chances in quick succession to find the elusive leveller for the visitors, but he first headed a downward effort that bounced up and over the bar before having a shot deflect behind.
Despite dominating possession in the closing stages, Boro couldn't find a goal as Cardiff leapfrog them up to second in the table.