She can't sell it until the numerous code violations are fixed. Unfair as it is, "she's stuck with it," Yantorno says. "It's her problem now."

Buyers beware
Substandard construction is nothing new. But it seems to have been popular in the foreclosure crisis. "A lot of unlicensed people were doing work. People were flipping houses, doing a few repairs and trying to sell them. Owners were trying to do work themselves," Pieczynski says.

The lesson: Investigate any home purchase thoroughly before buying, even if the house seems in perfect condition:

  • Get the history: Ask the homeowner or the listing real-estate agent for a history of work done to the home. "If you ask the seller, 'Did you have a permit for this?' and he lies to you, you may have an action for what's called a 'fraudulent conveyance,'" Pieczynski says.
  • Find the record: Visit the city or county permit agency to see the file for the address of the home you're considering. The file should contain any building permits taken out for the home. It's a red flag if you know work was done but you can't find the permits.
  • Get help: On the International Code Commission's map, you'll find permit information and contacts for many local and state building and licensing authorities. Caveat: Not all cities and counties participate.

License and insurance
Even if a permit isn't required, you're supposed to hire licensed and insured workers. Do-it-yourselfers usually get an exception, but they must use licensed professionals for structural, electrical and plumbing work. The exception doesn't cover your brother-in-law or his pal Morty, the unlicensed contractor.

Each state differs in its approach. California, for example, requires licensed workers for "all but the most mundane forms of home maintenance," says Peter Brewer, a Palo Alto, Calif., attorney who's an expert in housing and real-estate issues. "Cleaning your windows, no. Replacing your windows, yes. Doing roof repair, absolutely. Building a fence, yes," Brewer says. Call your local government to learn the requirements.

It's tempting to hire someone cheap, but the drawbacks can be severe. "If you don't have a contractor and you hire unlicensed persons, you are the de facto general contractor, and you are on the hook for defective work for up to 10 years," Brewer says.

Even a contractor's license doesn't completely protect you. A contractor also needs two kinds of insurance: liability, to compensate you if the work fails, and workers' compensation insurance, in case someone is injured on the job.

To protect yourself:

  • Ask to see a contractor's license and proof of insurance.
  • Make and keep photocopies.
  • Phone your state licensing agency (found here, through the National Association of State Contractor Licensing Agencies or at the Contractors' License Reference Site) to confirm it is current.
  • Phone the insurance agent to ensure that the policy is in force.

Otherwise? Well, here's another cautionary tale, from a cooperative housing community in Washington state. The group hired help to build a community hall, followed all the rules, obtained permits and purchased workers' comp insurance for its contractors and volunteers.

But after most of the work was finished, they hired a contractor for one more job. A member of the community recalls, "We did not know he had recently dropped his license and coverage. We should have verified his coverage, and we did not." The worker fell from a ladder. His medical care cost the community thousands of dollars.