The Chicago-based carrier wouldn't say how the codes, which are changed from time to time, were released. But the Wall Street Journal reported this week that the carrier told pilots the codes were mistakenly posted on a public website by a flight attendant.
The airline declined to elaborate on what measures have been taken to keep the cockpits secure.
"We learned that some cockpit door access information may have been made public," the airline said in a statement. "The safety of our customers and crew is our top priority and United utilizes a number of measures to keep our flight decks secure beyond door access information. This protocol ensures our cockpits remain secure."
The airline's assurance hasn't satisfied United's pilots, who have repeated their call for the installation of a second set of barriers on all passenger planes. The pilots first made the request after the Sept. 11, 2001, terrorist attacks.
"They are very inexpensive," said Todd Insler, chairman of United's Master Executive Council, which represents the leadership of the airline's pilots. "It's not a hassle and could be installed in a couple of hours. You can do it during an overnight layover."
The secondary barrier would cost about $5,000 per plane, the pilots said. The barrier is retractable and relies on several rows of high-strength cables that stretch across the entrance to the cockpit to keep passengers out of the flight deck when pilots open the cockpit door to use the lavatory or get a cup of coffee.
Many United planes already have such secondary barriers, but when the airline merged in 2010 with Continental Airlines it didn't install the barriers on the Continental planes.
Most airlines say the second barriers aren't necessary and the industry trade group, Airlines for America, said each individual carrier could decide whether to install them without a government mandate.