Description
luci-lib-px5g (LuCI) contains a heap-based buffer overflow in the native ASN.1 encoding routine asn1_add_obj (x509write.c) when signing a certificate with a 2040-bit RSA key. For a 255-byte signature, the BIT STRING allocation is computed from the DER length encoding of 255 bytes, but the payload written after prepending the unused-bits byte is 256 bytes, requiring one additional DER length octet. As a result the allocation is 259 bytes while the tag, length, unused-bits byte, and signature require 260 bytes, and the final memcpy writes one byte beyond the heap buffer. The overflow is reachable through the exported Lua interface via create_selfsigned(); whether it is remotely exploitable depends on the embedding application. The vulnerable code is present on the openwrt-18.06 through openwrt-25.12 release branches and is absent from master, where the luci-lib-px5g package has been removed rather than patched.
Published: 2026-08-22
Score: 6.9 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

A heap-based buffer overflow occurs in the ASN.1 encoding routine used when LuCI signs a 2040‑bit RSA certificate. When a 255‑byte signature is encoded, the BIT STRING allocation is miscalculated by one byte, so a single byte is written past the heap buffer. This memory corruption could allow an attacker to overwrite adjacent data, potentially leading to arbitrary code execution. The Overwrite is triggered via the exported Lua function create_selfsigned(); whether it can be reached from a remote sender depends on how the hosting application exposes the Lua interface.

Affected Systems

The vulnerability exists in the luci-lib-px5g package shipped with OpenWrt release branches from 18.06 through 25.12 inclusive. The package has been removed from the master branch, so newer builds post‑25.12 do not contain the vulnerable code. The affected products are thus OpenWrt routers running those release series and using the LuCI Web UI or Lua scripts that call create_selfsigned().

Risk and Exploitability

The CVSS score of 6.9 indicates a moderate severity. The EPSS score is not available, but the vulnerability is not listed in the CISA KEV catalog, suggesting limited widespread exploitation. The attack vector relies on access to the Lua environment; if the host application exposes create_selfsigned() to untrusted users or remote input, the risk rises. In the absence of such exposure, the practical exploitability is lower. Overall, the risk is moderate but potentially high for systems that expose the vulnerable Lua function.

Generated by OpenCVE AI on August 22, 2026 at 13:20 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to a newer OpenWrt release beyond 25.12 or build a custom image that removes luci-lib-px5g from the package list.
  • If upgrading is not possible, disable or protect the create_selfsigned() Lua function so that only trusted administrators can invoke it.
  • Monitor vendor advisories for a patch or a re‑introduction of the package and apply it promptly.

Generated by OpenCVE AI on August 22, 2026 at 13:20 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sat, 22 Aug 2026 12:45:00 +0000

Type Values Removed Values Added
Description luci-lib-px5g (LuCI) contains a heap-based buffer overflow in the native ASN.1 encoding routine asn1_add_obj (x509write.c) when signing a certificate with a 2040-bit RSA key. For a 255-byte signature, the BIT STRING allocation is computed from the DER length encoding of 255 bytes, but the payload written after prepending the unused-bits byte is 256 bytes, requiring one additional DER length octet. As a result the allocation is 259 bytes while the tag, length, unused-bits byte, and signature require 260 bytes, and the final memcpy writes one byte beyond the heap buffer. The overflow is reachable through the exported Lua interface via create_selfsigned(); whether it is remotely exploitable depends on the embedding application. The vulnerable code is present on the openwrt-18.06 through openwrt-25.12 release branches and is absent from master, where the luci-lib-px5g package has been removed rather than patched.
Title luci-lib-px5g 2040-bit Certificate Signing Heap Buffer Overflow
First Time appeared Openwrt
Openwrt luci
Weaknesses CWE-122
CPEs cpe:2.3:a:openwrt:luci:-:*:*:*:*:*:*:*
Vendors & Products Openwrt
Openwrt luci
References
Metrics cvssV3_1

{'score': 6.6, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H'}

cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-22T12:26:44.558Z

Reserved: 2026-07-13T22:40:54.412Z

Link: CVE-2026-62381

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-22T13:16:39.957

Modified: 2026-08-22T13:16:39.957

Link: CVE-2026-62381

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-22T13:45:03Z

Weaknesses
  • CWE-122

    Heap-based Buffer Overflow