  Virial shocks at edges of cosmic-web structures are a clear prediction of
standard structure formation theories. We derive a criterion for the stability
of the post-shock gas and of the virial shock itself in spherical, filamentary
and planar infall geometries. When gas cooling is important, we find that
shocks become unstable, and gas flows uninterrupted towards the center of the
respective halo, filament or sheet. For filaments, we impose this criterion on
self-similar infall solutions. We find that instability is expected for
filament masses between $10^{11}-10^{13}M_\odot Mpc^{-1}.$ Using a simplified
toy model, we then show that these filaments will likely feed halos with
$10^{10}M_{\odot}\lesssim M_{halo}\lesssim 10^{13}M_{\odot}$ at redshift $z=3$,
as well as $10^{12}M_{\odot}\lesssim M_{halo}\lesssim 10^{15}M_{\odot}$ at
$z=0$.
  The instability will affect the survivability of the filaments as they
penetrate gaseous halos in a non-trivial way. Additionally, smaller halos
accreting onto non-stable filaments will not be subject to ram-pressure inside
the filaments. The instreaming gas will continue towards the center, and stop
either once its angular momentum balances the gravitational attraction, or when
its density becomes so high that it becomes self-shielded to radiation.
