  We analyze the properties that any late-time modification of the $\Lambda$CDM
expansion history must have in order to consistently solve both the $H_0$ and
the $\sigma_8$ tensions. Taking a model-independent approach, we obtain a set
of necessary conditions that can be applied to generic late-time extensions.
Our results are fully analytical and merely based on the assumptions that the
deviations from the $\Lambda$CDM background remain small. For the concrete case
of a dark energy fluid with equation of state $w(z)$, we derive the following
general requirements: (i) Solving the $H_0$ tension demands $w(z)<-1$ at some
$z$ (ii) Solving both the $H_0$ and $\sigma_8$ tensions requires $w(z)$ to
cross the phantom divide. Finally, we also allow for small deviations on the
effective gravitational constant. In this case, our method is still able to
constrain the functional form of these deviations.
