CVE-2026-58883 AI-generated analysis
platform/frameworks/opt/telephony (ImsPhone, IMS P-Associated-URI phone number extraction) and platform/packages/modules/Telephony (PhoneNumberManagerService)
Two commits make P-Associated-URI parsing robust against a URI whose scheme-specific part is only the "@" delimiter (e.g. "sip:@"). They use split("@", 2) so the result array is never empty, and they widen the catch in ImsPhone.setPhoneNumberForSourceIms from IllegalArgumentException to RuntimeException so an exception from PhoneNumberManager.parsePhoneNumber is logged instead of left uncaught.
Root cause
Both PhoneNumberManagerService.extractPhoneNumber and ImsPhone.extractPhoneNumberFromAssociatedUris strip the host part of a SIP URI with uri.getSchemeSpecificPart().split("@")[0] / ssp.split("@")[0]. Java's String.split with no limit drops trailing empty strings. So when the scheme-specific part is only delimiters (the test case is "sip:@", whose ssp is "@"), the returned array is empty and [0] throws ArrayIndexOutOfBoundsException. In PhoneNumberManagerService the split runs before the try block, which only catches NumberParseException, so the exception propagates out of parsePhoneNumber. In ImsPhone.setPhoneNumberForSourceIms the surrounding try only caught IllegalArgumentException, so the exception went uncaught; the commit message says the new catch prevents crash loops. The legacy, non-flagged path in ImsPhone.extractPhoneNumberFromAssociatedUris had the same split pattern.
How the fix works
- packages/modules/Telephony framework/java/com/android/internal/telephony/PhoneNumberManagerService.java:extractPhoneNumber: split("@") is replaced by split("@", 2). With a positive limit, trailing empty strings are kept, so the array always has at least one element and [0] is safe. For "@" the candidate becomes the empty string, and the new test testParsingWithMalformedUriDoesNotThrow (PhoneNumberManagerTest) confirms that parsePhoneNumber returns an invalid ParsedPhoneNumber instead of throwing.
- frameworks/opt/telephony src/java/com/android/internal/telephony/imsphone/ImsPhone.java:setPhoneNumberForSourceIms: the catch around phoneNumberManager.parsePhoneNumber is widened from IllegalArgumentException to RuntimeException. Any unchecked exception from the manager is now logged via loge, and the method continues without updating the number.
- frameworks/opt/telephony ImsPhone.java:extractPhoneNumberFromAssociatedUris: both the global-format and non-global-format streams change from ssp.split("@")[0] to ssp.split("@", 2)[0]. This fixes the same empty-array indexing in the legacy path used when enablePhoneNumberParsingApi is off. ImsPhoneTest gains a "sip:@" negative case and a case where the mocked parsePhoneNumber throws NullPointerException.
Completeness
- All three split("@")[0] sites shown in the material are converted to split("@", 2)[0]: one in PhoneNumberManagerService.extractPhoneNumber and two in ImsPhone.extractPhoneNumberFromAssociatedUris (global and non-global branches).
- The RuntimeException catch in ImsPhone covers only the flagged PhoneNumberManager path. The legacy path relies only on the split limit fix, which is enough for this specific empty-array case.
- Other callers of PhoneNumberManager.parsePhoneNumber, if any, are not shown in the material and get no broader catch from these commits. The service-side split fix covers them for this input.
- The broad RuntimeException catch also swallows unrelated programming errors from parsePhoneNumber and only logs them. This is a trade-off rather than a gap.
Behavior changes
- PhoneNumberManagerService.parsePhoneNumber now returns a ParsedPhoneNumber with isValidPhoneNumber() == false for a URI such as "sip:@" instead of throwing. As for other invalid results, getParsedPhoneNumber() on that result throws IllegalStateException.
- ImsPhone.setPhoneNumberForSourceIms logs and continues on any RuntimeException from parsePhoneNumber, not just IllegalArgumentException. The number is not updated and setImsNumberUpdateStatus is not set.
- Legacy extractPhoneNumberFromAssociatedUris returns null (no number) for an all-delimiter ssp instead of throwing.
- No API, error code, or permission changes.
Per major
- Android 14: not affected per the bulletin; at android-security-14.0.0_r31 only 4/8 lines of the patched region are present and no fix is recorded there.
- Android 15: not affected per the bulletin; at android-security-15.0.0_r19 5/8 lines of the patched region are present and no fix is recorded there.
- Android 16: 16 base is not listed by the bulletin, but 16-qpr2 is listed as affected; at android-security-16.0.0_r10 5/8 lines of the patched region are present and no fix is recorded there.
- Android 17: same fix: both commits (frameworks/opt/telephony b75f0de63240 and packages/modules/Telephony 1aa2aae8215b) landed in android-security-17.0.0_r3, resolved via bug_id 517377202.
Unknowns
- Whether the malformed URI originates from the network (IMS registration headers) or from a local component is not stated in the material.
- Whether other callers of PhoneNumberManager.parsePhoneNumber exist outside ImsPhone is not shown.
- Whether PhoneNumberManagerService runs in the same process as ImsPhone, and so whether the ImsPhone catch alone would prevent the crash, is not shown.
- Why 16-qpr2 is listed as affected while 16 base is not is not explained by the material.