Yttria-stabilized zirconia (YSZ) is highly valued for its high ionic conductivity and thermal stability, making it indispensable in high-temperature applications like solid oxide fuel cells. However, performance in YSZ is intricately related to the behavior of impurities at grain boundaries, especially with respect to their effect on ionic transport. The present work systematically investigates segregation behaviors of aluminum (Al) and iron (Fe) impurities in YSZ grain boundaries by using molecular dynamics simulations. We have investigated the dynamics of Al and Fe impurities across two grain boundary configurations, symmetric and mixed boundaries, with respect to their relative impacts on oxygen ionic conductivity. Our findings indicate that Al impurities, because of its relatively low solubility, have a tendency to segregate extensively along the grain boundaries and, therefore, reducing significantly the ionic conductivity. On the other hand, impurities like Fe exhibit a lesser tendency to segregate and, hence, can potentially stabilize the crystal structure of YSZ without adversely impacting conductivity. Since both ions, Al and Fe, are positive ions, the barrier of ion diffusion at grain boundaries is enhanced, further affecting the overall conductivity of both species. These results improve our understanding of the impurities segregation in YSZ while providing pathways to optimize the electrochemical performance of YSZ-based devices by manipulating impurities concentrations and grain boundary engineering.