While back squatting, we have our athletes strive to keep their backs straight (this does not mean straight up and down), weight on the heels, and hamstrings under peak tension. Pam Lauper below is doing a nice job here (her depth is legit be assured, the photo was taken when she was a little higher than bottom). Today let's focus on Pam's knee position.
One of our coaching cues is to have our athletes try and keep the "shins vertical" while squatting. Note that as Pam reaches near bottom in her squat, her knees track forward over her feet and her shins become less than straight up and down. As the barbell is always going to be centered over the middle of the foot to keep the human/weight system in balance, her knees have to come forward here to accommodate her personal mechanics, her strength, and her flexibility.
Is her back straight? Yes. Are her hamstrings under peak tension? Clearly. Is she in a stable, balanced bottom position. Absolutely. As she continues to develop as an athlete her shins are likely to be even more vertical. (Imagine her shins stuck in concrete up to her knee, and her femur hinging off that anchored, vertical shin.)
Now let's check out the photo below.
This photo was taken on the ascent out of the hole. See any difference in her shin positioning? You bet. In order to affect maximum hip drive, Pam has pulled her knees back while she is extending her hip. In effect, Pam is shortening her hamstrings from both ends in order to give herself maximum mechanical advantage.
The barbell is still centered over the middle of her foot, her back is still straight, her weight is through her heels, and her hamstrings are still under peak tension.
This position is critical to having a good ascent under heavy load and is actually only temporarily stable. Pam will have to ultimately bring her hips forward to support the barbell load because the enormous, peak isometric contraction of her low back is not sustainable past those few moments of forceful hamstring contraction/ascent.
A common foul in this portion of the squat is to see athletes let the knees stay forward during the ascent, versus pulling the knees backwards as Pam L. is doing above. This compromise happens because either the athlete doesn't have the mid-line strength to temporarily support the load as in the discussion above, or they lack the hamstring strength to simultaneously support a vertical shin and extend the hip.
As an aside, nearly all of the patella pain and torn menisci I see in my physical therapy practice occur because of this knee-forward bottom position during squat ascent.
So, knees are OK to come forward as long as hamstrings are under peak tension. Just don't leave them forward when you stand up.