SAN FRANCISCO — Lenovo Group Ltd. must face a class action over the pre-installed software that consumers claim compromised the performance of notebook computers and left them vulnerable to cyberattacks, a federal judge ruled Thursday.

U.S. District Judge Ronald Whyte of the Northern District of California denied Lenovo’s request to dismiss a wide swath of plaintiffs’ privacy and consumer protection claims. The judge certified a nationwide class of consumers who purchased the laptops from someone other than Lenovo, but declined to certify a class of consumers who purchased directly from Lenovo.