WASHINGTON (CNN) -- Thousands of buildings at U.S. bases in Iraq and Afghanistan have such poorly installed wiring that American troops face life-threatening risks, a top inspector for the Army says.

These wires installed in Iraq are some of the most important to ensure safety. They all need to be replaced.

"It was horrible -- some of the worst electrical work I've ever seen," said Jim Childs, a master electrician and the top civilian expert in an Army safety survey. Childs told CNN that "with the buildings the way they are, we're playing Russian roulette."

Childs recently returned from Iraq, where he is taking part in a yearlong review aimed at correcting electrical hazards on U.S. bases. He told CNN that thousands of buildings in Iraq and Afghanistan are so badly wired that troops are at serious risk of death or injury.

He said problems are "everywhere" in Iraq, where 18 U.S. troops have died by electrocution since 2003. All deaths occurred in different circumstances and different locations, but many happened on U.S. bases being managed by various military contractors. The Army has reopened investigations in at least five cases, according to Pentagon sources.

Of the nearly 30,000 buildings the Army's "Task Force Safe" has examined so far, Childs said more than half "failed miserably." And 8,527 had such serious problems that inspectors gave them a "flash" warning, meaning repairs had to be completed in four hours or the facility evacuated.

He said the majority of those buildings were wired by contractor KBR, based in Houston, Texas. KBR has faced extensive criticism from Congress over its performance in the war zone. KBR has defended its performance and argued it was not to blame for any fatalities.

Military electrocutions became a national issue about a year ago, after the January 2008 death of Staff Sgt. Ryan Maseth of Pittsburgh, Pennsylvania. A decorated member of the Army's Green Berets, Maseth was electrocuted in his shower at a U.S. base in Baghdad that once served as one of Saddam Hussein's palaces.

His death was blamed on improper grounding and dangerous wiring on his living quarters. Soon after that, the Army asked Childs to help create "Task Force Safe," a team of master electricians assigned to inspect Army posts for electrical dangers.

Childs said the "large majority" of the buildings the task force examined in Iraq had been wired by KBR, which he expected would follow American standards. But the results, he said, were "just horrible."

In one building, "I had them pull a switch out of the wall to look at a switch, and when they pulled it out of the wall, the wires fell out of it," Childs said. Thinking that was an exception, "We pulled the one next to it. They fell off," he said. "It was just very, very poor quality work."

Much of the work was done by crews from countries beyond Iraq, "with very little supervision by anybody." And many of the problems involved improperly grounded systems that allowed plumbing to conduct electricity, which he said could lead to electric shocks such as the one that killed Maseth.

Childs said service orders on at least two occasions warned of the hazard in Maseth's quarters, and "two simple electrical 101s" should have been checked out by electricians.

"A competent electrical contractor and electrician would have gone to that job site and tried to discover why pipes could have been energized," he said. If they had been, "then Ryan Maseth would not have been electrocuted, in my opinion."

Maseth's family is suing KBR. An Army investigator has recommended that his cause of death be changed to "negligent homicide," accusing the company of failing to properly supervise or inspect its work. The Army has yet to accept the recommendation.

KBR has repeatedly said it was not responsible for Maseth's death or for any of the others and defended its work.

"KBR has worked diligently to address electrical issues when asked," the company told CNN in a written statement. "What is important to remember is the challenging environment in which these issues exist.

"The electrical standards in Iraq are nowhere near those of Western or U.S. standards. Add to this the challenges that exist in a war zone. We have been and remain committed to fully cooperating with the government on this issue."

But Childs said the majority of buildings on U.S. bases were built and wired by KBR since the U.S. invasion.

"They installed the housing units, they installed the electrical, they installed the wiring. They installed it all. And it's wrong," he said. "It's all put in wrong."

KBR was not alone, however. He said the Army survey found problems with every contractor whose work it inspected.

Task Force Safe has yet to inspect another 70,000 buildings in Iraq and has just begun its review of bases in Afghanistan, where contractors have raised similar concerns. In written answers to questions from CNN, Pentagon spokesman Chris Isleib said, "We are correcting hazardous conditions every day."

"This is a huge undertaking but absolutely necessary for the life, health and safety of our service members and civilians," he said. "When we find a defect, we put in an emergency work order and take action immediately to protect the people working or living in those facilities."

But Childs told CNN he is surprised more Americans have not been hurt.

"All the potentials are there," he said. "It just hasn't happened."

All About Afghanistan • KBR Inc. • U.S. Army Activities • Iraq