The modern oil and gas industry, driven by a surging global energy demand, faces the challenge of exploring deeper geological formations. Ensuring the robust performance of drilling fluids under harsh wellbore conditions is paramount, with elevated temperatures and salt contamination recognized as detrimental factors affecting the rheological and filtration loss properties of drilling fluids. We successfully synthesized a polyethyleneimine-grafted graphene oxide nanocomposite (PEI-GO), and its functional groups formation and thermal stability were verified through Fourier Transform Infrared Spectroscopy (FTIR) and Thermogravimetric Analysis (TGA). Our findings demonstrated a significant improvement in the plastic viscosity and yield point of the base drilling fluid with the addition of PEI-GO. The inclusion of 0.3 wt% PEI-GO outperformed the base drilling fluid at 160 °C, improving the yield point/plastic viscosity (YP/PV) value and reducing filtration loss volume by 42% and 67%, respectively. The Herschel-Bulkley model emerged as the superior choice for characterizing rheological behavior. PEI-GO exhibited compatibility with high-salt formations, maintaining satisfactory filtration volumes even when subjected to sodium chloride (NaCl) and calcium chloride (CaCl2) contamination concentrations of up to 20 and 10 wt%, respectively. The remarkable rheological and filtration properties of PEI-GO are attributed to its electrostatic interactions with clay particles through hydrogen and ionic bonding. These interactions lead to pore plugging in the filter cake, effectively preventing water infiltration and reducing filtration loss volume. This study emphasizes the potential of PEI-GO in water-based drilling fluids, particularly in high-temperature and salt-contaminated environments.