Has there been a game of master level or above in which one player did not move any piece or pawn beyond the third or fourth rank?
Thanks for your question and welcome to chess.stackexchange :-) This is the kind of question which Tim Krabbe would have answered fascinatingly!
I choose to focus on the question where both players didn’t move beyond the fourth rank. There must be thousands of games where one player kept back.
Early games from the “romantic” period which featured open openings and aggressive sacrifices were the norm until the end of the 19th century. So don’t expect anything from that time.
Later, the revolution led by Reti and Nimzowitch led to much more positional play with indirect control of the centre from a distance. However, it seems unlikely to be able to win such a game, without moving forwards.
If neither player moved beyond the 4th rank, then no captures have taken place. So it’s hard to see what kind of winning advantage one side could have accrued. There must be many agreed draws, but they don’t really count. I would be very interested to see what a won game would look like with this constraint, as I can’t imagine it.