CVE-2026-58394 in OPNsenseinfo

Summary

by MITRE • 10/15/2026

OPNsense is a FreeBSD based firewall and routing platform. Prior to version 26.1.11, src/www/system_advanced_admin.php reads certificate records into $a_cert but omits that array from legacy_html_escape_form_data() before rendering each certificate descr value in the SSL Certificate selector. The certificate description accepts HTML metacharacters, allowing a user with the page-system-certmanager privilege to store markup that executes when another user opens System Settings Administration. This issue is fixed in version 26.1.11.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 10/15/2026

The vulnerability identified in OPNsense versions prior to 26.1.11 represents a classic Stored Cross-Site Scripting (XSS) flaw rooted in insufficient input validation and output encoding within the administrative interface. Specifically, the defect resides in the system_advanced_admin.php script which handles the rendering of SSL certificate records. When populating the SSL Certificate selector dropdown, the application retrieves certificate descriptions from the database but fails to pass these values through the legacy_html_escape_form_data function before embedding them into the HTML output. This omission allows an attacker with page-system-certmanager privileges to inject arbitrary JavaScript code by storing specially crafted markup in the certificate description field rather than plain text.

From a technical perspective, this vulnerability exploits the lack of context-aware encoding during the rendering phase. While OPNsense employs various security measures for form data processing, the specific path involving the legacy HTML escape function was bypassed for this particular array element. Consequently, when an administrator with sufficient privileges to view System Settings Administration opens the relevant page, the browser parses the stored malicious script as executable code rather than inert text. This execution occurs within the context of the administrative session, granting the attacker the ability to perform actions on behalf of the victim user or steal sensitive information such as session cookies and authentication tokens.

The operational impact of this vulnerability is significant due to its potential for privilege escalation and data exfiltration within a network security appliance. An authenticated attacker can leverage the stored script to redirect users to phishing sites, capture credentials entered into other forms on the same page, or manipulate the interface to disable critical firewall rules. Because OPNsense serves as a perimeter defense mechanism, compromising an administrative account through this vector could lead to broader network compromise, including traffic interception and rule manipulation that undermines the security posture of the entire protected infrastructure.

This flaw aligns with CWE-79, which describes Improper Neutralization of Input During Web Page Generation commonly known as Cross-site Scripting. Furthermore, in terms of attack tactics, this vulnerability facilitates Initial Access via Valid Accounts and potentially Credential Access through Browser Session Hijacking under the MITRE ATT&CK framework. The exploitation requires prior authentication with specific privileges, highlighting the importance of strict access control policies even within trusted administrative roles to mitigate insider threats or compromised credentials.

To remediate this issue, administrators must upgrade OPNsense to version 26.1.11 or later where the code path has been corrected to ensure all certificate description values are properly escaped before rendering. In addition to applying the software update, organizations should enforce strict input validation on any field that accepts user-supplied data destined for HTML output. Implementing Content Security Policy headers can also provide an additional layer of defense by restricting the sources from which scripts can be executed, thereby mitigating the impact if similar vulnerabilities are discovered in future releases. Regular security audits and code reviews focusing on output encoding practices are recommended to prevent recurrence of such input validation failures across all administrative modules.

Responsible

GitHub M

Reservation

06/30/2026

Disclosure

10/15/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

low

Sources

Do you need the next level of professionalism?

Upgrade your account now!