After a shaky start to the season, United is unbeaten in 10 games, but Kim's late header slowed its revival and left the team sixth in the standings.
Cardiff, which beat Manchester City at home earlier this season, is in 15th with 13 points from 12 games.
Rooney had a chance to steal the win for United just after Kim's equalizer when he suddenly found himself alone with Marshall, but opted not to shoot and tried to pull the ball back for Danny Welbeck instead. However, the pass was much too weak and Marshall dove down to scoop it up.