The context of the paper is the 50-60 Hz electromagnetic interference between AC power lines/electrified railway lines and pipelines; we present here an algorithm for the evaluation of the AC induced current density, flowing through the holidays (defects) in the pipeline insulating coating, from pipe to soil by modelling this last one as a two-layer structure. Moreover, the value of holidays area is treated as a random variable (as actually is from field experience) so allowing to associate a certain level of probability to the event of exceeding the AC current density limit, established by standards, for AC corrosion risk. The results show that the surface layer soil resistivity is a very significant factor influencing the level of AC induced current density.