Cardiff ended Crystal Palace's run of more than 10 hours of football without conceding a goal as the hosts edged a hard-fought Championship game.
Kenny Miller drove a fine shot into the bottom corner from Kevin McNaughton's lay-off to break the deadlock.
Then Peter Whittingham, who had hit the bar in the first half, added a late second with a spectacular free-kick.
Sean Scannell was lively for Palace and drew a good save from Tom Heaton, but Cardiff dominated after the break.
Cardiff were forced to make one change from the side that beat Derby in midweek as goalkeeper Tom Heaton made his first league start of the season, replacing the ill David Marshall.
Mile Jedinak returned to Palace's line-up after being rested for the goalless draw with Portsmouth on Tuesday, while Sean Scannell was recalled with Jonathan Parr and Darren Ambrose dropping out.
The visitors had not conceded in a remarkable 550 minutes of action but they nearly fell behind after less than three minutes, when Miller's glancing header from Craig Conway's left-wing cross went narrowly wide.
At the other end, Scannell's fierce 20-yard drive was turned over by Heaton, who then held on to Dean Moxey's header from the resulting corner.
The Eagles continued to grow in stature as the half wore on but Cardiff had the best chance when Whittingham's 25-yard strike cannoned off the bar.
Conway blazed over from a decent position at the beginning of the second half but Cardiff nearly took the lead when Miller broke through on goal and Speroni had to be at his best to deny the Scotland striker.
With the home support urging Cardiff on, Whittingham struck wide from just outside the area moments later as the home side continued to apply considerable pressure.
But it took a fine move on 67 minutes to finally break Palace's resistance, with McNaughton taking Andrew Taylor's cross and laying the ball back for Miller to blast low past Speroni.
It was the first goal Palace had conceded since John Carew had given West Ham a 2-2 draw at Selhurst Park on 1 October.
But it took just another 11 minutes for the Eagles' defences to be breached once again.
Jermaine Easter fouled McNaughton on the edge of the area and midfielder Whittingham stepped up to find the top corner of the net with his free-kick to settle matters.