No matter how dreamy a home looks at first glance, lurking behind those neatly painted walls could be some truly terrifying things. We’re not talking about ghosts or bats, but things like small cracks in the ceiling, tiny holes in the drywall, or a musty odor in the basement—seemingly minor issues that should make you very, very afraid.

Rest assured, we’re not trying to scare you from buying a home altogether! We simply want to provide you with a list of red flags to watch out for, because they could cause health problems or cost major money to fix. All in all, they are headaches that you’ll want to avoid—or, at least, point out to the sellers so you can negotiate down that list price. So if you find any of these problems, make sure to proceed with caution.

1. Polybutylene pipes

Pipes made from polybutylene had their heyday as a cheap alternative to copper in the ’80s and early ’90s—by some estimates they were installed in up to 10 million homes in the U.S. from 1978 and to 1995. But this cost-cutting option backfired for many homeowners.

“They were found to degrade due to the chlorine in municipal water supplies, and would spontaneously leak and cause terrible flooding,” says Welmoed Sisson, a home inspector with Inspections by Bob in central Maryland.

To find these offenders without opening any walls, look at the exposed pipes near the water heater. If they’re stamped with the code PB2110, you should delve further to see how much of the house has them. Even if these pipes haven’t leaked yet, it’s likely only a matter of time before they do. Unfortunately, you can’t rely on home insurance to shoulder the costs, since most insurance plans don’t cover water damage from polybutylene plumbing pipe ruptures. The only pre-emptive fix is total pipe replacement to the tune of $10,000 and up. Frightening!

2. Aluminum wiring

Faulty wiring is the leading cause of residential fires, a study by the National Fire Prevention Association found. Specifically, aluminum wiring—which was popular during the Vietnam War era due to a copper shortage at the time—could mean big trouble.

“It was cheaper than copper, and builders used a lot of it,” says Sisson. “Problem is, aluminum expands and contracts in the heat more than copper, which causes the connections to loosen up, and then you get fires.”

The upshot? Electrical problems are easy to spot. Warning signs include dimming or flickering lights, discolored outlets, and switch plates that are warm to the touch. Circuits rewired or added from 1965 to 1973 are at particularly high risk of being aluminum. The easiest place to check for aluminum wiring is near the circuit box, where these wires are exposed; look for silver wires rather than the usual copper.

To fix the issue, you might have to replace the entire wiring system with copper. This can cost thousands of dollars, because the wires are located inside of walls, making them difficult to access.

According to HouseLogic, the price for a whole-house rewiring job—including opening up walls, running new wires, connecting switches, outlets, and fixtures, and then repairing the mess—is $3,500 to $8,000 for an average-size home.

3. Mold

This dangerous fungus can cause a long list of health issues, including respiratory problems like coughing and wheezing, headaches, fatigue, and even severe allergic reactions like fever and shortness of breath. Mold thrives particularly in damp, warm environments such as a bathroom or basement. It can also form behind a wall if there’s water damage from, say, a leaky roof or faucet.

Health concerns aside, mold can cost a ton of money to remove. Mold remediation costs from $500 to $6,000, but the price can soar into the tens of thousands if the problem is severe.

Fortunately, mold is relatively easy to spot, because there’s often a damp or musty smell. Other indicators of mold include stains, discolored walls, and black spots.

4. Termites

Termites are small in size, but they pose a huge threat. Termites are considered the top threat to wood-based structures, ahead of fire, flood, and wind. Each year, these devilish insects cause about $5 billion in damage nationwide.

Termites “can literally eat your home,” says Joshua Jarvis, founder of Jarvis Team Realty in Duluth, GA, making the wood structure unstable.

Therefore, if you’re buying an existing home, your offer should always be contingent on a termite inspection, especially since “homeowners insurance does not cover damage from insects, whether it’s from termites, bedbugs, or another infestation,” says Stacey Giulianti, a lawyer in Boca Raton, FL.

Signs of termite damage include hollow-sounding wood, groups of flying insects (“swarmers”), or piles of wings, cracked or distorted paint on wood surfaces, or small holes in the drywall.

5. Foundation issues

A small crack in the ceiling might not look like a big deal, but it could be indicative of a larger problem with the foundation—which would be very bad news.

“Foundation cracks, bulges, and other irregularities can be extremely expensive to repair, and may even involve excavating the soil around the house to stabilize the walls,” says Sisson. “So correcting the problem can also mean extensive landscaping repair.”

If the house requires a brand-new foundation, you could be looking at up to $40,000 to get it replaced.

Telltale signs of foundation problems include cracks on walls, floors, columns, and window and door openings; doors or windows that stick when you try to open or close them; bowing basement walls (where pressure from outside the walls has caused them to bend inward); leaning chimneys; and sinking front porches and stoops.

Daniel Bortz is a Realtor in Maryland, Virginia, and Washington, D.C., who has written for Money magazine, Entrepreneur magazine, CNNMoney, and more.