Impairments in inhibitory control and in stimulus-driven attention are hallmarks of drug addiction and are associated with decreased activation in the right inferior frontal gyrus (IFG). Although previous studies indicate that the response inhibition function is impaired in abstinent heroin dependents, and that this is mediated by reduced IFG activity, it remains completely unknown whether and how an acute dose of heroin modulates IFG activity during cognitive control in heroin-dependent patients. This study investigates the acute effects of heroin administration on IFG activity during response inhibition and stimulus-driven attention in heroin-dependent patients. Using a cross-over, double-blind, placebo-controlled design, saline and heroin were administered to 26 heroin-dependent patients from stable heroin-assisted treatment, while performing a Go/No-Go event-related functional magnetic resonance imaging task to assess right IFG activity during motor response inhibition, as well as during oddball-driven attention allocation. Relative to saline, heroin significantly reduced right IFG activity during both successful response inhibition and oddball-driven attention allocation, whereas it did not change right IFG activity during response inhibition after correction for the effect of attention allocation. These heroin-induced effects were not related to changes in drug craving, state anxiety, behavioral performance, or co-consumption of psychostimulant drugs. This study demonstrates that heroin administration acutely impairs stimulus-driven attention allocation, as indicated by reduced IFG activity in response to infrequently presented stimuli, and does not specifically modulate IFG activity during response inhibition.