Salah opened the scoring inside 10 minutes when he swept home from eight yards out, after both Mane and Roberto Firmino had efforts blocked in a goalmouth scramble.
The Reds were completely dominant in the first half, enjoying 84% possession and registering 12 shots to Cardiff's zero, but they could not extend their advantage as Sean Morrison cleared Adam Lallana's stoppage-time header off the line.
Mane gave Liverpool some comfort on 66 minutes, but that was short lived as Callum Paterson became the first visiting player to score in the league at Anfield since February. A late double from substitute Xherdan Shaqiri and Mane made it three wins in a week for Jurgen Klopp's men.
Relive how the action unfolded on Merseyside with Sports Mole's minute-by-minute updates.
Subs: Mignolet, Matip, Gomez, Robertson, Milner, Shaqiri, Sturridge
Subs: Smithies, Cunningham, Connolly, Damore, Harris, Madine, Zohore