We find exact nonstatic null-dust solutions in metric fðRÞ gravity, imposed by the constant scalar curvature, which describes the gravitational collapse of null dust in (anti-)de Sitter [(A)dS] higherdimensional (HD) background. The situation where a null dust injects into the initially HD-(A)dS spacetime leads to a naked singularity from gravitational collapse in HD-fðRÞ gravity, violating cosmic censorship conjecture. Further, we find exact null-dust solutions to constant curvature imposed non-Abelian fðRÞ Yang-Mills gauge theory by employing the Wu-Yang ansatz in four dimensions. This generates an identical geometry as one would expect for charge null dust in the Abelian fðRÞ Maxwell theory, i.e., precisely the charged-Vaidya-(A)dS corresponding to Yang-Mills gauge charge. The fourdimensional charged null-dust solutions in the fðRÞ Maxwell theory are also, separately, derived.