/

CVE-2026-45565

Severity:

HIGH RISK

(8.1)

Input Validation Flaws (CWE-20) in Roxy-WI EscapedString

CVE-2026-45565

Deferred

Vulnerability type

Category:

Improper Input Validation

CWE:

CWE-20, CWE-22, CWE-117

Impact:

Path and command manipulation leading to potential RCE

Severity:

HIGH RISK

(8.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

Roxy-WI's central EscapedString Pydantic validator incompletely validates user input, allowing directory traversal patterns to bypass filtering when combined with certain metacharacters.

An attacker who crafts specific payloads may inject dangerous path segments and shell-sensitive data into multiple fields, creating conditions for command or path manipulation where these values are later used.

Affected context

This vulnerability occurs in Roxy-WI deployments that rely on the EscapedString validator to sanitize user-controlled fields such as SSH credential names, usernames, descriptions, and similar metadata.

In these contexts, the validator strips certain metacharacters but fails to consistently block .. path traversal tokens, particularly when the payload is suffixed with characters like ;, &, |, $, or backticks.

The risk is elevated wherever these validated fields are later used to build file paths, log messages, or shell commands without additional escaping or quoting.

Exploit preconditions

  • Attack surface: Web interface (HTTP(S)) endpoints that accept fields validated via EscapedString
  • Required access: Ability to submit or modify records using fields such as SSH credential name, username, description, or similar text inputs
  • Trigger point: Application code paths that consume these validated fields to construct file paths, log entries, or shell commands
  • Why exploitation is possible: The conditional logic in EscapedString returns a metacharacter-stripped value but does not always enforce the .. blocking branch, and the resulting string is not safely quoted with mechanisms like shlex.quote() before being incorporated into downstream operations

Why this happens

The core problem is an improper input validation pattern where a shared Pydantic validator attempts to sanitize many different fields via a hand-written if/elif/else chain.

The logic prioritizes stripping certain shell metacharacters over reliably rejecting or normalizing directory traversal sequences such as ... When an attacker appends ;, &, |, $, or backticks to a .. payload, execution flows into the branch that removes those metacharacters but leaves .. intact.

This behavior aligns with CWE-20 (Improper Input Validation) and is closely related to CWE-22 (Path Traversal), since untrusted values containing .. may later influence filesystem paths, and CWE-117 (Improper Output Neutralization for Logs) when unsafe values are written to logs. The validator also fails to apply robust output encoding (such as shell quoting) at the point where data is later consumed, leading to fragile security assumptions about "sanitized" inputs.

Potential impact

  • Attackers may inject .. segments into values that are later used to construct filesystem paths, enabling directory traversal if no further checks exist.
  • User-controlled fields can carry shell-sensitive content that is not safely quoted, potentially enabling command injection in consuming code paths.
  • Log files may capture unneutralized attacker-controlled strings, which can interfere with log parsing or facilitate log injection attacks.
  • Misconfiguration or abuse of SSH-related metadata may lead to unauthorized access workflows or manipulation of automation scripts that rely on these fields.

General mitigation guidance

Effective mitigation typically involves replacing ad hoc sanitization logic with explicit, context-aware validation and encoding patterns.

Common defensive approaches include:

  • Implement strict allowlists for fields like usernames, credential names, and descriptions, defining exactly which characters and patterns are permitted.
  • Validate paths using dedicated path-handling utilities that normalize and enforce confinement to known base directories, rejecting any input containing .. or absolute paths.
  • Separate validation from output encoding: validate inputs for allowed structure, then apply context-specific encoding (e.g., shell quoting, URL encoding, HTML escaping) at each usage site.
  • Avoid building shell commands via string concatenation; instead, use structured APIs (e.g., exec with argument vectors) and pass user input as separate parameters.
  • Treat all user-controlled metadata as untrusted even after validation, and apply defense-in-depth by re-checking and constraining values near sensitive operations.

How teams detect issues like this

Detection efforts can focus on both code-level patterns and runtime behavior.

Code-focused strategies:

  • Static analysis rules that flag manual sanitization routines handling shell metacharacters or .. patterns without strict allowlists.
  • Search-based reviews for conditional chains that treat multiple input types via a single validator, especially where different branches perform inconsistent checks.
  • Identification of code paths that compose shell commands, filesystem paths, or log messages using user-controlled fields without context-specific encoding.

Runtime and process-focused strategies:

  • Application security tests (SAST/DAST) that inject payloads combining .. and shell metacharacters into affected fields to observe traversal or injection behavior.
  • Log review and monitoring for suspicious path or command patterns derived from user-controlled inputs.
  • Integration of automated security scanning tools in CI/CD pipelines to enforce policies on path handling and command construction.

Sources

SourceLink
github.comgithub.com/roxy-wi/roxy-wi/security/advisories/GHSA-7qm8-cm8p-9rx3

Frequently asked

questions

Exploitability depends on where the validated fields are used. If these fields influence file paths, shell commands, or configuration files without additional safeguards, the issue can be widely exploitable; if they are only displayed back to users with proper encoding, the practical impact may be more limited.

An attacker generally needs the ability to submit or modify entities that use the EscapedString-validated fields via the web interface or API. This often implies at least low-level authenticated access, though impact can be significant once such access is available.

The safest approach is to replace the shared, multi-purpose validator with narrow, context-specific validation functions that enforce strict allowlists and prohibit .. and other dangerous constructs. Additionally, ensure that any downstream use of these values applies appropriate context-sensitive encoding or uses structured APIs that avoid string-based command or path concatenation.

Future prevention hinges on designing for context-aware input handling: validate early with explicit constraints, avoid reusing generic "sanitizers" for different data types, and always perform encoding at the point of use. Incorporating security code reviews, linters, and automated static analysis focused on path handling and command construction can also catch these patterns before release.

Find out what's already
exploitable in your codebase.