Water, energy and food are the basic resources on which human beings depend for survival. With the intensification of human activities, the demand for resources represented by water, energy and food continues to increase, resulting in increasing pressure on the ecological environment, and the vulnerability of water, energy, food and ecosystem becomes increasingly prominent. Identifying the critical vulnerability factors of the water-energy-food-ecology nexus and formulating targeted management measures have become the key to achieving sustainable development. This paper innovatively proposes to study the water-energy-food-ecology nexus from the perspective of vulnerability for the first time, in which the vulnerability evaluation index system of the water-energy-food-ecology nexus is firstly constructed based on the VSD framework, and the attribute reduction is carried out using neighborhood rough sets. Then, a Bayesian network model is built and parameter learning is performed by combining machine learning and expert experience. Finally, different scenarios are set up to identify the key factors that hinder the vulnerability reduction of the water-energy-food-ecology nexus and obtain the vulnerability probability of the nexus under different scenarios using forward and backward inference and sensitivity analysis of Bayesian networks, overcoming the drawback that many prediction models cannot achieve diagnostic inference. The results show that: 1) from 2008 to 2019, the overall vulnerability of the water-energy-food-ecology nexus in the Yangtze River Economic Belt is low. 2) The key factors at the indicator level that hinder the vulnerability reduction of the water-energy-food-ecology nexus mainly include the storage capacity of water conservancy projects, wastewater discharge per 10,000-yuan GDP, and water consumption per 10,000-yuan GDP, and the subsystem level is water, food, energy and ecology system, in that order. 3) The reduction in vulnerability within an individual subsystem can have a beneficial impact on reducing vulnerability within the water-energy-food-ecology nexus. However, this reduction may also lead to an increase in vulnerability within other subsystems. Therefore, in the process of developing water, energy, food, and ecology system, high priority should be given to the coordinated development of all four.