Skip to main content
Vulnerability Database/CVE-2026-53582

CVE-2026-53582: OPNsense XPath Injection Information Disclosure

CVE-2026-53582 is an XPath injection flaw in OPNsense Trust module that allows attackers to extract sensitive data from config.xml including password hashes and API credentials. This post covers technical details, affected versions, impact, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-53582 Overview

CVE-2026-53582 is an XPath injection vulnerability [CWE-91] in the OPNsense Trust module affecting versions prior to 26.1.10. The flaw lives in src/opnsense/mvc/app/models/OPNsense/Trust/FieldTypes/CAsField.php and src/opnsense/mvc/app/models/OPNsense/Trust/FieldTypes/CertificatesField.php, where attacker-controlled refid values are interpolated into XPath expressions without validation. An authenticated user with CA Manager or Certificate Manager privileges can submit crafted refid payloads and observe a boolean refcount oracle to extract config.xml character by character.

Critical Impact

Blind XPath injection enables recovery of password hashes, API credentials, certificate private keys, VPN key material, and high-availability credentials, enabling privilege escalation and cross-domain compromise.

Affected Products

  • OPNsense firewall and routing platform (FreeBSD based)
  • All versions prior to 26.1.10
  • Trust module components CAsField.php and CertificatesField.php

Discovery Timeline

  • 2026-10-15 - CVE-2026-53582 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-53582

Vulnerability Analysis

The OPNsense Trust module stores certificate authority and certificate records in config.xml and references them through a refid field. The vulnerable code concatenates the user-supplied refid directly into XPath lookups executed against the configuration document. Because the refid was defined as an unconstrained TextField, callers could substitute arbitrary XPath syntax instead of a hexadecimal identifier.

An authenticated attacker with CA Manager or Certificate Manager privileges issues repeated requests, each containing a crafted XPath predicate that tests a single character of a target node. The server's response reflects the object refcount, acting as a boolean oracle. By iterating over character positions and candidate values, the attacker reconstructs sensitive config.xml nodes one character at a time.

Root Cause

The root cause is improper neutralization of data used in an XPath expression [CWE-91]. The refid field accepted any string and was interpolated directly into XPath queries, allowing predicate injection. The fix enforces a strict ^[0-9a-f]{13}$ mask on the refid field so only valid identifiers reach the XPath layer.

Attack Vector

Exploitation requires network access to the OPNsense web interface and valid credentials with CA Manager or Certificate Manager privileges. The attacker submits a certificate or CA object whose refid contains an XPath payload, then repeatedly retrieves the object. Each retrieval leaks one bit about a target character in config.xml, enabling recovery of password hashes, API keys, VPN secrets, and private keys over many requests.

text
// Patch: src/opnsense/mvc/app/models/OPNsense/Trust/Ca.xml
     <description>Certificate authorities</description>
     <items>
         <ca type=".\CAsField">
-            <refid type="TextField"/>
+            <refid type="TextField">
+                <Mask>/^[0-9a-f]{13}$/</Mask>
+                <ValidationMessage>Must match format</ValidationMessage>
+            </refid>
             <descr type="DescriptionField">
                 <Required>Y</Required>
             </descr>

Source: OPNsense core commit e2cd067. The patch constrains refid to a 13-character lowercase hexadecimal string, eliminating the injection surface. An equivalent change in commit fc2f0d7 applies the same Mask to src/opnsense/mvc/app/models/OPNsense/Trust/Cert.xml.

Detection Methods for CVE-2026-53582

Indicators of Compromise

  • Repeated authenticated requests from a single CA Manager or Certificate Manager account to Trust module endpoints that read certificate or CA objects.
  • Certificate or CA objects whose stored refid does not match the 13-character lowercase hexadecimal pattern ^[0-9a-f]{13}$.
  • Unusually high volumes of GET or search operations against /api/trust/ca or /api/trust/cert paths from a single session.

Detection Strategies

  • Audit config.xml for CA and certificate entries containing XPath metacharacters such as [, ], (, ), *, or ' inside refid values.
  • Correlate web server logs with authentication logs to flag Trust module users generating hundreds or thousands of object reads in a short window.
  • Alert on any OPNsense audit log entry where a CA or certificate was created or edited with a non-hex refid.

Monitoring Recommendations

  • Forward OPNsense web interface and audit logs to a central SIEM and build detections for high-rate reads against Trust endpoints.
  • Monitor for exports or reads of credentials, VPN secrets, and HA sync accounts shortly after Trust module activity.
  • Review privileged account assignments for CA Manager and Certificate Manager roles on a recurring schedule.

How to Mitigate CVE-2026-53582

Immediate Actions Required

  • Upgrade OPNsense to version 26.1.10 or later on all firewall and routing nodes.
  • Rotate password hashes, API credentials, certificate private keys, VPN key material, and HA credentials that may have been exposed.
  • Revoke and re-issue any certificates whose private keys were stored on an unpatched system.
  • Restrict CA Manager and Certificate Manager privileges to a minimal set of administrators.

Patch Information

The issue is fixed in OPNsense 26.1.10. The vendor advisory is published as GHSA-xww7-76m6-mh2r, and the fixes are contained in commit e2cd067 and commit fc2f0d7. Additional context appears on the Full Disclosure mailing list.

Workarounds

  • Remove CA Manager and Certificate Manager privileges from non-essential accounts until the upgrade is complete.
  • Restrict access to the OPNsense administrative interface to trusted management networks or VPN only.
  • Enforce multi-factor authentication on all accounts that can reach the Trust module.
bash
# Verify running OPNsense version and upgrade
opnsense-version
opnsense-update -u
# Confirm the patched version after reboot
opnsense-version | grep -E '26\.1\.1[0-9]|2[6-9]\.'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.