There is increasing appreciation of the need to understand how social and structural factors shape HIV risk. Drawing on a review of recently published literature, we seek to describe the social structural production of HIV risk associated with injecting drug use. We adopt an inclusive definition of the HIV 'risk environment' as the space, whether social or physical, in which a variety of factors exogenous to the individual interact to increase vulnerability to HIV. We identify the following factors as critical in the social structural production of HIV risk associated with drug injecting: cross-border trade and transport links; population movement and mixing; urban or neighbourhood deprivation and disadvantage; specific injecting environments (including shooting galleries and prisons); the role of peer groups and social networks; the relevance of 'social capital' at the level of networks, communities and neighbourhoods; the role of macro-social change and political or economic transition; political, social and economic inequities in relation to ethnicity, gender and sexuality; the role of social stigma and discrimination in reproducing inequity and vulnerability; the role of policies, laws and policing; and the role of complex emergencies such as armed conflict and natural disasters. We argue that the HIV risk environment is a product of interplay in which social and structural factors intermingle but where political-economic factors may play a predominant role. We therefore emphasise that much of the most needed 'structural HIV prevention' is unavoidably political in that it calls for community actions and structural changes within a broad framework concerned to alleviate inequity in health, welfare and human rights.