At low redshifts, the observed baryonic density falls far short of the total number of baryons predicted. Cosmological simulations suggest that these baryons reside in filamentary gas structures, known as the warm-hot intergalactic medium (WHIM). As a result of the high temperatures of these filaments, the matter is highly ionised such that it absorbs and emits far-UV and soft X-ray photons. Athena, the proposed European Space Agency X-ray observatory, aims to detect the `missing baryons in the WHIM up to redshifts of $z=1$ through absorption in active galactic nuclei and gamma-ray burst afterglow spectra, allowing for the study of the evolution of these large-scale structures of the Universe. This work simulates WHIM filaments in the spectra of GRB X-ray afterglows with Athena using the SImulation of X-ray TElescopes (SIXTE) framework. We investigate the feasibility of their detection with the X-IFU instrument, through O VII ($E=573$ eV) and O VIII ($E=674$ eV) absorption features, for a range of equivalent widths imprinted onto GRB afterglow spectra of observed starting fluxes ranging between $10^{-12}$ and $10^{-10}$ erg cm$^{-2}$ s$^{-1}$, in the 0.3-10 keV energy band. The analyses of X-IFU spectra by blind line search show that Athena will be able to detect O VII-O VIII absorption pairs with EW$_mathrm{O VII} > 0.13$ eV and EW$_mathrm{O VIII} > 0.09$ eV for afterglows with $F>2 times 10^{-11}$ erg cm$^{-2}$ s$^{-1}$. This allows for the detection of $approx$ 45-137 O VII-O VIII absorbers during the four-year mission lifetime. The work shows that to obtain an O VII-O VIII detection of high statistical significance, the local hydrogen column density should be limited at $N_mathrm{H}<8 times 10^{20}$ cm$^{-2}$.