Messi won a spot-kick with a trademark surge into the box in the 26th minute, being brought down by Adnan Kovacevic.
The Barcelona skipper picked himself and converted the penalty, making the Hungarians the 36th different victims he has scored against in the Champions League – extending a record he already held.
The goal also meant that Messi has scored in 16 Champions League seasons, a feat only previously achieved by Manchester United wing legend Ryan Giggs. Messi, however, becomes the first player to achieve the stat in consecutive seasons.
Barcelona survived a scare when Ferencvaros winger Tokmac Nguen rattled the woodwork with an effort in the 20th minute, but went in at half-time 2-0 to the good when teenage sensation Ansu Fati continued his remarkable rise by poking home a cross from Frenkie de Jong on 42 minutes.
Barcelona boss Ronald Koeman is taking charge of the team in the Champions League for the first time, in a group which also includes Cristiano Ronaldo’s Juventus and Dynamo Kiev.