By using the scattering of a scalar field, we discuss the thermodynamics and overcharging problem in a 4D Gauss-Bonnet AdS black hole in both the normal phase space and extended phase space.In the normal phase space, where the cosmological constant and Gauss-Bonnet parameter are fixed, the first law and the second law of thermodynamics are valid. In addiction, the black hole cannot be overcharged and the weak cosmic censorship conjecture is valid. In the extended phase space, where the cosmological constant and Gauss-Bonnet parameter are treated as the thermodynamic variables, the first law is still valid. However, the second law is indefinite. Moreover, after the scattering of the scalar field, the extremal black hole cannot be overcharged and the near-extremal black hole can be overcharged.