Conrad Ukropina kicked a career-high four field goals, including a personal best-tying 52-yarder in the first half, to help the Cardinal (6-3, 4-3 Pac-12) become bowl eligible.
Stanford sputtered offensively much of the day and had to overcome three fumbled snaps by quarterback Keller Chryst but held on to win its seventh straight against Oregon State (2-7, 1-5).
The Cardinal did it behind another strong outing by its defense, which intercepted Beavers quarterback Marcus McMaryion twice in the second half.
McCaffrey, whose 51-yard run in the first half helped set up Ukropina's second field goal, scored on a one-yard run in the third quarter. The 2015 Heisman Trophy finalist was also stopped on a 4th-and-1 plunge late in the fourth quarter.
It's the 16th 100-yard game for McCaffrey since the start of the 2015 season.
Love, a sophomore who filled in when McCaffrey was injured earlier this season, finished with 89 yards on nine carries. The Cardinal had 365 yards rushing as a team.
Stanford's ground game was key on a day Chryst was more effective running the ball than throwing it in his second career start. Chryst completed 10 of 17 passes for 60 yards but rushed for 83 including a 44-yard keeper that set up McCaffrey's touchdown.
The win puts Stanford in line for a bowl bid. The Cardinal have played in the Rose Bowl three of the past four years but aren't in the running for the Pac-12 title this time around despite going into the season as favorites.
Ryan Nall rushed for 77 yards on 10 carries for Oregon State. The Beavers have lost four straight and six of seven.
Oregon State: Nall had another solid afternoon running the ball but not much else went right for the Beavers. The offense failed to generate a single first down on four drives and committed a pair of turnovers. That was simply too much to overcome for coach Gary Andersen's team.
Stanford: It's been a rough season for coach David Shaw and his staff but they're still headed for the postseason and that's a positive. Even without much production from the passing game this was an easier-than-it-looked win for the Cardinal. McCaffrey and Love gave the offense a much-needed boost but it was the defense again that made the difference.
Oregon State: The Beavers finally catch a break in the schedule with their Nov. 12 trip to UCLA. The Bruins have dropped four straight this season but beat Oregon State 41-0 in Corvalis a year ago.
Stanford: The Cardinal travel to Eugene to face the Oregon Ducks on Nov. 12 in a meeting between two former Pac-12 champions who have fallen on rough times. Stanford has lost 11 of the previous 14 games against Oregon, including last year's 38-36 loss.