/

CVE-2026-53582

Severity:

HIGH RISK

(7.1)

XPath Injection (CWE-643) in OPNsense Trust Module

CVE-2026-53582

Deferred

Vulnerability type

Category:

XPath Injection

CWE:

CWE-91, CWE-643

Impact:

Sensitive Information Disclosure and Privilege Escalation

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A high-severity XPath injection vulnerability in the OPNsense Trust module allows privileged users to influence XPath expressions through attacker-controlled certificate and certificate-authority reference values. Under deployments where a user has CA Manager or Certificate Manager privileges, repeated object retrieval may reveal sensitive configuration data character by character.

A high-severity XPath injection vulnerability in the OPNsense Trust module allows privileged users to influence XPath expressions through attacker-controlled certificate and certificate-authority reference values. Under deployments where a user has CA Manager or Certificate Manager privileges, repeated object retrieval may reveal sensitive configuration data character by character.

Affected context

The vulnerability occurs in OPNsense Trust module workflows that process certificate authority or certificate reference identifiers and use them in XPath expressions. It is relevant when a user with CA Manager or Certificate Manager privileges can submit or influence these identifiers and trigger repeated retrieval operations against configuration data. Exposed information may include authentication material, private keys, VPN secrets, and high-availability credentials.

The vulnerability occurs in OPNsense Trust module workflows that process certificate authority or certificate reference identifiers and use them in XPath expressions. It is relevant when a user with CA Manager or Certificate Manager privileges can submit or influence these identifiers and trigger repeated retrieval operations against configuration data. Exposed information may include authentication material, private keys, VPN secrets, and high-availability credentials.

Exploit preconditions

  • Attack surface: OPNsense Trust module certificate authority and certificate management functionality
  • Required access: CA Manager or Certificate Manager privileges
  • Trigger point: Retrieval or processing of objects whose reference identifiers are incorporated into XPath expressions
  • Why exploitation is possible: Attacker-controlled values are interpreted as XPath syntax, allowing response behavior to act as a boolean oracle for configuration contents
  • Attack surface: OPNsense Trust module certificate authority and certificate management functionality
  • Required access: CA Manager or Certificate Manager privileges
  • Trigger point: Retrieval or processing of objects whose reference identifiers are incorporated into XPath expressions
  • Why exploitation is possible: Attacker-controlled values are interpreted as XPath syntax, allowing response behavior to act as a boolean oracle for configuration contents

Why this happens

The underlying issue is insufficient separation between untrusted reference values and XPath query syntax. Values stored or accepted by the Trust module are interpolated into XPath expressions without adequate structural validation or parameterized query handling. This maps primarily to CWE-643: Improper Neutralization of Data within XPath Expressions, with CWE-91: XML Injection describing the broader injection pattern.

The underlying issue is insufficient separation between untrusted reference values and XPath query syntax. Values stored or accepted by the Trust module are interpolated into XPath expressions without adequate structural validation or parameterized query handling. This maps primarily to CWE-643: Improper Neutralization of Data within XPath Expressions, with CWE-91: XML Injection describing the broader injection pattern.

Potential impact

  • Sensitive configuration values may be disclosed character by character
  • Password hashes and API credentials could be exposed
  • Certificate private keys and VPN key material may be revealed
  • High-availability credentials could be compromised
  • Attackers may escalate privileges or compromise additional security domains
  • Firewall, routing, and connected infrastructure trust relationships could be weakened
  • Sensitive configuration values may be disclosed character by character
  • Password hashes and API credentials could be exposed
  • Certificate private keys and VPN key material may be revealed
  • High-availability credentials could be compromised
  • Attackers may escalate privileges or compromise additional security domains
  • Firewall, routing, and connected infrastructure trust relationships could be weakened

General mitigation guidance

Mitigation generally focuses on preventing untrusted values from becoming executable XPath syntax and reducing the sensitivity of readable configuration data.

Common defensive patterns include:

  • Using parameterized or query-safe XML access mechanisms where supported
  • Allowing only server-issued, canonical reference identifiers
  • Applying strict allowlist validation for identifier format, length, and character set
  • Separating object lookup from XPath expression construction
  • Limiting CA Manager and Certificate Manager privileges according to least privilege
  • Protecting configuration files and secrets with restrictive access controls
  • Minimizing secret storage and exposure in shared configuration data
  • Rotating credentials or keys when unauthorized disclosure is suspected
  • Applying security fixes through the platform's supported maintenance process

Mitigation generally focuses on preventing untrusted values from becoming executable XPath syntax and reducing the sensitivity of readable configuration data.

Common defensive patterns include:

  • Using parameterized or query-safe XML access mechanisms where supported
  • Allowing only server-issued, canonical reference identifiers
  • Applying strict allowlist validation for identifier format, length, and character set
  • Separating object lookup from XPath expression construction
  • Limiting CA Manager and Certificate Manager privileges according to least privilege
  • Protecting configuration files and secrets with restrictive access controls
  • Minimizing secret storage and exposure in shared configuration data
  • Rotating credentials or keys when unauthorized disclosure is suspected
  • Applying security fixes through the platform's supported maintenance process

How teams detect issues like this

Detection can combine static analysis, code review, and runtime monitoring:

  • Search for string interpolation or concatenation involving XPath expressions and request-controlled values
  • Review XML access code for missing allowlist validation or parameterization
  • Flag certificate and CA reference fields that are accepted without canonical server-side resolution
  • Monitor repeated retrieval requests that vary identifiers and produce subtly different responses
  • Audit access to Trust module functions and correlate unusual activity with configuration reads
  • Enforce secure coding policies that prohibit direct insertion of untrusted input into XPath queries
  • Use automated code review or static analysis tools to identify XML and XPath injection patterns

Detection can combine static analysis, code review, and runtime monitoring:

  • Search for string interpolation or concatenation involving XPath expressions and request-controlled values
  • Review XML access code for missing allowlist validation or parameterization
  • Flag certificate and CA reference fields that are accepted without canonical server-side resolution
  • Monitor repeated retrieval requests that vary identifiers and produce subtly different responses
  • Audit access to Trust module functions and correlate unusual activity with configuration reads
  • Enforce secure coding policies that prohibit direct insertion of untrusted input into XPath queries
  • Use automated code review or static analysis tools to identify XML and XPath injection patterns

Sources

SourceLink
github.comgithub.com/opnsense/core/commit/e2cd067343511252fb0d391a17d82d3ecceece45
github.comgithub.com/opnsense/core/commit/fc2f0d745c17855d2027b192fd4e3fa913e26859
github.comgithub.com/opnsense/core/security/advisories/GHSA-xww7-76m6-mh2r
seclists.orgseclists.org/fulldisclosure/2026/Jul/18

Frequently asked

questions

Exploitability depends on how the OPNsense management interface is exposed. An attacker generally needs authenticated access to the relevant management functionality, rather than unauthenticated network access.

The described attack requires CA Manager or Certificate Manager privileges, along with the ability to submit or influence certificate-related reference values and retrieve the resulting objects.

The safest pattern is to prevent user-controlled values from being interpreted as XPath syntax by using parameterized query mechanisms, strict allowlists, and server-side resolution of valid object identifiers.

Treat all management-interface input as untrusted, apply least-privilege permissions, review XML query construction during code review, monitor unusual repeated retrieval behavior, and protect or rotate sensitive credentials and key material when exposure is possible.

Exploitability depends on how the OPNsense management interface is exposed. An attacker generally needs authenticated access to the relevant management functionality, rather than unauthenticated network access.

The described attack requires CA Manager or Certificate Manager privileges, along with the ability to submit or influence certificate-related reference values and retrieve the resulting objects.

The safest pattern is to prevent user-controlled values from being interpreted as XPath syntax by using parameterized query mechanisms, strict allowlists, and server-side resolution of valid object identifiers.

Treat all management-interface input as untrusted, apply least-privilege permissions, review XML query construction during code review, monitor unusual repeated retrieval behavior, and protect or rotate sensitive credentials and key material when exposure is possible.

Find out what's already
exploitable in your codebase.