CVE-2026-55288 AI-generated analysis
platform/frameworks/opt/telephony, UICC / SIMRecords (call forwarding indicator parsing)
Adds length checks in SIMRecords so that validEfCfis() rejects any EF_CFIS record shorter than 16 bytes and an empty EF_CFF_CPHS array is never indexed. This prevents an uncaught ArrayIndexOutOfBoundsException that crash-loops com.android.phone.
Root cause
SIMRecords.validEfCfis() only checked that the EF_CFIS byte array was non-null and that data[0] (the MSP byte) was in the range 1..4. It did not check the array length, even though the code reads mEfCfis[1] and reads/writes fields up to offset 15 (CFIS_ADN_EXTENSION_ID_OFFSET). Likewise, the EF_CFF_CPHS array (mEfCff) was only null-checked before mEfCff[0] was read or written. A SIM returning a 1-byte EF_CFIS record or a 0-byte EF_CFF_CPHS file therefore caused an ArrayIndexOutOfBoundsException in setVoiceCallForwardingFlagFromSimRecords() (per test comments). That method is reached from onAllRecordsLoaded(), which is called in a finally block of SIMRecords.handleMessage(). The exception is uncaught and kills the persistent com.android.phone process, which restarts and crashes again (per commit message).
How the fix works
- src/java/com/android/internal/telephony/uicc/SIMRecords.java:validEfCfis(): the condition changes from `data != null` to `data != null && data.length >= 16`. Any EF_CFIS record shorter than the 16-byte size in TS 51.011 section 10.3.46 is now treated as invalid. All later reads/writes of mEfCfis that are gated on validEfCfis() (index 1 and offsets 2, 3, 14, 15) become in-bounds.
- src/java/com/android/internal/telephony/uicc/SIMRecords.java, EF_CFF update path (around line 591, the `enable` branch that writes mEfCff[0] using CFF_LINE1_RESET / CFF_UNCONDITIONAL_ACTIVE): the guard changes from `mEfCff != null` to `mEfCff != null && mEfCff.length > 0`.
- src/java/com/android/internal/telephony/uicc/SIMRecords.java:setVoiceCallForwardingFlagFromSimRecords() (around line 1522): the `else if (mEfCff != null)` fallback that reads mEfCff[0] & CFF_LINE1_MASK now also requires `mEfCff.length > 0`. The new testEfCfisTooShortDoesNotCrash asserts that the status is CALL_FORWARDING_STATUS_UNKNOWN after a 1-byte EF_CFIS.
- src/java/com/android/internal/telephony/uicc/SIMRecords.java: EVENT_GET_CFF_DONE and EVENT_GET_CFIS_DONE change from private to package-private @VisibleForTesting, so the new tests can post the events directly.
- tests/telephonytests/src/com/android/internal/telephony/uicc/SIMRecordsTest.java: adds testEfCfisTooShortDoesNotCrash (1-byte EF_CFIS) and testEfCffEmptyDoesNotCrash (0-byte EF_CFF_CPHS), plus a reflection helper setProtectedField that sets mRecordsRequested/mRecordsToLoad.
Completeness
- Covers EF_CFIS records shorter than 16 bytes with a single central check in validEfCfis(). This protects every mEfCfis access that is gated on that method.
- Covers both sites in the diff that index mEfCff[0]: the write path in the `enable` branch and the read fallback in setVoiceCallForwardingFlagFromSimRecords(). Checking length > 0 is enough at those sites because only index 0 is used.
- The 16-byte check is a minimum, not an exact size. Longer EF_CFIS records are still accepted, which is safe for the offsets used.
- The fix does not add a catch around onAllRecordsLoaded() in handleMessage(). It relies only on input validation, so any other malformed-record path that throws in that finally block would still crash the process. Nothing in the provided material shows such a path.
- The material does not show whether every mEfCfis access in SIMRecords.java is gated on validEfCfis(). The diff only shows the gate and the two mEfCff sites.
Behavior changes
- EF_CFIS records shorter than 16 bytes are now treated as invalid and ignored instead of being parsed. Call forwarding status then falls back to EF_CFF_CPHS or stays CALL_FORWARDING_STATUS_UNKNOWN. In the update path, the existing 'invalid mEfCfis' log is emitted.
- An empty EF_CFF_CPHS file is ignored for both reading and updating the call forwarding flag. When the array is empty, the unconditional-forwarding flag is not written to EF_CFF_CPHS.
- EVENT_GET_CFF_DONE and EVENT_GET_CFIS_DONE become package-visible constants. This is a test-only visibility change with no runtime effect.
Per major
- Android 14: same fix: platform/frameworks/opt/telephony 8ae36cfb0cf4 in android-security-14.0.0_r29. The diff is identical to Android 15 (same pre/post blob ids a97b00bdae..5532475536), with the same two tests added. At android-security-14.0.0_r31, 6/8 lines of the patched region are present.
- Android 15: same fix: platform/frameworks/opt/telephony 64d94aa15e7b in android-security-15.0.0_r17. Code context at android-security-15.0.0_r19 shows the @VisibleForTesting event constants in place, and 6/8 lines of the patched region are present there.
- Android 16: same fix: platform/frameworks/opt/telephony cdc2bb368625 in android-security-16.0.0_r8. The logic is identical; only the line offsets differ (hunks at 176/486/593/1531). At android-security-16.0.0_r10, 6/8 lines of the patched region are present.
- Android 17: same fix: platform/frameworks/opt/telephony e73ac6487867 in android-security-17.0.0_r1. The logic is identical; only the line offsets differ (hunks at 179/500/607/1512; test file hunk at 1034). At android-security-17.0.0_r3, 6/8 lines of the patched region are present.
Unknowns
- The diff hunk header does not show the name of the method that contains the EF_CFF write path (the `enable` branch around line 591).
- The provided code does not show whether all mEfCfis index accesses in SIMRecords.java are gated on validEfCfis().
- The material does not say which 2 of the 8 patched-region lines the resolver reports as missing at the latest security tags.
- The material does not say whether the issue is reachable with eSIM profiles as well as physical SIMs.