For a nonconstant elliptic surface over $\mathbb {P}^1$ defined over $\mathbb {Q}$, it is a result of Silverman [‘Heights and the specialization map for families of abelian varieties’, J. reine angew. Math. 342 (1983), 197–211] that the Mordell–Weil rank of the fibres is at least the rank of the group of sections, up to finitely many fibres. If the elliptic surface is nonisotrivial, one expects that this bound is an equality for infinitely many fibres, although no example is known unconditionally. Under the Bunyakovsky conjecture, such an example has been constructed by Neumann [‘Elliptische Kurven mit vorgeschriebenem Reduktionsverhalten. I’, Math. Nachr. 49 (1971), 107–123] and Setzer [‘Elliptic curves of prime conductor’, J. Lond. Math. Soc. (2) 10 (1975), 367–378]. In this note, we show that the Legendre elliptic surface has the desired property, conditional on the existence of infinitely many Mersenne primes.