I take photos with my phone (a Galaxy S9) frequently and this problem seems to plague me every time I try taking photos indoors near a window during daytime. The light from the window which is above the table seems to be leaking into the image and it messes with the white balance very badly, along with producing a photo that looks like it was taken with a smudged lens. The first image below is the photo taken on auto mode normally. The second one is similar but I used my finger to cover the top of the lens where the light is leaking in. I put my finger as close as possible to the lens without having it show up in the image. As you can see, the second photo came out much better, without any sunlight leaking in from the top. As a result, the colors are so much better in the second image compared to the first. Is this a problem with my lens, my photography skills, or is it something else?
It is stray light hitting the glass covering the lens element or grease from fingers etc. that leaves residue on this glass and then leaves a milky glare when light hits it. You can usually improve the image quality a lot by simply cleaning the glass. (Or as you did, by covering as much of the glass as possible from being exposed to light). The same glare can be seen if the glass has been scratched, but obviously cleaning the glass does not help then.