The Russia-Ukraine conflict has severely impacted global food security. This may increase the risk of supply chain disruption in low-income countries that rely heavily on grain imports. This study used production and trade data for wheat, barley and maize from 1995 to 2021 to construct longitudinal trade networks. On this basis, a cascading failure network model of shock propagation was used to identify the direct or indirect dependence of other countries on grain exported from Russia and Ukraine and the impact caused by trade shocks. The results revealed that the interruption of grain exports from Russia and Ukraine has resulted in an increasing impact on the global grain trade year by year and that the wheat trade is the most vulnerable to shock propagation, but it is also the most resilient. Russia and Ukraine interrupt exports of grain, causing more than 50% reduction in direct imports to 30 countries, including Eritrea, Seychelles, Kazakhstan and Mongolia. A shock propagation model that considers indirect dependence yields divergent results, with lower middle income (LM) countries in North Africa, Southeast Asia and West Asia facing supply shocks from reduced imports because they are unable to fully exploit the trade channels to balance grain supply and demand. Under the COVID-19 pandemic, this indirect dependence on imports is more prominent. It is worth noting that Eastern and Southern European countries often act as intermediaries to spread shocks during cascading failures. In the process of shock propagation, the main suppliers of grain include the United States, Canada, France, Argentina and Brazil. After the outbreak of COVID-19, the import demand faced by Australia increased significantly. We also examined how nodal characteristics relate to shock propagation dynamics and country vulnerability, finding that high import diversity, low import dependence and regional characteristics are effective in buffering countries from supply shocks. This study contributes to our understanding of the external supply risks for grain arising from the Russia-Ukraine conflict in a pandemic context, highlights the issue of accessibility in food security and provides trade policy recommendations to mitigate national vulnerability to food insecurity, thereby creating a resilient food trade system.