CVE-2026-62381 in LuCIinfo

Summary

by MITRE • 08/22/2026

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.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 08/22/2026

The vulnerability identified in luci-lib-px5g represents a critical heap-based buffer overflow within the native ASN.1 encoding routine known as asn1_add_obj, located specifically in the x509write.c source file. This flaw manifests during the process of signing certificates using RSA keys with specific bit lengths, particularly noted when utilizing a 2040-bit key. The core technical failure lies in the miscalculation of memory allocation for BIT STRING structures within the DER encoding process. When generating a signature that results in a payload size of 255 bytes, the system computes the allocation based on the standard DER length encoding which accounts for the data itself but fails to adequately account for the additional overhead introduced by prepending the unused-bits byte required by ASN.1 standards. Consequently, while the allocated heap buffer is sized at 259 bytes, the actual memory write operation involving the tag, length field, unused-bits byte, and the signature payload requires 260 bytes. This discrepancy results in a single-byte overflow beyond the bounds of the allocated heap buffer, creating an opportunity for arbitrary code execution or denial of service depending on how the surrounding memory is utilized by the host application.

From a classification perspective, this vulnerability aligns with CWE-122, which denotes a heap-based buffer overflow, and can be mapped to ATT&CK techniques related to exploitation via local privilege escalation if the embedding application runs with elevated privileges or remote code execution if exposed through network services. The attack vector is accessible through the exported Lua interface function create_selfsigned(), allowing an attacker who has control over certificate generation parameters to trigger the malformed memory allocation and subsequent overflow. Although the immediate impact depends heavily on the context of the embedding application, such as OpenWrt router firmware or other embedded systems utilizing LuCI, the presence of this flaw in widely deployed release branches from openwrt-18.06 through openwret-25.12 significantly expands the potential attack surface for targeted devices that rely on these libraries for secure communication and authentication mechanisms.

The remediation strategy involves either applying a patch to correctly calculate buffer sizes including all ASN.1 overheads or removing the vulnerable component entirely. In this specific case, the vulnerability was addressed in the master branch not by fixing the calculation logic but by completely removing the luci-lib-px5g package from the distribution. This architectural decision eliminates the attack surface associated with native certificate signing within that library, forcing reliance on alternative secure implementations for cryptographic operations. For systems still operating on affected release branches where removal is not immediately feasible, mitigation requires restricting access to the create_selfsigned function and ensuring that any user-supplied input used in certificate generation undergoes strict validation before triggering the vulnerable encoding routine. Organizations must prioritize updating their firmware or patching the underlying libraries to prevent exploitation of this heap overflow, which could otherwise lead to complete system compromise through memory corruption techniques such as overwriting adjacent metadata or control flow hijacking via return address manipulation if the single byte overflow affects critical pointers in the heap layout.

Responsible

VulnCheck

Reservation

07/14/2026

Disclosure

08/22/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

low

Sources

Do you know our Splunk app?

Download it now for free!