Security Vulnerability Report
中文
CVE-2025-71147 CVSS 5.5 MEDIUM

CVE-2025-71147

Published: 2026-01-23 15:16:05
Last Modified: 2026-02-26 20:26:24
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Description

In the Linux kernel, the following vulnerability has been resolved: KEYS: trusted: Fix a memory leak in tpm2_load_cmd 'tpm2_load_cmd' allocates a tempoary blob indirectly via 'tpm2_key_decode' but it is not freed in the failure paths. Address this by wrapping the blob into with a cleanup helper.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
Linux内核 < 5.15.x (具体版本需参考kernel.org补丁)
Linux内核 < 5.10.x (具体版本需参考kernel.org补丁)
Linux内核 < 5.4.x (具体版本需参考kernel.org补丁)
Linux内核 < 4.19.x (具体版本需参考kernel.org补丁)
受影响的稳定版本: 19166de9737218b77122c41a5730ac87025e089f
受影响的稳定版本: 3fd7df4636d8fd5e3592371967a5941204368936
受影响的稳定版本: 62cd5d480b9762ce70d720a81fa5b373052ae05f
受影响的稳定版本: 9b015f2918b95bdde2ca9cefa10ef02b138aae1e
受影响的稳定版本: 9e7c63c69f57b1db1a8a1542359a6167ff8fcef1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC concept for CVE-2025-71147 // This is a conceptual PoC demonstrating the memory leak condition // Note: Actual exploitation requires kernel-level access and TPM interaction #include <stdio.h> #include <stdlib.h> #include <string.h> // Simulated tpm2_key_decode function void* tpm2_key_decode(void *key_data, size_t len) { void *blob = malloc(1024); // Simulate blob allocation if (!blob) return NULL; printf("[+] Allocated blob at %p\n", blob); return blob; } // Vulnerable function - memory leak in error paths int tpm2_load_cmd_vulnerable(void *key_data, size_t len) { void *blob = tpm2_key_decode(key_data, len); if (!blob) { printf("[-] Decode failed\n"); return -1; // Blob not allocated, safe } // Simulate various error conditions if (len < 100) { printf("[-] Invalid length, returning without free!\n"); return -1; // MEMORY LEAK: blob not freed } if (((char*)key_data)[0] == 0xFF) { printf("[-] Invalid key format, returning without free!\n"); return -1; // MEMORY LEAK: blob not freed } // Normal path - blob would be used and freed printf("[+] Processing blob normally\n"); free(blob); return 0; } // Fixed version using cleanup mechanism void free_blob(void **blob) { if (*blob) { printf("[+] Freeing blob at %p\n", *blob); free(*blob); *blob = NULL; } } int tpm2_load_cmd_fixed(void *key_data, size_t len) { void *blob __attribute__((__cleanup__(free_blob))) = tpm2_key_decode(key_data, len); if (!blob) { printf("[-] Decode failed\n"); return -1; } if (len < 100 || ((char*)key_data)[0] == 0xFF) { printf("[+] Error path - cleanup handler will free blob\n"); return -1; // Blob automatically freed by cleanup } printf("[+] Processing blob normally\n"); return 0; // Blob automatically freed by cleanup } int main() { printf("=== CVE-2025-71147 Memory Leak PoC ===\n\n"); char invalid_key[] = "INVALID_KEY_DATA"; printf("[Test 1] Vulnerable function with short input:\n"); tpm2_load_cmd_vulnerable(invalid_key, 10); printf("\n[Test 2] Fixed function with short input:\n"); tpm2_load_cmd_fixed(invalid_key, 10); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-71147", "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "published": "2026-01-23T15:16:05.363", "lastModified": "2026-02-26T20:26:24.180", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nKEYS: trusted: Fix a memory leak in tpm2_load_cmd\n\n'tpm2_load_cmd' allocates a tempoary blob indirectly via 'tpm2_key_decode'\nbut it is not freed in the failure paths. Address this by wrapping the blob\ninto with a cleanup helper."}, {"lang": "es", "value": "En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nKEYS: trusted: Corregir una fuga de memoria en tpm2_load_cmd\n\n'tpm2_load_cmd' asigna un blob temporal indirectamente a través de 'tpm2_key_decode' pero no se libera en las rutas de fallo. Esto se aborda envolviendo el blob con una función auxiliar de limpieza."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.5, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-401"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.13", "versionEndExcluding": "5.15.198", "matchCriteriaId": "598618F2-2D23-4D47-A878-59BFD37881DC"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.16", "versionEndExcluding": "6.1.160", "matchCriteriaId": "C10CC03E-16A9-428A-B449-40D3763E15F6"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.2", "versionEndExcluding": "6.6.120", "matchCriteriaId": "43C3A206-5EEE-417B-AA0F-EF8972E7A9F0"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.7", "versionEndExcluding": "6.12.64", "matchCriteriaId": "32BF4A52-377C-44ED-B5E6-7EA5D896E98B"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.13", "versionEndExcluding": "6.18.3", "matchCriteriaId": "2DC484D8-FB4F-4112-900F-AE333B6FE7A7"}]}]}], "references": [{"url": "https://git.kernel.org/stable/c/19166de9737218b77122c41a5730ac87025e089f", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/3fd7df4636d8fd5e3592371967a5941204368936", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/62cd5d480b9762ce70d720a81fa5b373052ae05f", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/9b015f2918b95bdde2ca9cefa10ef02b138aae1e", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/9e7c63c69f57b1db1a8a1542359a6167ff8fcef1", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/af0689cafb127a8d1af78cc8b72585c9b2a19ecd", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}]}}