CVE-2026-58964 AI-generated analysis
platform/frameworks/opt/telephony, SMS premium short code monitor (SmsUsageMonitor)
SmsUsageMonitor.checkDestination now strips a single leading '+' from the destination address before the emergency-number check and the short code regex matching, so a '+'-prefixed short code is categorized the same as the bare short code, preventing the on-device premium SMS warning bypass described in the commit message.
Root cause
SmsUsageMonitor.checkDestination checked destAddress exactly as it arrived against the per-country short code regex patterns, which are loaded from a file or a resource. The method's own comment says the caller (SMSDispatcher#sendRawPdu via PhoneNumberUtils#extractNetworkPortion) is expected to strip non-digits, yet the fix shows that a leading '+' could reach this method. A destination such as "+20433" was therefore not reliably matched by the patterns that classify "20433" as premium. Per the commit message, this allowed the on-device premium SMS warning to be bypassed. The existing test case ("us", "+18005551234", SMS_CATEGORY_NOT_SHORT_CODE) shows that '+'-prefixed input was already an expected input.
How the fix works
- src/java/com/android/internal/telephony/SmsUsageMonitor.java:checkDestination: at the top of the synchronized (mSettingsObserverHandler) block, before TelephonyManager.isEmergencyNumber and before the country pattern matcher is loaded and applied, adds: if destAddress != null && destAddress.startsWith("+") then destAddress = destAddress.substring(1). All later logic (emergency check, mCheckEnabled check, pattern matcher lookup) uses the normalized value.
- tests/telephonytests/src/com/android/internal/telephony/SmsUsageMonitorShortCodeTest.java: adds five ShortCodeTest entries for '+'-prefixed inputs: us +20433 PREMIUM, us +20000 POSSIBLE_PREMIUM, al +15191 PREMIUM, am +101 FREE, sg +74688 STANDARD.
Completeness
- Strips exactly one leading '+' character. A second '+' or any other leading non-digit character is not stripped here and still depends on the caller's extractNetworkPortion normalization described in the method comment.
- The normalization is applied inside checkDestination itself, so every caller of this method gets it regardless of how the caller pre-processes the address.
- The null check only guards the new startsWith call. A null destAddress is passed on to isEmergencyNumber as before.
- The regex patterns themselves (resource/file) are not changed. The fix relies on the stripped string matching the existing patterns, as the new tests check for us, al, am and sg.
Behavior changes
- Destinations beginning with '+' are now categorized by the rest of the string after the '+'. A '+'-prefixed premium or possible-premium short code is now categorized as such, so the premium SMS warning applies.
- TelephonyManager.isEmergencyNumber is now evaluated on the address without the leading '+' rather than on the raw string.
- No new return values, error codes or API surface. Only the classification result for '+'-prefixed inputs changes.
Per major
- Android 14: same fix: commit b5a3d0ad71fc in android-security-14.0.0_r31, identical diff and hunk position (line 402), 8/8 lines present.
- Android 15: same fix: commit 33abf39f6848 in android-security-15.0.0_r19, identical diff (line 402), 8/8 lines present.
- Android 16: same fix: commit 1ccbef162075 in android-security-16.0.0_r10, identical inserted lines at line 406; the surrounding context differs (emergency check guarded by TelephonyCapabilities.supportsTelephonyCalling(mFeatureFlags, mContext)), 8/8 lines present.
- Android 17: same fix: commit 16a5582a8864 in android-security-17.0.0_r3, identical inserted lines at line 407 with the same supportsTelephonyCalling context as 16, 8/8 lines present.
Unknowns
- The material does not show the per-country regex patterns or the caller code in SMSDispatcher. Whether extractNetworkPortion leaves the '+' in place on the affected branches is inferred from the fix and tests, not shown directly.
- Whether checkDestination has callers other than SMSDispatcher#sendRawPdu is not shown in the material.
- How '+'-prefixed premium short codes were categorized before the fix is not shown directly; only the commit message's statement of a warning bypass is available.