/

CVE-2026-33078

Severity:

CRITICAL RISK

(9.8)

SQL Injection in Roxy-WI haproxy_section_save server_ip

CVE-2026-33078

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution / Database Compromise

Severity:

CRITICAL RISK

(9.8)

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

Roxy-WI versions prior to 8.2.6.4 contain a SQL injection vulnerability where the server_ip value taken from the URL path is interpolated directly into SQL query strings.

An attacker who can send crafted HTTP requests to the Roxy-WI interface may execute arbitrary SQL commands against the application's database, which can lead to data exfiltration, modification, or complete compromise of the management platform.

Affected context

The vulnerability occurs in the haproxy_section_save route within app/routes/config/routes.py of Roxy-WI, where server_ip is read from the URL path and propagated through several functions without validation.

In deployments where the web interface is reachable to administrators or operators, any party capable of issuing HTTP requests to the affected route can influence the server_ip parameter that is later embedded into SQL statements.

Environments exposing Roxy-WI beyond a tightly controlled administrative network, or those with weak authentication and authorization controls, are particularly exposed to risk.

Exploit preconditions

  • Attack surface: HTTP(S) interface of the Roxy-WI application.
  • Required access: Ability to reach the Roxy-WI web interface and invoke the vulnerable haproxy_section_save path; authentication requirements depend on local configuration.
  • User-controlled input: The server_ip segment in the URL path is attacker-controlled and not normalized or constrained to IP syntax before being used.
  • Trigger point: The vulnerable code path that builds and executes SQL queries using Python string formatting with server_ip embedded.
  • Why exploitation is possible: The parameter is passed unsanitized through multiple layers and concatenated directly into a SQL query string rather than being bound as a parameter, allowing crafted input to alter the structure of the SQL command.

Why this happens

This issue is caused by constructing SQL queries via string interpolation with untrusted data instead of using parameterized queries or a query builder.

The server_ip value originates from the URL path, is treated as trusted, and flows through several functions without validation or escaping, ultimately being embedded directly into a SQL statement using Python string formatting.

This pattern matches CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where user input is allowed to inject control characters (such as quotes, operators, and comment markers) that change the intended semantics of the SQL query.

The absence of robust input validation, strict typing, or ORM-level protections at the query construction layer enables attackers to transform a data field (an IP address) into executable SQL logic.

Potential impact

  • Extraction of sensitive data from Roxy-WI databases, including configuration details and potentially credentials or connection information.
  • Modification or deletion of configuration records for HAProxy, Nginx, Apache, and Keepalived, impacting load balancing and high-availability behavior.
  • Creation of rogue configuration entries that may route traffic through attacker-controlled endpoints.
  • Escalation of privileges within the application by altering access-control or user records stored in the database.
  • Potential pivot to underlying infrastructure if database access leads to stored credentials or command-execution capabilities via backend features.

General mitigation guidance

Effective mitigation focuses on eliminating direct string concatenation in SQL construction and tightening the trust boundary around URL-derived parameters:

  • Replace all ad-hoc SQL string formatting with parameterized queries or prepared statements provided by the database driver or ORM, ensuring that values like server_ip are always bound as parameters.
  • Enforce strict validation and normalization on route parameters that represent structured data (such as IP addresses), rejecting values that do not conform to expected formats before they reach the data access layer.
  • Centralize data access through a limited set of query-building utilities or an ORM layer, disallowing raw SQL construction in routing code wherever possible.
  • Apply the principle of least privilege to the database account used by Roxy-WI so that even if a query is abused, the account cannot perform schema changes or access unrelated databases.
  • Introduce secure-by-default coding guidelines that flag any concatenation of user input into query strings as a design defect, requiring explicit review and justification.

How teams detect issues like this

Detection can leverage both static and dynamic techniques:

  • Static analysis: Configure linters or security-focused static analyzers to detect patterns of raw SQL string construction that embed variables (e.g., f-strings, % formatting, or format) in database-related code paths.
  • Code review signals: During review, treat any route handler or helper function that builds SQL with user-derived data as a high-risk area; ensure reviewers trace the data flow from HTTP parameters to data access calls.
  • Policy enforcement: Establish CI checks that fail builds when new raw SQL construction patterns are introduced outside of an approved and vetted data access layer.
  • Runtime monitoring: Where supported, enable database logging and anomaly detection to identify unusual query patterns, such as injected UNION clauses, stacked queries, or attempts to access system tables.
  • Automated application security testing tools (SAST/DAST) can be integrated into the pipeline to probe for SQL injection behaviors on routes that accept path and query parameters.

Sources

SourceLink
github.comgithub.com/roxy-wi/roxy-wi/commit/aecc7971959092fa93e93531f1ffcde33524b031
github.comgithub.com/roxy-wi/roxy-wi/security/advisories/GHSA-jmj9-2c4q-849j

Frequently asked

questions

Yes. Any party that can reach the affected Roxy-WI HTTP endpoint and control the server_ip path segment can potentially exploit the flaw, subject to whatever authentication or network restrictions are in place.

That depends on how Roxy-WI is deployed. If the vulnerable route requires authentication, an attacker would typically need at least low-privileged credentials. If misconfigured to expose the route anonymously to a broader network, exploitation could be possible without authentication.

The most robust fix is to remove direct string interpolation from all SQL statements and instead use parameterized queries or an ORM, combined with strict format validation on inputs like server_ip so they cannot carry SQL control characters at all.

Adopt a development standard that prohibits building SQL with concatenated or formatted strings, enforce this via code review and static analysis, and design routes so that all incoming parameters are validated, normalized, and typed before reaching the data access layer or any other sensitive sink.

Find out what's already
exploitable in your codebase.