1st person camera goes through walls

I have a problem with the camera. I added motion to the bones of the spine when I tilted the character, but now the camera began to pass through the walls if I come close to them. Same problem when I squat down and look down.