Confidential access codes to United Airlines cockpits have been changed after they were accidentally posted online over the weekend in a security gaffe that could have left aircraft vulnerable to hijacking.

The American carrier’s parent company United Continental Holdings Inc, which owns United Express, too, sent out an alert to their pilots warning them of the breach and asking them to ensure they follow additional security measures, such as verifying a person’s identity by sight before allowing them onto the flight deck.

United said that it was aware of the breach Credit: 2015 Getty Images/Justin Sullivan

The codes were among other information posted by a flight attendant on a public website, a pilot told the Wall Street Journal. The Air Line Pilots Association (ALPA) told the newspaper the issue had been dealt with.

In a statement a United continental spokesperson said: “We have learned that some cockpit doors access information may have been made public.

“The safety of our customers and crew is our top priority and United utilises a number of measures to keep our flight decks secure beyond door access information. In the interim this protocol ensures our cockpit remains secure.”

Though flight deck doors - tough enough to withstand a grenade blast, according to the Federal Aviation Administration - were only made a legal requirement in the wake of the September 11 attacks, Alpa, which represents 55,000 pilots in North America, has previously advocated the introduction of secondary barriers to cockpits on commercial aircrafts.

“There have been at least 52 hijacking attempts around the world since 9/11. The US government has repeatedly and recently confirmed that aviation, in particular, is still a target of radical terrorists and the threat of hijackings is real,” Alpa said.

Flight deck doors were made a legal requirement in the wake of 9/11 Credit: Credit: PBWPIX / Alamy Stock Photo/PBWPIX / Alamy Stock Photo

The organisation says some sort of “lightweight, inexpensive wire mesh” might be all that is necessary to add another level of security to the cockpits, but the majority of airlines have not deemed them necessary.

The crash of Germanwings Flight 9525 in May 2014, when Andreas Lubitz locked his co-pilots out of the flight deck before flying the plane into a mountain in the French Alps, killing everyone on board, presents an opposing side to the argument.

In the wake of the crash, the European Aviation Safety Agency issued a recommendation that airlines ensure at least two members of the crew - one a pilot - were in the cockpit at all times during a flight.

United has had a torrid month since a video emerged of security staff dragging a man from one of its aircraft after the airline had overbooked the plane.

Last month, the American airline came under fire again after a rabbit set to be the world’s biggest died on one of its flights.