The VAR-LASSO connectedness method and VAR-X-LASSO connectedness method are employed in this study to explore the intricate spillover relationships between international crude oil markets and global energy stock markets while also examining the impact of geopolitical risks on these spillover relationships. By comparing the connectedness indices derived from the VAR-X-LASSO connectedness method and the VAR-LASSO connectedness method, this paper yields some intriguing empirical findings. First, the net transmitter of systemic shocks mainly appears in energy stock markets within developed countries. Second, we observed the net spillover direction from energy stock markets in most developed countries, especially those in the United States, Canada, France, Italy, Norway and Spain, to international crude oil markets, and the net spillover direction from international crude oil markets to energy stock markets in most developing countries. Third, geopolitical risks have been observed to strengthen the unidirectional spillover intensity from international crude oil markets to energy stock markets, and their influence intensified after 2015. However, there is minimal influence of geopolitical risks on the unidirectional spillover effects from energy stock markets to international crude oil markets.