Sep 25, 2026·5 min read·15 visits
An incomplete security fix in compliance-trestle allows path traversal, arbitrary file write, and recursive directory deletion across multiple subcommands by manipulating the output path parameter.
CVE-2026-57171 describes an incomplete fix of CVE-2026-46345 inside compliance-trestle. Sibling subcommands (catalog-generate, profile-generate, ssp-generate, create, and replicate) bypass path validation routines. An attacker can manipulate output parameters to perform arbitrary file writes and directory deletions.
The Python-based Software Development Kit (SDK) and command-line tool compliance-trestle (Trestle) facilitates the management of Open Security Controls Assessment Language (OSCAL) documents. Trestle relies on structured workspace directories to catalog, profile, and track system security plans. While these operations typically target local repository files, the application-level directory boundaries are frequently used as security boundaries within automated pipelines.
During the remediation of a prior path traversal vulnerability (CVE-2026-46345), engineers introduced validation constraints targeting the jinja subcommand. This specific mitigation validated generated outputs through the PathSecurityValidator.validate_local_path() method. However, this defensive check was not systematically applied across sibling commands that share equivalent output mechanisms.
Consequently, several core command-line modules remained vulnerable to input-controlled path traversal. An attacker capable of defining output arguments can direct the execution environment to write files outside the designated workspace. This configuration also allows directory destruction depending on associated flags.
The vulnerability stems from the incomplete implementation of directory validation checks within sibling commands. Commands such as catalog-generate, profile-generate, ssp-generate, create, and replicate historically bypassed the PathSecurityValidator. Instead, they evaluated user-supplied path inputs via is_directory_name_allowed() which was designed to prevent name collision with core OSCAL directories.
This validation check contained two logical flaws. First, if a path starts with a Unix root separator, pathlib.Path(name).parts[0] resolves to the root directory itself. Because the root directory does not exist in the defined restricted directories, the method returns a truthy validation success. Second, path relative traversals (such as subdir/../../) resolve the first element of parts as subdir, which also successfully passes the constraint checks.
Once authorized, the path joining logic invokes Python's standard pathlib division operator. If the configured path argument is absolute, Python discards the preceding workspace root variable entirely. If the input contains relative directory traversals, the resolved output directory escapes the workspace bounds. Additionally, when a user specifies the --force-overwrite option, the program calls clear_folder(), which recursively deletes the target path before writing files.
The vulnerable code in trestle/common/file_utils.py checked output folders using basic slicing of uncanonicalized path components. It failed to check for absolute paths or relative dot-dot sequences.
# Vulnerable Implementation
def is_directory_name_allowed(name: str) -> bool:
pathed_name = pathlib.Path(name)
root_path = pathed_name.parts[0]
if root_path in const.MODEL_TYPE_TO_MODEL_DIR.values():
logger.warning('Task name is the same as an OSCAL schema name.')
return FalseThe patch addresses this gap by introducing explicit validation checks for both absolute paths and the presence of .. segments inside the file_utils.py validation logic. It also updates the vulnerable command files to call PathSecurityValidator.validate_local_path immediately after constructing the output path.
# Patched Implementation in trestle/common/file_utils.py
def is_directory_name_allowed(name: str) -> bool:
pathed_name = pathlib.Path(name)
# Reject absolute paths explicitly
if pathed_name.is_absolute() or name.startswith('/'):
logger.warning('Task name must not be an absolute path')
return False
# Reject traversal sequences
if '..' in pathed_name.parts:
logger.warning('Task name must not contain ".." path traversal sequences')
return False
root_path = pathed_name.parts[0]
if root_path in const.MODEL_TYPE_TO_MODEL_DIR.values():
logger.warning('Task name is the same as an OSCAL schema name.')
return FalseAdditionally, all affected CLI subcommands (e.g., trestle/core/commands/author/catalog.py) were patched to enforce path boundaries:
# Added check in affected commands
markdown_path = trestle_root / args.output
PathSecurityValidator.validate_local_path(markdown_path, trestle_root)Exploitation requires an execution context where the output file path parameter (-o or --output) is influenced by an untrusted source. This scenario is common in shared, multi-tenant build environments, CI/CD pipelines, or automation scripts that parse user-provided metadata or pull request properties.
An attacker can structure an exploit payload using standard relative path sequences or absolute system paths. When the Trestle utility parses the input argument, it performs the directory validation steps on the uncanonicalized input. The command then executes, leading to directory deletion (if forced) and file placement outside the workspace.
This path-resolution mechanism permits an attacker to targeting sensitive directories on the execution runner, such as /etc/cron.d or /var/www. If the execution runner possesses high privileges, this can lead to system-wide compromise or denial of service.
The impact of CVE-2026-57171 affects system integrity and availability. An attacker can write arbitrary compliance schema files to sensitive operating system paths, potentially overwriting system libraries or configurations.
If the runner process operates with elevated privileges, this primitive enables local privilege escalation. For example, writing arbitrary files to /etc/cron.d or active system service folders allows execution of arbitrary commands. This risk is highly relevant in multi-tenant environments where a single pipeline runs validation workflows on behalf of multiple untrusted repository contributors.
The inclusion of folder clearing logic (clear_folder) also introduces a high-impact availability risk. By pointing the output directory to system-critical paths with force flags active, an attacker can delete directories, resulting in permanent damage to execution environments or build runners.
Remediation requires upgrading the compliance-trestle installation to a safe release version. The patch has been backported to both the 3.x and 4.x branches. Workspaces should transition to 3.12.4 (for v3 deployments) or 4.1.0 (for v4 deployments).
If immediate upgrading is not possible, execution environments must implement input filtering on CLI commands. Ensure that parameters parsed from untrusted inputs are checked for traversal patterns (..) or absolute directories.
Security teams can deploy Semgrep rules to detect instances of unvalidated input patterns in their automation pipelines. Systems can also audit command logs to intercept suspicious traversal patterns targeting Trestle execution targets.
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
compliance-trestle IBM / OSCAL Compass | < 3.12.4 | 3.12.4 |
compliance-trestle IBM / OSCAL Compass | >= 4.0.0, <= 4.0.3 | 4.1.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-22 |
| Attack Vector | Local |
| CVSS Severity Score | 7.7 |
| EPSS Score | 0.00211 |
| Exploit Status | poc |
| CISA KEV Status | Not Listed |
The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as '..' or absolute paths that can resolve to locations outside of the restricted directory.
CVE-2026-9639 (GHSA-j93m-3j9p-m5m8) is a null pointer dereference vulnerability in Canonical LXD affecting versions 5.0.0 through 5.21.4 and 6.0 through 6.8. The flaw resides in the (*lxdBackend).CreateCustomVolumeFromBackup method within lxd/storage/backend_lxd.go. An authenticated attacker with the can_create_storage_volumes permission can upload a crafted custom volume backup tarball that omits the expires_at field on a snapshot entry, triggering an unhandled SIGSEGV panic and terminating the LXD daemon.
An operating system command injection vulnerability (CWE-78) exists in GeoNode versions prior to 5.1.0. The vulnerability occurs in the vector upload processing pipeline when handling user-supplied geospatial files. By supplying a crafted layer name containing shell metacharacters, an authenticated attacker with basic data upload privileges can execute arbitrary commands on the underlying server or container hosting the GeoNode application and Celery worker processes.
GeoNode versions prior to 5.0.3 contain an unrestricted file upload vulnerability (CWE-434) within the document and dataset ingestion architecture. Authenticated low-privileged users can bypass upload validation via direct REST API interactions, file extension masquerading, metadata mutation via PATCH requests, or malicious archive submissions. This allows attackers to store and serve dangerous file types, alter on-disk file references, or trigger path traversal and resource exhaustion during archive extraction.
CVE-2026-55649 is a stored Cross-Site Scripting (XSS) vulnerability in GeoNode versions prior to 5.0.3. The flaw exists because document abstract metadata fields are ingested via the metadata management pipeline and stored in the backend database without HTML sanitization or input neutralization. An authenticated attacker with privileges to create or edit document metadata can inject arbitrary HTML and JavaScript payloads into these fields. When another user, such as an administrator, views the affected document page or catalog listing, the unencoded payload is rendered into the Document Object Model (DOM) and executes within the victim's browser session.
CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.
An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.