The 29-year-old, who joined the Teessiders from Bristol City for a £7m fee last summer, has signed a three-year deal.
Cardiff are to pay an initial fee of £4m, which could potentially rise to £6m.
Flint, who made 39 appearances for Boro last season, said: “I would like to thank the Boro fans for their support last season.
"There’s no hiding from the fact it was a disappointing year and we didn’t achieve what we wanted to achieve, but the club is in good hands with the new coaching team and I wish them all the best for the future.”
Mindful of the requirements of Financial Fair Play (FFP), Boro are one of several teams who are cutting their cloth in the transfer market and adopting a prudent approach to incoming business.
The club have made just one signing so far in the close season, in the shape of former goalkeeper Tomas Meijas, who has arrived as back-up to first-choice custodian Darren Randolph.
Flint is likely to replace Bruno Manga at Cardiff, with the Bluebirds having accepted a £3m bid from French side Guingamp.