通过 SQL 注入绕过机场安全
Bypassing airport security via SQL injection

原始链接: https://ian.sh/tsa

机场安全程序通常包括航空公司工作人员的快速通道,称为“已知机组人员”(KCM)。 飞行员、机组人员和航空公司雇用的其他人员可以利用 KCM 通过专用通道加快安全检查。 为了获得资格,员工需出示 KCM 条形码或提供员工编号和航空公司详细信息。 他们的身份和就业状况在获得许可之前会通过第三方 ARINC 管理的在线平台进行验证。 类似的系统,驾驶舱访问安全系统(CASS),使飞行员能够在飞行期间使用驾驶舱内的空座位(称为“折叠座位”),而无需付费乘客座位。 通过 CASS,登机口工作人员可以验证飞行员的证件并允许他们进入驾驶舱。 这两个流程都严重依赖于每家航空公司存储的员工数据的准确性。 一名安全研究人员在名为 FlyCASS 的系统中发现了 SQL 注入漏洞,使他们能够获得对某些航空公司数据库的管理访问权限。 通过这样做,他们发现未经授权的用户可能会将自己添加到 KCM 和 CASS 名册中,从而可能危及每天数千名乘客的安全措施。 在向当局报告这一发现后,他们在迅速准确地解决该漏洞方面遇到了政府机构的阻力。

*司法部在2022年表示,他们不会起诉进行“善意”活动的安全研究人员,但这一政策不具有法律约束力。 * 该政策特别提到它仅提供指导,并不产生可执行的权利。 * 由于之前对类似法律的解释中使用了模糊的语言,因此存在进一步调查和潜在指控的风险,特别是在恐怖活动或与国家安全相关的问题上。 * 鉴于《计算机欺诈和滥用法案》(CFAA) 的历史,建议在测试当前指南的范围之前谨慎行事。 * 总体而言,与前几十年相比,情况似乎不太不稳定,安全研究人员和政府机构之间似乎有了更好的普遍理解。
相关文章

原文

08/29/2024

Like many, Sam Curry and I spend a lot of time waiting in airport security lines. If you do this enough, you might sometimes see a special lane at airport security called Known Crewmember (KCM). KCM is a TSA program that allows pilots and flight attendants to bypass security screening, even when flying on domestic personal trips.

The KCM process is fairly simple: the employee uses the dedicated lane and presents their KCM barcode or provides the TSA agent their employee number and airline. Various forms of ID need to be presented while the TSA agent’s laptop verifies the employment status with the airline. If successful, the employee can access the sterile area without any screening at all.

A similar system also exists for cockpit access, called the Cockpit Access Security System (CASS). Most aircraft have at least one jumpseat inside the cockpit sitting behind the flying pilots. When pilots need to commute or travel, it is not always possible for them to occupy a revenue seat, so a jumpseat can be used instead. CASS allows the gate agent of a flight to verify that the jumpseater is an authorized pilot. The gate agent can then inform the crew of the flight that the jumpseater was authenticated by CASS.

The employment status check is the most critical component of these processes. If the individual doesn’t currently work for an airline, they have not had a background check and should not be permitted to bypass security screening or access the cockpit. This process is also responsible for returning the photo of the crewmember to ensure the right person is being authorized for access. So how does this work, when every airline presumably uses a different system to store their employee information? That is what we were wondering, and where it gets interesting…

ARINC

ARINC (a subsidiary of Collins Aerospace) appears to be contracted by the TSA to operate the Known Crewmember system. ARINC operates a few central components, including an online website for pilots and flight attendants to check their KCM status, and an API to route authorization requests between different airlines. Each airline appears to operate their own authorization system to participate in KCM and CASS, and it interacts with the “hub” of ARINC.

The TSA and airlines can send requests such as CockpitAccessRequest and CrewVerificationRequest to ARINC, which then routes it to the appropriate airline’s system and receives the response. There are 77 airlines currently participating in KCM. While larger airlines have likely built their own system, how do smaller airlines respond to these requests to participate in KCM or CASS?

FlyCASS.com

In our search for vendors that actually run the authorization systems, we found a site called FlyCASS which pitches small airlines a web-based interface to CASS. Intrigued, we noticed every airline had its own login page, such as Air Transport International (8C) being available at /ati. With only a login page exposed, we thought we had hit a dead end.

Just to be sure though, we tried a single quote in the username as a SQL injection test, and immediately received a MySQL error:

This was a very bad sign, as it seemed the username was directly interpolated into the login SQL query. Sure enough, we had discovered SQL injection and were able to use sqlmap to confirm the issue. Using the username of ' or '1'='1 and password of ') OR MD5('1')=MD5('1, we were able to login to FlyCASS as an administrator of Air Transport International!

KCM and CASS Admin

It turns out that FlyCASS also operates both KCM and CASS for its participating airlines. Now that we are an administrator of Air Transport International, we are able to manage the list of pilots and flight attendants associated with them. Surprisingly, there is no further check or authentication to add a new employee to the airline. As the administrator of the airline, we were able to add anyone as an authorized user for KCM and CASS.

To test that it was possible to add new employees, we created an employee named Test TestOnly with a test photo of our choice and authorized it for KCM and CASS access. We then used the Query features to check if our new employee was authorized. Unfortunately, our test user was now approved to use both KCM and CASS:

At this point, we realized we had discovered a very serious problem. Anyone with basic knowledge of SQL injection could login to this site and add anyone they wanted to KCM and CASS, allowing themselves to both skip security screening and then access the cockpits of commercial airliners.

We ended up finding several more serious issues but began the disclosure process immediately after finding the first issue.

Disclosure

We had difficulty identifying the right disclosure contact for this issue. We did not want to contact FlyCASS first as it appeared to be operated only by one person and we did not want to alarm them. On April 23rd, we were able to disclose the issue to the Department of Homeland Security, who acknowledged the issue and confirmed that they “are taking this very seriously”. FlyCASS was subsequently disabled in KCM/CASS and later appears to have remediated the issues.

After the issue was fixed, we attempted to coordinate the safe disclosure of this issue. Unfortunately, instead of working with us, the Department of Homeland Security stopped responding to us, and the TSA press office issued dangerously incorrect statements about the vulnerability, denying what we had discovered.

The TSA press office said in a statement that this vulnerability could not be used to access a KCM checkpoint because the TSA initiates a vetting process before issuing a KCM barcode to a new member. However, a KCM barcode is not required to use KCM checkpoints, as the TSO can enter an airline employee ID manually. After we informed the TSA of this, they deleted the section of their website that mentions manually entering an employee ID, and did not respond to our correction. We have confirmed that the interface used by TSOs still allows manual input of employee IDs.

Several other attacks were also likely possible. Since our vulnerability allowed us to edit an existing KCM member, we could have changed the photo and name of an existing enrolled user, which would likely bypass any vetting process that may exist for new members. If you are able to obtain an unenrolled KCM barcode, you can also enroll it to an employee ID yourself on the KCM website.

Timeline

  • 04/23/2024: Initial disclosure to ARINC and FAA
  • 04/24/2024: Subsequent disclosure to DHS via CISA
  • 04/25/2024: DHS CISO confirms they are working on a resolution
  • 05/07/2024: DHS CISO confirms FlyCASS was disconnected from KCM/CASS
  • 05/17/2024: Follow-up to DHS CISO about TSA statements (no reply)
  • 06/04/2024: Follow-up to DHS CISO about TSA statements (no reply)

Collaborators

联系我们 contact @ memedata.com