Differential Testing Revealed What Conformance Testing Missed: A Case Study with Open-Source eMRTD Libraries
说明与用途
通过对 gmrtd (Go) 和 JMRTD (Java) 进行差分测试发现,两款库在 PACE 协议协商失败后都会静默回退到 BAC,导致应用程序在不知情的情况下接受降级的安全会话。
问题
Conformance testing only checks if a library passes its own tests, failing to show whether two independent implementations make the same security decision when presented with identical protocol traffic such as an eMRTD access control protocol downgrade.
结果
Both independent libraries successfully completed BAC authentication after a PACE failure returned 6FFF, but neither surfaced the protocol downgrade explicitly enough to prevent a naive application from assuming a standard secure session.
工作流
- Define a controlled synthetic protocol profile (pace-then-bac-downgrade) using JSON without physical silicon or NFC readers.
- Inject a failure code (6FFF) on the first PACE APDU command while keeping BAC functional.
- Execute the negotiation path against gmrtd in Go and JMRTD in Java using identical byte streams.
- Capture run metadata, APDU traces, return values, and session error fields into JSON trace files.
- Evaluate whether a naive application wrapper can catch or ignore the protocol fallback.
证据
PACE failed during the initial negotiation. BAC then completed successfully. For an application that merely checks whether a secure session exists, there was no explicit indication that a protocol fallback had occurred.
- 记录日期: 2026-09-08T21:15:30.678Z