Carbon dioxide flooding is one of the main methods used to improve crude oil recovery. It can not only improve oil recovery but also reduce greenhouse gas emissions. However, the addition of carbon dioxide makes crude oil become a more complex multiphase fluid; that is, carbon dioxide flooding-produced fluid, in which CO2 and various components in crude oil mass transfer each other. This results in significant changes in the structure and properties of crude oil that increase the hazards associated with its gathering and transportation. Therefore, it is very important to explore the microscopic mechanism for the diffusion mass transfer of CO2 and crude oil in this fluid, especially during its gathering and transportation. In this study, the diffusion mass transfer process of CO2 and crude oil in fluids produced via CO2 flooding is studied using molecular dynamics, and the influences of temperature, gas–oil ratio and water content are explored. Observations of the configuration and dynamic behaviour of the system show that after the system reaches equilibrium, the majority of the CO2 molecules are distributed at the oil–water interface, and CO2 is more prone to diffusing into the oil phase than the water phase. Increases in temperature and water content inhibit, while increases in the gas–oil ratio promote, the diffusion mass transfer of CO2 in the crude oil system. The results of this study reveal the mechanism for the diffusion mass transfer of CO2 and crude oil in fluids produced via CO2 flooding and account for the influence of the water phase, which is consistent with actual production conditions and has certain guiding significance for the safe operation of oil and gas gathering and transportation.