That used car you're eyeing may be a terrific deal and look great on the lot. It may even have passed the dealership's safety inspection. But it still may not be safe to drive.

While it's against the law for dealers to sell a new car with a safety recall that hasn't been addressed, it’s legal for them to sell a used car with one. That means you could be driving off the used car lot with a vehicle that poses a small or large danger.

Here are some examples of recent reasons cars have been recalled by their manufacturers:

  • An oil leak that can cause a car to spontaneously catch on fire. A car with this problem should not even be parked in a carport or garage, according to the manufacturer.
  • Airbags that may explode and kill the driver and/or front seat passenger.
  • Metal debris in the crankshaft that can cause a car to stop unexpectedly.
  • Suspension problems that make it difficult to brake.
  • Doors that unlatch and fall open while the car is being driven.

There's a good chance you won't find out about the recall until you've agreed to buy the car and are signing a stack of papers.

Related: How to Buy a Safe Used Car

Several consumer advocacy groups say it’s time to close the loophole. These include The Safety Institute, a nonprofit that focuses on injury prevention, and the New England-based consumer advocacy group MASSPIRG.

Recently, MASSPIRG joined WCVB-TV of Boston in an investigation of one of the country’s largest used car dealer chains. A check of all vehicles on one of the chain’s used car lots in October 2015 revealed 17 percent of the cars had open recalls for safety defects, including some so serious a remedy wasn't yet available.

Steer clear of buying a clunker

To protect yourself, take these steps before you buy a used car right there on the lot.

  • Look for the VIN, or vehicle identification number, on the dashboard of the drivers’ side of the vehicle you're interested in. The VIN is the “fingerprint” for a specific car. For all cars made after 1981, it should be exactly 17 characters long and include letters and numbers.
  • Using your smartphone, go to the recalls and defects page of the National Highway Traffic and Safety Administration (NHTSA) website and click on "vehicle recalls."
  • Look for a button that says “Search for recalls by VIN.” Plug in the VIN of the used car you’re thinking of buying, and you’ll find out if it has any open recalls.

If there are one or more open recalls and you still want to buy the car, ask the dealer how to go about getting it repaired. Under federal law, manufacturers involved in a recall have to fix problems free of charge, usually by a local dealership.

Sen. Ed Markey of Massachusetts would like to spare used car buyers all that trouble in the first place. He has co-sponsored a bill that would make it a violation of federal law for a dealer to sell a used car with a safety recall without first getting the problem fixed.

"Whether a car is brand new or used,” Markey told WCVB-TV, “we need to make sure that all cars are safe before they leave the lot."

Related: 5 Ways to Keep Your Tween Safe in the Car

Diana is an award-winning writer and editor with more than 20 years' experience in magazine, video, book and digital journalism, with a specialty in health coverage. She was a longtime writer and news editor at the Center for Investigative Reporting; has written for publications from the Washington Post to the Times of London syndicate; and has served as a senior and/or consulting editor at Time Inc. Health, Hippocrates, HealthDay News Service and Reporting on Health. She was also editor in chief of Consumer Health Interactive, a national health and medical web site, and has reported on finance for Blueshift Research and PBS Frontline. Before joining SafeBee, she was editor of Bioenergy Connection, a national magazine about bioenergy at UC Berkeley. Her favorite safety tip: Wear a bike helmet.