We obtain a full characterization of Einstein-Maxwell p-form solutions (g, F) in D dimensions for which all higher-order corrections vanish identically. These thus simultaneously solve a large class of Lagrangian theories including both modified gravities and (possibly non-minimally coupled) modified electrodynamics.
Specifically, both g and F are fields with vanishing scalar invariants and further satisfy two simple tensorial conditions. They describe a family of gravitational and electromagnetic plane-fronted waves of the Kundt class and of Weyl type III (or more special).
The local form of (g, F) and a few examples are also provided.