Worse executive function (EF) is associated with chronic pain and could mechanistically contribute to pain chronification. It is unclear whether there is overall impairment in EFs or whether there are impairments in specific cognitive domains. Furthermore, the possible genetic risk underlying these associations has not been tested. Participants were from the Colorado Longitudinal Twin study; 786 same-sex twins completed a battery of EF tasks at ages 23 and/or 28 and 634 of these twins self-reported chronic pain at mean age = 28.1; prevalence = 27.76% using the Brief Pain History Questionnaire. The EF tasks were used to define a Common EF factor and 2 factors specific to updating working memory and shifting mental set. We estimated the phenotypic and genetic associations of stable EF variance across ages 23 and 28, as well as EF variance unique to age 28, with pain. With respect to stable EF variance, pain phenotypically correlated with the Updating-specific factor (r = -0.21, P = 0.008) but did not significantly correlate with the Common EF factor (r = -0.06, P = 0.350) nor with the Shifting-specific factor (r = -0.03, P = 0.709). There were no significant phenotypic correlations between pain and EF variance unique to age 28. A twin model indicated that pain and Updating-specific variance share genetic risk (rA = -0.46, P = 0.005) but not environmental risk (rE = 0.05, P = 0.844). Updating working memory shares a phenotypic and genetic relationship with pain in young adults. Impairments in gating or monitoring pain signals may play a mechanistic role in pain development.