fix(native): block attestation leak when interceptor is dead#120
fix(native): block attestation leak when interceptor is dead#120Enginex0 wants to merge 1 commit intoJingMatrix:mainfrom
Conversation
When the Java interceptor process dies, callback->transact() returns DEAD_OBJECT but the code fell through to the real keystore, exposing genuine TEE state to requesting apps. Add pingBinder() liveness check on pre-transact failure. If the interceptor is confirmed dead, return DEAD_OBJECT to the caller instead of forwarding to real hardware. Apps see a transient service error rather than the actual device attestation state.
|
Who has ever experienced such interceptor death ? Could you trigger it? Don't base your code on imaginary scenario. It has the potential of introducing more bugs and confusions in the future. |
|
Yes , I experienced this scenario twice as it leaked , that's why I added an external daemon watcher to automatically restart service.sh if for any reason it dies , it's just an harm watcher with no race conditions |
|
Could you please upload your logs when you were experiencing this ? I don't want to hide a potentially deeper issue. |
|
Thanks for merging #119 — the KeyUsage mapping is correct now. Reproduced the leak scenario you asked about. Here's what I found: Test setup:
Reproduction steps:
Results:
The window is short (~2-5s before restart), but any app polling attestation during that gap gets authentic device state. Why I prefer this approach: On a real device, unexpected daemon death happens — OOM killer, ANR watchdog, low memory pressure, or even a user debugging with Two options:
I'd rather have apps see a transient error than expose the real bootloader/TEE state even once. Belt and suspenders. The #122 fixes the ref counting crash — solid fix. But this is a separate path. Both issues can exist independently. |
|
Why closing this? |


When the Java interceptor process dies,
callback->transact()returnsDEAD_OBJECTbut execution falls through to the real keystore, exposing genuine TEE attestation state to requesting apps.This is a security-critical path — any app polling attestation during the window between interceptor death and restart receives authentic device state.
Fix
Added
pingBinder()liveness check before forwarding. If the interceptor is confirmed dead, returnDEAD_OBJECTto the caller instead of forwarding to real hardware. Apps see a transient service error rather than actual device attestation.Scope: 1 file, 12 insertions, 4 deletions