Amazon.com Inc. can’t be held liable for an allegedly defective dog leash sold by a third party on its e-commerce site, the U.S. District Court for the Middle District of Pennsylvania ruled Dec. 21.

Amazon merely provides a market for vendors and has no role in selecting the products to be sold, Judge Matthew W. Brann said. The court granted judgment to Amazon on all claims, including strict products liability and negligence, brought by Amazon shopper Heather Oberdorf.

Oberdorf, while walking her dog on Jan. 12, 2015, “suffered severe and permanent injuries to her left eye when the retractable leash...