Theory of mind (ToM) is an aspect of social cognition impaired in different addictive disorders, including opioid addiction. This study aimed at replicating ToM deficits in opioid dependent patients undergoing opioid maintenance treatment (OMT) and exploring the influence of substance use related variables, executive functions and childhood maltreatment on ToM in opioid dependent patients. 66 opioid dependent patients were tested using the Movie for Assessment of Social Cognition (MASC) and compared with the data of healthy controls. Furthermore, the opioid dependent patients underwent testing for executive functions and filled in the Childhood Trauma Questionnaire (CTQ). Performance on the MASC was significantly poorer in the opioid dependence group than in the control group, even when recent additional drug use and psychiatric comorbidities were controlled for. No correlations were found between ToM and substance use related factors. Aspects of ToM performance in opioid dependent patients correlated significantly with different EF domains. ToM correlated significantly with the CTQ scales for physical maltreatment. The results confirm impaired ToM in opioid dependent patients and highlight executive functions and childhood maltreatment as influential factors. The lack of associations between ToM and substance use related variables and the association with childhood maltreatment suggest that ToM impairments might be a risk factor predating substance abuse.