Boeing Co. failed to identify two “critical software defects” before the test flight of its Starliner spaceship in December, either of which could have proved disastrous, NASA said.

“Breakdowns” in the design phase led to the company missing the problems “despite their detectability,” the National Aeronautics and Space Administration said Friday as it reported findings from a review of the company’s work.

The errors “could have led to risk of spacecraft loss,” the agency said, though engineers were able to compensate during the test flight and return the vehicle back to Earth undamaged.

The critical report piles pressure on Boeing as it tries to show NASA it can fly people safely into space. The aerospace giant is one of two contractors, along with Elon Musk’s Space Exploration Technologies Corp., hired by NASA develop new orbital vehicles to ferry astronauts back and forth from the International Space Station. Russia’s Soyuz spacecraft have been the sole crew transport since the Space Shuttle was retired in 2011.

The Starliner report was issued the day after a NASA safety panel disclosed the second software glitch, which wasn’t discovered until hours before the CST-100 Starliner’s descent and landing Dec. 22 in New Mexico.

The review panel’s findings are “invaluable to the Commercial Crew Program and we will work with NASA to comprehensively apply their recommendations,” Boeing said in a statement. “We are already working on many of the recommended fixes including re-verifying flight software code.”

The Starliner suffered a problem with its mission timing software shortly after reaching space on Dec. 20, with the craft showing an elapsed flight time 11 hours different from the actual mission time. That caused it to fire multiple thrusters too early, burning too much propellant to allow for the craft to continue its flight to the space station and forcing its return after about 48 hours.

The second flaw -- which NASA and Boeing had not disclosed at the time -- involved a “valve mapping software issue,” which Boeing said was also diagnosed and fixed in flight. “That error in the software would have resulted in an incorrect thruster separation and disposal burn,” Boeing said. The potential consequences of that mistake are “unclear,” it said.

The Chicago-based company has taken a US$410 million charge to cover the cost of a second Starliner uncrewed test flight if NASA deems one necessary before it allows astronauts to fly on the craft. A decision will be made after a full investigation is completed by month’s end, the agency said.

Boeing shares fell 1.2% to US$337.47 at 12:12 p.m. in New York trading. The stock gained 4.8% this year through Thursday.

The review teams are also investigating a problem with data linking between the Starliner and U.S. satellites during the flight. The signal loss prevented flight controllers from communicating with the vehicle during the early part of its ascent to orbit.