CWE-22
Allowed-with-ReviewImproper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Abstraction: Base · Status: Stable
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
15153 vulnerabilities reference this CWE, most recent first.
GHSA-R4MM-G464-9MWV
Vulnerability from github – Published: 2026-05-02 00:31 – Updated: 2026-05-02 00:31A vulnerability was detected in Dayoooun hwpx-mcp 0.2.0. This affects the function save_document/export_to_text/export_to_html of the file mcp-server/src/index.ts of the component MCP Interface. Performing a manipulation of the argument output_path results in path traversal. Remote exploitation of the attack is possible. The exploit is now public and may be used. The project was informed of the problem early through an issue report but has not responded yet.
{
"affected": [],
"aliases": [
"CVE-2026-7599"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-05-01T22:16:17Z",
"severity": "LOW"
},
"details": "A vulnerability was detected in Dayoooun hwpx-mcp 0.2.0. This affects the function save_document/export_to_text/export_to_html of the file mcp-server/src/index.ts of the component MCP Interface. Performing a manipulation of the argument output_path results in path traversal. Remote exploitation of the attack is possible. The exploit is now public and may be used. The project was informed of the problem early through an issue report but has not responded yet.",
"id": "GHSA-r4mm-g464-9mwv",
"modified": "2026-05-02T00:31:21Z",
"published": "2026-05-02T00:31:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-7599"
},
{
"type": "WEB",
"url": "https://github.com/BruceJqs/public_exp/issues/28"
},
{
"type": "WEB",
"url": "https://github.com/Dayoooun/hwpx-mcp/issues/3"
},
{
"type": "WEB",
"url": "https://github.com/Dayoooun/hwpx-mcp"
},
{
"type": "WEB",
"url": "https://vuldb.com/submit/805608"
},
{
"type": "WEB",
"url": "https://vuldb.com/vuln/360556"
},
{
"type": "WEB",
"url": "https://vuldb.com/vuln/360556/cti"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-R4P5-CJPR-FGVM
Vulnerability from github – Published: 2025-07-04 12:30 – Updated: 2026-04-01 18:35Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in machouinard Aviation Weather from NOAA allows Path Traversal. This issue affects Aviation Weather from NOAA: from n/a through 0.7.2.
{
"affected": [],
"aliases": [
"CVE-2025-28980"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-07-04T12:15:27Z",
"severity": "HIGH"
},
"details": "Improper Limitation of a Pathname to a Restricted Directory (\u0027Path Traversal\u0027) vulnerability in machouinard Aviation Weather from NOAA allows Path Traversal. This issue affects Aviation Weather from NOAA: from n/a through 0.7.2.",
"id": "GHSA-r4p5-cjpr-fgvm",
"modified": "2026-04-01T18:35:45Z",
"published": "2025-07-04T12:30:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-28980"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/aviation-weather-from-noaa/vulnerability/wordpress-aviation-weather-from-noaa-0-7-2-arbitrary-file-deletion-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-R4PM-R3FF-G34J
Vulnerability from github – Published: 2022-05-02 03:30 – Updated: 2022-05-02 03:30Multiple directory traversal vulnerabilities in Dokeos 1.8.5, and possibly earlier, allow remote attackers to (1) read portions of arbitrary files via a .. (dot dot) and a ..\ (dot dot backslash) in the lang parameter to main/exercice/hotspot_lang_conversion.php and (2) read arbitrary files via a .. (dot dot) in the doc_url parameter to main/exercice/Hpdownload.php.
{
"affected": [],
"aliases": [
"CVE-2009-2007"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-06-08T19:30:00Z",
"severity": "MODERATE"
},
"details": "Multiple directory traversal vulnerabilities in Dokeos 1.8.5, and possibly earlier, allow remote attackers to (1) read portions of arbitrary files via a .. (dot dot) and a ..\\ (dot dot backslash) in the lang parameter to main/exercice/hotspot_lang_conversion.php and (2) read arbitrary files via a .. (dot dot) in the doc_url parameter to main/exercice/Hpdownload.php.",
"id": "GHSA-r4pm-r3ff-g34j",
"modified": "2022-05-02T03:30:49Z",
"published": "2022-05-02T03:30:49Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-2007"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/50503"
},
{
"type": "WEB",
"url": "http://gsasec.blogspot.com/2009/05/dokeos-free-185-multiple.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/34879"
},
{
"type": "WEB",
"url": "http://www.dokeos.com/wiki/index.php/Security#Dokeos_1.8"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/34928"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2009/1300"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-R4Q9-QXGX-R39M
Vulnerability from github – Published: 2022-04-06 00:01 – Updated: 2022-04-14 00:00A path traversal vulnerability was identified in GitHub Enterprise Server management console that allowed the bypass of CSRF protections. This could potentially lead to privilege escalation. To exploit this vulnerability, an attacker would need to target a user that was actively logged into the management console. This vulnerability affected all versions of GitHub Enterprise Server prior to 3.5 and was fixed in versions 3.1.19, 3.2.11, 3.3.6, 3.4.1. This vulnerability was reported via the GitHub Bug Bounty program.
{
"affected": [],
"aliases": [
"CVE-2022-23732"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-04-05T00:15:00Z",
"severity": "HIGH"
},
"details": "A path traversal vulnerability was identified in GitHub Enterprise Server management console that allowed the bypass of CSRF protections. This could potentially lead to privilege escalation. To exploit this vulnerability, an attacker would need to target a user that was actively logged into the management console. This vulnerability affected all versions of GitHub Enterprise Server prior to 3.5 and was fixed in versions 3.1.19, 3.2.11, 3.3.6, 3.4.1. This vulnerability was reported via the GitHub Bug Bounty program.",
"id": "GHSA-r4q9-qxgx-r39m",
"modified": "2022-04-14T00:00:39Z",
"published": "2022-04-06T00:01:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-23732"
},
{
"type": "WEB",
"url": "https://docs.github.com/en/enterprise-server@3.1/admin/release-notes#3.1.19"
},
{
"type": "WEB",
"url": "https://docs.github.com/en/enterprise-server@3.2/admin/release-notes#3.2.11"
},
{
"type": "WEB",
"url": "https://docs.github.com/en/enterprise-server@3.3/admin/release-notes#3.3.6"
},
{
"type": "WEB",
"url": "https://docs.github.com/en/enterprise-server@3.4/admin/release-notes#3.4.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-R4QQ-J78J-XGQ9
Vulnerability from github – Published: 2022-05-17 05:30 – Updated: 2022-05-17 05:30Directory traversal vulnerability in the web interface in AnyMacro Mail System G4X allows remote attackers to read arbitrary files via directory traversal sequences in a request.
{
"affected": [],
"aliases": [
"CVE-2011-2468"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2011-06-09T02:38:00Z",
"severity": "MODERATE"
},
"details": "Directory traversal vulnerability in the web interface in AnyMacro Mail System G4X allows remote attackers to read arbitrary files via directory traversal sequences in a request.",
"id": "GHSA-r4qq-j78j-xgq9",
"modified": "2022-05-17T05:30:46Z",
"published": "2022-05-17T05:30:46Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-2468"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/44810"
},
{
"type": "WEB",
"url": "http://www.cnvd.org.cn/vulnerability/CNVD-2011-05282"
},
{
"type": "WEB",
"url": "http://www.kb.cert.org/vuls/id/603590"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/48063"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-R4R9-MGJC-G6Q3
Vulnerability from github – Published: 2020-09-01 19:06 – Updated: 2023-06-01 19:46All versions of 626 are vulnerable to path traversal. This enables a remote attacker to read arbitrary files from the remote server using this module.
Recommendation
No fix is currently available for this vulnerability. It is our recommendation to not install or use this module at this time.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "626"
},
"ranges": [
{
"events": [
{
"introduced": "0.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2018-3727"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2020-08-31T18:28:44Z",
"nvd_published_at": "2018-06-07T02:29:00Z",
"severity": "HIGH"
},
"details": "All versions of `626` are vulnerable to path traversal. This enables a remote attacker to read arbitrary files from the remote server using this module.\n\n\n## Recommendation\n\nNo fix is currently available for this vulnerability.\nIt is our recommendation to not install or use this module at this time.\n ",
"id": "GHSA-r4r9-mgjc-g6q3",
"modified": "2023-06-01T19:46:10Z",
"published": "2020-09-01T19:06:15Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-3727"
},
{
"type": "WEB",
"url": "https://hackerone.com/reports/311216"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "Path Traversal in 626"
}
GHSA-R4RV-85JG-W4MF
Vulnerability from github – Published: 2026-07-20 21:34 – Updated: 2026-07-20 21:34Summary
A path traversal issue exists in mistune's Include directive when markdown files are processed using md.read(). A crafted include path can cause files outside the intended markdown directory to be accessed.
Details
The issue occurs in the Include.parse() method where user-supplied paths are joined and normalized without verifying that the resulting path remains within an expected directory.
relpath = self.parse_title(m)
dest = os.path.join(os.path.dirname(source_file), relpath)
dest = os.path.normpath(dest)
Because the final path is not restricted to a trusted base directory, path traversal sequences such as ../ may reference files outside the intended location.
Proof of Concept
Create a markdown file:
.. include:: ../../../example.txt
Process it using:
import mistune
from mistune.directives import RSTDirective, Include
md = mistune.create_markdown(
plugins=[RSTDirective([Include()])]
)
result, state = md.read("test.md")
print(result)
Impact
Applications that process untrusted markdown files with the Include directive enabled may allow unintended file access. The impact depends on how the feature is used and what files are accessible to the running process.
Recommended Fix
Validate the resolved path and ensure it remains within an allowed directory before opening the file.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "mistune"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.3.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-59924"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-20T21:34:53Z",
"nvd_published_at": "2026-07-08T17:17:28Z",
"severity": "MODERATE"
},
"details": "### Summary\n\nA path traversal issue exists in mistune\u0027s `Include` directive when markdown files are processed using `md.read()`. A crafted include path can cause files outside the intended markdown directory to be accessed.\n\n### Details\n\nThe issue occurs in the `Include.parse()` method where user-supplied paths are joined and normalized without verifying that the resulting path remains within an expected directory.\n\n```python\nrelpath = self.parse_title(m)\ndest = os.path.join(os.path.dirname(source_file), relpath)\ndest = os.path.normpath(dest)\n```\n\nBecause the final path is not restricted to a trusted base directory, path traversal sequences such as `../` may reference files outside the intended location.\n\n### Proof of Concept\n\nCreate a markdown file:\n\n```markdown\n.. include:: ../../../example.txt\n```\n\nProcess it using:\n\n```python\nimport mistune\nfrom mistune.directives import RSTDirective, Include\n\nmd = mistune.create_markdown(\n plugins=[RSTDirective([Include()])]\n)\n\nresult, state = md.read(\"test.md\")\nprint(result)\n```\n\n### Impact\n\nApplications that process untrusted markdown files with the `Include` directive enabled may allow unintended file access. The impact depends on how the feature is used and what files are accessible to the running process.\n\n### Recommended Fix\n\nValidate the resolved path and ensure it remains within an allowed directory before opening the file.",
"id": "GHSA-r4rv-85jg-w4mf",
"modified": "2026-07-20T21:34:53Z",
"published": "2026-07-20T21:34:53Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/lepture/mistune/security/advisories/GHSA-r4rv-85jg-w4mf"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-59924"
},
{
"type": "WEB",
"url": "https://github.com/lepture/mistune/commit/1bef343ade163fc3bb95572b15be720084cdb993"
},
{
"type": "PACKAGE",
"url": "https://github.com/lepture/mistune"
},
{
"type": "WEB",
"url": "https://github.com/lepture/mistune/releases/tag/v3.3.0"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/mistune/PYSEC-2026-2212.yaml"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "Mistune: Arbitrary File Read via Include directive path traversal"
}
GHSA-R4VH-XFFF-58MW
Vulnerability from github – Published: 2025-11-07 00:30 – Updated: 2025-11-07 00:30Due to insufficient sanitization, an attacker can upload a specially crafted configuration file to cause a denial-of-service condition, traverse directories, or read/write files, within the context of the local system account.
{
"affected": [],
"aliases": [
"CVE-2025-58423"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-11-06T23:15:37Z",
"severity": "HIGH"
},
"details": "Due to insufficient sanitization, an attacker can upload a specially \ncrafted configuration file to cause a denial-of-service condition, \ntraverse directories, or read/write files, within the context of the \nlocal system account.",
"id": "GHSA-r4vh-xfff-58mw",
"modified": "2025-11-07T00:30:31Z",
"published": "2025-11-07T00:30:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-58423"
},
{
"type": "WEB",
"url": "https://github.com/cisagov/CSAF/blob/develop/csaf_files/OT/white/2025/icsa-25-310-01.json"
},
{
"type": "WEB",
"url": "https://www.advantech.com/emt/contact"
},
{
"type": "WEB",
"url": "https://www.cisa.gov/news-events/ics-advisories/icsa-25-310-01"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-R4VP-3VW6-R2X5
Vulnerability from github – Published: 2026-09-24 19:52 – Updated: 2026-09-24 19:52At a glance
-
Actor: attacker who controls the -o/--output argument to trestle author {catalog,profile,ssp}-generate (e.g. via a CI pipeline that derives the output directory from repository-controlled data)
-
Primitive: attacker-controlled --output value reaches trestle_root / args.output write sink with only is_directory_name_allowed() (parts[0]-only task-name-collision check), not the PathSecurityValidator.validate_local_path() guard added by the CVE-2026-46345 fix
-
Impact: arbitrary-location file write outside the trestle workspace as the process owner (8.4 High; conservative C:N variant 7.7, still High); with --force-overwrite, the attacker-chosen directory is first recursively deleted shutil.rmtree)
-
Precondition: attacker influences the -o argument in a CI/automation pipeline or multi-tenant trestle workspace running these generate subcommands
-
Fix: call PathSecurityValidator.validate_local_path(markdown_path, trestle_root) immediately after building markdown_path in catalog.py, ssp.py, and prof.py, mirroring the existing jinja fix
Overview
The remediation for CVE-2026-46345 / GHSA-4q5v-7g7x-j79w ("Arbitrary File Write via Path Traversal in compliance-trestle – jinja") added a new PathSecurityValidator.validate_local_path() guard and wired it into the jinja command's output path. The identical output = trestle_root / args.output write pattern in the sibling author commands — catalog-generate, profile-generate, and ssp-generate — was not updated. Those commands instead rely on is_directory_name_allowed(), a task-name-collision check that does not stop path traversal: an absolute --output or a --output whose first component is innocuous subdir/../../../...) escapes the trestle workspace and writes generated markdown under an attacker-chosen output root outside the workspace, subject to the invoking process's filesystem permissions.
Impact
Threat model. This is not a claim that a local user harms themselves by intentionally choosing an unsafe -o. The security boundary is crossed when a trusted automation job, CI workflow, shared trestle service, or wrapper invokes one of these subcommands and derives --output from repository-controlled, tenant-controlled, or otherwise untrusted data while expecting trestle to keep generated output inside the workspace. The attacker does not need local shell access to the trestle host; they only need influence over the data that the trusted automation maps into the --output argument.
Primary claim (confirmed): Such an invocation writes control-markdown files outside the trestle workspace — arbitrary-location file write as the process owner. This is runtime-confirmed for catalog-generate: catalog-generate -o /tmp/TRESTLE_ESCAPE_ABS produced files outside the workspace on a v4.0.3 install while the same install blocked the equivalent jinja -o with a Security violation error. profile-generate and ssp-generate are source-confirmed siblings (identical trestle_root / args.output join, the same is_directory_name_allowed-only gate, no validate_local_path call); see Runtime-confirmed scope in the End-to-end verification below.
Destructive variant --force-overwrite, source-confirmed): before generating, the force-overwrite path clears the selected output directory via clear_folder(...) trestle/core/commands/common/cmd_utils.py), which performs shutil.rmtree on that directory. Because clear_folder early-returns unless the target is an existing directory, the primitive is recursive deletion of an attacker-selected directory tree outside the workspace (e.g. wiping a directory the process owner can write), not pinpoint deletion of an arbitrary single file. This is the integrity + availability impact behind I:HA:H.
Secondary (conditional) escalation: The affected population extends to every consumer that runs these generate subcommands in a CI/automation pipeline, shared/multi-tenant trestle workspace, or wrapper that forwards an externally supplied name — the same threat model GitHub/the maintainer accepted for CVE-2026-46345. Indirect code execution (e.g. overwriting a script the CI pipeline later invokes) is the bounded escalation beyond the demonstrated file-write primitive.
Technical Details
Source → Transform → Sink → Missing-guard → Result: attacker-controlled --output CLI argument → trestle_root / args.output join in catalog.pyssp.pyprof.py → CatalogAPI.write_catalog_as_markdown() writes files under the resolved path → only is_directory_name_allowed() (parts[0]-only task-name check) applied, not PathSecurityValidator.validate_local_path() → files written outside the trestle workspace.
The fix is scoped to jinja.py only
Both fix commits 247fcce2…, 7d107b3a…, "add path traversal protection and prevent SSTI in jinja templating") touch only trestle/core/commands/author/jinja.py (+ its tests). The new guard:
# trestle/core/commands/author/jinja.py
output_file = trestle_root / r_output_file
PathSecurityValidator.validate_local_path(output_file, trestle_root) # :229 (and :278, :297)
validate_local_path trestle/core/remote/security.py:326) is the correct guard — it .resolve()s the path and calls relative_to(trestle_root), rejecting both .. traversal and absolute paths.
The sibling generate commands were not updated
catalog-generate, profile-generate, and ssp-generate build the output path with the same join but never call validate_local_path. The only check is is_directory_name_allowed:
# trestle/core/commands/author/catalog.py:69 / ssp.py:97 / prof.py:86 (identical in all three)
if not file_utils.is_directory_name_allowed(args.output):
raise TrestleError(f'{args.output} is not an allowed directory name')
...
markdown_path = trestle_root / args.output # catalog.py:90 / prof.py:110 (var markdown_path); ssp.py:111 (var md_path) — same join
is_directory_name_allowed trestle/common/file_utils.py:95) was designed to stop task names that collide with OSCAL model directories, not traversal. It inspects only parts[0]:
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(): return False # blocks "catalogs", "profiles", ...
if root_path[0] == '.': return False # blocks leading "." (i.e. "../x")
if pathed_name.suffix != '': return False # blocks names with a file suffix
if '__global__' in pathed_name.parts: return False
return True
Two payloads defeat it:
-
Absolute path — --output /tmp/pwned. parts[0] is / (not an OSCAL dir, not .-prefixed, no suffix) → allowed. trestle_root / '/tmp/pwned' collapses to /tmp/pwned (pathlib discards the left operand on absolute join).
-
Non-leading .. — --output subdir/../../../../../../tmp/pwned. parts[0] is subdir (innocuous) → allowed. The .. segments resolve out of the workspace at write time.
The validated value flows unchanged to the write sink with no further sanitisation grep for resolve()/relative_to/validate_local_path across the catalog write path returns zero hits): ControlContext.generate(..., md_root=markdown_path, ...) stores it as a dataclass field trestle/core/control_context.py:46) and CatalogAPI.write_catalog_as_markdown() calls self._context.md_root.mkdir(exist_ok=True, parents=True) trestle/core/catalog/catalog_api.py:72) then writes .md files under it.
Additional unguarded siblings create, replicate)
trestle create trestle/core/commands/create.py:95, desired_model_dir = trestle_root / plural_path / args.output) and trestle replicate replicate.py:90) have no is_directory_name_allowed check at all and accept the same absolute / .. --output. They write a structured OSCAL model file and refuse to overwrite an existing target .exists() raises), so the primitive is create-only there — lower impact than the generate commands, but the same missing-guard root cause. These are flagged as related defense-in-depth sinks sharing the root cause, not as the primary impact claim of this report.
Severity note
Metrics mirror the parent CVE-2026-46345 (8.4, AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H). I:HA:H are direct and demonstrated: out-of-workspace file creation, plus recursive shutil.rmtree of an attacker-chosen directory under --force-overwrite. C:H is proposed for consistency with the parent advisory's published score for the same out-of-workspace write boundary; however, the directly demonstrated primitive is write/overwrite rather than file read, so a conservative vector with C:N AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H) yields 7.7, still High. S:U because trestle writes as the invoking user.
Why OSCAL id-validation does not prevent this
OSCAL model ids control.id, group.id) are NCName-validated constr(regex=…)) and cannot contain /, \, or a leading .., so the per-control leaf filenames grp1/ac-1.md) cannot themselves traverse. That validation does not help here: the base output root md_root = trestle_root / args.output is built from the raw, unconstrained -o/--output CLI string and is joined before those safe leaves. An absolute or non-leading.. -o escapes the workspace, and the NCName-safe leaves are written underneath the escaped root — confirmed by the PoC, where the escape occurs at md_root /tmp/TRESTLE_ESCAPE_ABS) with grp1/ac-1.md written beneath it.
Reproduction
Non-web target (Python CLI). PoC is a command sequence run against a local install of the project's current source (HEAD e22e35bd, reports as v4.0.3) — no vendor infrastructure touched.
Step 1 — Set up a normal trestle workspace with a one-control catalog
pip install -e . # editable install of the affected source (v4.0.3)
mkdir /tmp/poc_ws && cd /tmp/poc_ws
trestle init
mkdir -p catalogs/mycat
python3 - <<'PY'
import uuid, json
cat = {"catalog":{"uuid":str(uuid.uuid4()),
"metadata":{"title":"PoC Catalog","last-modified":"2026-01-01T00:00:00.000+00:00","version":"1.0","oscal-version":"1.0.4"},
"groups":[{"id":"grp1","title":"Group One","controls":[
{"id":"ac-1","title":"PoC Control","parts":[{"id":"ac-1_smt","name":"statement","prose":"PoC statement prose."}]}]}]}}
json.dump(cat, open("catalogs/mycat/catalog.json","w"), indent=2)
PY
Step 2 — Trigger the boundary failure (absolute-path escape)
trestle author catalog-generate -n mycat -o /tmp/TRESTLE_ESCAPE_ABS
ls /tmp/TRESTLE_ESCAPE_ABS/grp1/ac-1.md
Recorded output:
$ ls /tmp/TRESTLE_ESCAPE_ABS/grp1/ac-1.md
/tmp/TRESTLE_ESCAPE_ABS/grp1/ac-1.md # written OUTSIDE /tmp/poc_ws
$ head -3 /tmp/TRESTLE_ESCAPE_ABS/grp1/ac-1.md
# ac-1 - \[Group One\] PoC Control
## Control Statement
Step 3 — Same escape via non-leading .. (defeats is_directory_name_allowed)
trestle author catalog-generate -n mycat -o 'subdir/../../../../../../tmp/TRESTLE_ESCAPE_DOTDOT'
ls /tmp/TRESTLE_ESCAPE_DOTDOT/grp1/ac-1.md # -> exists, outside the workspace
Step 4 — Differential: the patched jinja -o is blocked on the SAME install
echo 'hello {{ 1+1 }}' > template.j2
trestle author jinja -i template.j2 -o '/tmp/TRESTLE_JINJA_BLOCKED'
Recorded output (fix is active; proves this is an incomplete fix, not an unpatched version):
ERROR: ... Security violation: Path traversal blocked. Attempted to access
"/tmp/TRESTLE_JINJA_BLOCKED" which is outside the trestle workspace "/tmp/poc_ws"
# (no file created)
catalog-generate escapes while jinja is blocked → the validate_local_path remediation was never applied to the generate commands.
End-to-end verification (runtime)
-
Lab setup: editable install pip install -e .) of the affected source at HEAD e22e35bd (reports as v4.0.3, the release that contains the GHSA-4q5v jinja fix). import trestle.core.commands.author.catalog resolves to the in-tree source file, confirming the run exercises HEAD, not a stale wheel.
-
Observed end-to-end effect (not an intermediate return value): files physically written outside the workspace — /tmp/TRESTLE_ESCAPE_ABS/grp1/ac-1.md and /tmp/TRESTLE_ESCAPE_DOTDOT/grp1/ac-1.md — while /tmp/poc_ws (the trestle root) contained no such directory. Confirmed by findls.
-
Differential control: the same install rejects the equivalent jinja -o with Security violation: Path traversal blocked … outside the trestle workspace, writing nothing. The guard exists and works in jinja; it is simply absent from the generate commands.
-
Guard bypass, isolated: importing is_directory_name_allowed semantics and joining via pathlib confirms -o /tmp/pwned (absolute) and -o subdir/../../../tmp/pwned (innocuous leading component) both pass the check and resolve outside the root, while the naive -o ../../tmp/pwned is the only form the check stops.
-
Runtime-confirmed scope (what was executed vs source-confirmed): the write escape is runtime-confirmed for catalog-generate (Steps 2–4 above). profile-generate and ssp-generate are source-confirmed siblings — same trestle_root / args.output join prof.py:110, ssp.py:111), same is_directory_name_allowed-only gate prof.py:86, ssp.py:97), no validate_local_path — and should be fixed in the same patch. The --force-overwrite recursive-delete primitive clear_folder → shutil.rmtree, with an early return unless the target is an existing directory) is source-confirmed; the PoC above exercises the write escape, not -fo.
Suggested Fix
Root-cause fix: Mirror the jinja fix in the three generate commands (and, for completeness, createreplicate): after constructing the output path, call the existing guard before any mkdir/write.
# catalog.py / ssp.py / prof.py, immediately after markdown_path = trestle_root / args.output
from trestle.core.remote.security import PathSecurityValidator
PathSecurityValidator.validate_local_path(markdown_path, trestle_root)
is_directory_name_allowed() should be retained for its original purpose (OSCAL-dir-collision prevention) but must not be relied on for traversal defence.
Defense-in-depth: Harden is_directory_name_allowed to reject absolute paths pathed_name.is_absolute()) and any .. component so it provides a secondary layer even if the primary validate_local_path call is accidentally omitted in future.
References
-
Vendor security policy: https://github.com/oscal-compass/compliance-trestle/security/policy
-
Submission endpoint: https://github.com/oscal-compass/compliance-trestle/security/advisories/new
-
Parent advisory (incompletely fixed): GHSA-4q5v-7g7x-j79w / CVE-2026-46345 — "Arbitrary File Write via Path Traversal in compliance-trestle – jinja"
-
Coordinated disclosure batch (part of the same PathSecurityValidator remediation): GHSA-gg2g-p7xc-qqmm (SSTI RCE), GHSA-g3vg-vx23-3858 (cache path traversal), GHSA-mj4x-vf5c-5xg8 (profile-import path traversal read), GHSA-w76h-q7c6-jpjp (SSRF)
-
Fix commits (jinja-only scope): 247fcce289f60103f3d8e28d8ec51a6986b94fb6, 7d107b3ac53caca7bde97a6278b23cd739d94525
-
Affected sinks: trestle/core/commands/author/catalog.py:69,90; author/ssp.py:97,111; author/prof.py:86,110; bypassed guard trestle/common/file_utils.py:95; write sink trestle/core/catalog/catalog_api.py:72; unused-here correct guard trestle/core/remote/security.py:326
-
Additional unguarded siblings: trestle/core/commands/create.py:95, trestle/core/commands/replicate.py:90
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "compliance-trestle"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.12.4"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "PyPI",
"name": "compliance-trestle"
},
"ranges": [
{
"events": [
{
"introduced": "4.0.0"
},
{
"fixed": "4.1.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-57171"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2026-09-24T19:52:34Z",
"nvd_published_at": "2026-08-26T05:18:11Z",
"severity": "HIGH"
},
"details": "**At a glance**\n\n- **Actor:** attacker who controls the -o/--output argument to trestle author {catalog,profile,ssp}-generate (e.g. via a CI pipeline that derives the output directory from repository-controlled data)\n\n- **Primitive:** attacker-controlled --output value reaches trestle_root / args.output write sink with only is_directory_name_allowed() (parts[0]-only task-name-collision check), not the PathSecurityValidator.validate_local_path() guard added by the CVE-2026-46345 fix\n\n- **Impact:** arbitrary-location file write outside the trestle workspace as the process owner (8.4 High; conservative C:N variant 7.7, still High); with --force-overwrite, the attacker-chosen directory is first recursively deleted shutil.rmtree)\n\n- **Precondition:** attacker influences the -o argument in a CI/automation pipeline or multi-tenant trestle workspace running these generate subcommands\n\n- **Fix:** call PathSecurityValidator.validate_local_path(markdown_path, trestle_root) immediately after building markdown_path in catalog.py, ssp.py, and prof.py, mirroring the existing jinja fix\n\n## Overview\n\nThe remediation for **CVE-2026-46345 / GHSA-4q5v-7g7x-j79w** (\"Arbitrary File Write via Path Traversal in compliance-trestle \u2013 jinja\") added a new PathSecurityValidator.validate_local_path() guard and wired it into the jinja command\u0027s output path. The identical output = trestle_root / args.output write pattern in the sibling author commands \u2014 catalog-generate, profile-generate, and ssp-generate \u2014 was **not** updated. Those commands instead rely on is_directory_name_allowed(), a task-name-collision check that does not stop path traversal: an absolute --output or a --output whose first component is innocuous subdir/../../../...) escapes the trestle workspace and writes generated markdown under an attacker-chosen output root outside the workspace, subject to the invoking process\u0027s filesystem permissions.\n\n## Impact\n\n**Threat model.** This is not a claim that a local user harms themselves by intentionally choosing an unsafe -o. The security boundary is crossed when a trusted automation job, CI workflow, shared trestle service, or wrapper invokes one of these subcommands and derives --output from repository-controlled, tenant-controlled, or otherwise untrusted data while expecting trestle to keep generated output inside the workspace. The attacker does not need local shell access to the trestle host; they only need influence over the data that the trusted automation maps into the --output argument.\n\n**Primary claim (confirmed):** Such an invocation writes control-markdown files **outside** the trestle workspace \u2014 arbitrary-location file write as the process owner. This is runtime-confirmed for catalog-generate: catalog-generate -o /tmp/TRESTLE_ESCAPE_ABS produced files outside the workspace on a v4.0.3 install while the same install blocked the equivalent jinja -o with a Security violation error. profile-generate and ssp-generate are source-confirmed siblings (identical trestle_root / args.output join, the same is_directory_name_allowed-only gate, no validate_local_path call); see Runtime-confirmed scope in the End-to-end verification below.\n\n**Destructive variant --force-overwrite, source-confirmed):** before generating, the force-overwrite path clears the selected output directory via clear_folder(...) trestle/core/commands/common/cmd_utils.py), which performs shutil.rmtree on that directory. Because clear_folder early-returns unless the target is an existing **directory**, the primitive is recursive deletion of an attacker-selected directory tree outside the workspace (e.g. wiping a directory the process owner can write), not pinpoint deletion of an arbitrary single file. This is the integrity + availability impact behind I:HA:H.\n\n**Secondary (conditional) escalation:** The affected population extends to every consumer that runs these generate subcommands in a CI/automation pipeline, shared/multi-tenant trestle workspace, or wrapper that forwards an externally supplied name \u2014 the same threat model GitHub/the maintainer accepted for CVE-2026-46345. Indirect code execution (e.g. overwriting a script the CI pipeline later invokes) is the bounded escalation beyond the demonstrated file-write primitive.\n\n## Technical Details\n\n**Source \u2192 Transform \u2192 Sink \u2192 Missing-guard \u2192 Result:** attacker-controlled --output CLI argument \u2192 trestle_root / args.output join in catalog.pyssp.pyprof.py \u2192 CatalogAPI.write_catalog_as_markdown() writes files under the resolved path \u2192 only is_directory_name_allowed() (parts[0]-only task-name check) applied, not PathSecurityValidator.validate_local_path() \u2192 files written outside the trestle workspace.\n\n### The fix is scoped to jinja.py only\n\nBoth fix commits 247fcce2\u2026, 7d107b3a\u2026, \"add path traversal protection and prevent SSTI in jinja templating\") touch only trestle/core/commands/author/jinja.py (+ its tests). The new guard:\n\n```python\n# trestle/core/commands/author/jinja.py\noutput_file = trestle_root / r_output_file\nPathSecurityValidator.validate_local_path(output_file, trestle_root) # :229 (and :278, :297)\n```\n\nvalidate_local_path trestle/core/remote/security.py:326) is the correct guard \u2014 it .resolve()s the path and calls relative_to(trestle_root), rejecting both .. traversal and absolute paths.\n\n### The sibling generate commands were not updated\n\ncatalog-generate, profile-generate, and ssp-generate build the output path with the **same** join but never call validate_local_path. The only check is is_directory_name_allowed:\n\n```python\n# trestle/core/commands/author/catalog.py:69 / ssp.py:97 / prof.py:86 (identical in all three)\nif not file_utils.is_directory_name_allowed(args.output):\n raise TrestleError(f\u0027{args.output} is not an allowed directory name\u0027)\n...\nmarkdown_path = trestle_root / args.output # catalog.py:90 / prof.py:110 (var markdown_path); ssp.py:111 (var md_path) \u2014 same join\n```\n\nis_directory_name_allowed trestle/common/file_utils.py:95) was designed to stop task names that collide with OSCAL model directories, not traversal. It inspects only parts[0]:\n\n```python\ndef is_directory_name_allowed(name: str) -\u003e bool:\n pathed_name = pathlib.Path(name)\n root_path = pathed_name.parts[0]\n if root_path in const.MODEL_TYPE_TO_MODEL_DIR.values(): return False # blocks \"catalogs\", \"profiles\", ...\n if root_path[0] == \u0027.\u0027: return False # blocks leading \".\" (i.e. \"../x\")\n if pathed_name.suffix != \u0027\u0027: return False # blocks names with a file suffix\n if \u0027__global__\u0027 in pathed_name.parts: return False\n return True\n```\n\nTwo payloads defeat it:\n\n1. **Absolute path** \u2014 --output /tmp/pwned. parts[0] is / (not an OSCAL dir, not .-prefixed, no suffix) \u2192 allowed. trestle_root / \u0027/tmp/pwned\u0027 collapses to /tmp/pwned (pathlib discards the left operand on absolute join).\n\n2. **Non-leading ..** \u2014 --output subdir/../../../../../../tmp/pwned. parts[0] is subdir (innocuous) \u2192 allowed. The .. segments resolve out of the workspace at write time.\n\nThe validated value flows unchanged to the write sink with no further sanitisation grep for resolve()/relative_to/validate_local_path across the catalog write path returns zero hits): ControlContext.generate(..., md_root=markdown_path, ...) stores it as a dataclass field trestle/core/control_context.py:46) and CatalogAPI.write_catalog_as_markdown() calls self._context.md_root.mkdir(exist_ok=True, parents=True) trestle/core/catalog/catalog_api.py:72) then writes \u003ccontrol-id\u003e.md files under it.\n\n### Additional unguarded siblings create, replicate)\n\ntrestle create trestle/core/commands/create.py:95, desired_model_dir = trestle_root / plural_path / args.output) and trestle replicate replicate.py:90) have **no** is_directory_name_allowed check at all and accept the same absolute / .. --output. They write a structured OSCAL model file and refuse to overwrite an existing target .exists() raises), so the primitive is create-only there \u2014 lower impact than the generate commands, but the same missing-guard root cause. These are flagged as related defense-in-depth sinks sharing the root cause, not as the primary impact claim of this report.\n\n### Severity note\n\nMetrics mirror the parent CVE-2026-46345 (8.4, AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H). I:HA:H are direct and demonstrated: out-of-workspace file creation, plus recursive shutil.rmtree of an attacker-chosen directory under --force-overwrite. C:H is proposed for consistency with the parent advisory\u0027s published score for the same out-of-workspace write boundary; however, the directly demonstrated primitive is write/overwrite rather than file read, so a conservative vector with C:N AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H) yields **7.7, still High**. S:U because trestle writes as the invoking user.\n\n### Why OSCAL id-validation does not prevent this\n\nOSCAL model ids control.id, group.id) are NCName-validated constr(regex=\u2026)) and cannot contain /, \\, or a leading .., so the per-control **leaf** filenames grp1/ac-1.md) cannot themselves traverse. That validation does not help here: the **base** output root md_root = trestle_root / args.output is built from the raw, unconstrained -o/--output CLI string and is joined before those safe leaves. An absolute or non-leading.. -o escapes the workspace, and the NCName-safe leaves are written underneath the escaped root \u2014 confirmed by the PoC, where the escape occurs at md_root /tmp/TRESTLE_ESCAPE_ABS) with grp1/ac-1.md written beneath it.\n\n## Reproduction\n\nNon-web target (Python CLI). PoC is a command sequence run against a **local** install of the project\u0027s current source (HEAD e22e35bd, reports as v4.0.3) \u2014 no vendor infrastructure touched.\n\n### Step 1 \u2014 Set up a normal trestle workspace with a one-control catalog\n\n```bash\npip install -e . # editable install of the affected source (v4.0.3)\nmkdir /tmp/poc_ws \u0026\u0026 cd /tmp/poc_ws\ntrestle init\nmkdir -p catalogs/mycat\npython3 - \u003c\u003c\u0027PY\u0027\nimport uuid, json\ncat = {\"catalog\":{\"uuid\":str(uuid.uuid4()),\n \"metadata\":{\"title\":\"PoC Catalog\",\"last-modified\":\"2026-01-01T00:00:00.000+00:00\",\"version\":\"1.0\",\"oscal-version\":\"1.0.4\"},\n \"groups\":[{\"id\":\"grp1\",\"title\":\"Group One\",\"controls\":[\n {\"id\":\"ac-1\",\"title\":\"PoC Control\",\"parts\":[{\"id\":\"ac-1_smt\",\"name\":\"statement\",\"prose\":\"PoC statement prose.\"}]}]}]}}\njson.dump(cat, open(\"catalogs/mycat/catalog.json\",\"w\"), indent=2)\nPY\n```\n\n### Step 2 \u2014 Trigger the boundary failure (absolute-path escape)\n\n```bash\ntrestle author catalog-generate -n mycat -o /tmp/TRESTLE_ESCAPE_ABS\nls /tmp/TRESTLE_ESCAPE_ABS/grp1/ac-1.md\n```\n\nRecorded output:\n\n```text\n$ ls /tmp/TRESTLE_ESCAPE_ABS/grp1/ac-1.md\n/tmp/TRESTLE_ESCAPE_ABS/grp1/ac-1.md # written OUTSIDE /tmp/poc_ws\n$ head -3 /tmp/TRESTLE_ESCAPE_ABS/grp1/ac-1.md\n# ac-1 - \\[Group One\\] PoC Control\n## Control Statement\n```\n\n### Step 3 \u2014 Same escape via non-leading .. (defeats is_directory_name_allowed)\n\n```bash\ntrestle author catalog-generate -n mycat -o \u0027subdir/../../../../../../tmp/TRESTLE_ESCAPE_DOTDOT\u0027\nls /tmp/TRESTLE_ESCAPE_DOTDOT/grp1/ac-1.md # -\u003e exists, outside the workspace\n```\n\n### Step 4 \u2014 Differential: the patched jinja -o is blocked on the SAME install\n\n```bash\necho \u0027hello {{ 1+1 }}\u0027 \u003e template.j2\ntrestle author jinja -i template.j2 -o \u0027/tmp/TRESTLE_JINJA_BLOCKED\u0027\n```\n\nRecorded output (fix is active; proves this is an incomplete fix, not an unpatched version):\n\n```text\nERROR: ... Security violation: Path traversal blocked. Attempted to access\n\"/tmp/TRESTLE_JINJA_BLOCKED\" which is outside the trestle workspace \"/tmp/poc_ws\"\n# (no file created)\n```\n\ncatalog-generate escapes while jinja is blocked \u2192 the validate_local_path remediation was never applied to the generate commands.\n\n### End-to-end verification (runtime)\n\n- **Lab setup:** editable install pip install -e .) of the affected source at HEAD e22e35bd (reports as v4.0.3, the release that contains the GHSA-4q5v jinja fix). import trestle.core.commands.author.catalog resolves to the in-tree source file, confirming the run exercises HEAD, not a stale wheel.\n\n- **Observed end-to-end effect (not an intermediate return value):** files physically written outside the workspace \u2014 /tmp/TRESTLE_ESCAPE_ABS/grp1/ac-1.md and /tmp/TRESTLE_ESCAPE_DOTDOT/grp1/ac-1.md \u2014 while /tmp/poc_ws (the trestle root) contained no such directory. Confirmed by findls.\n\n- **Differential control:** the same install rejects the equivalent jinja -o with Security violation: Path traversal blocked \u2026 outside the trestle workspace, writing nothing. The guard exists and works in jinja; it is simply absent from the generate commands.\n\n- **Guard bypass, isolated:** importing is_directory_name_allowed semantics and joining via pathlib confirms -o /tmp/pwned (absolute) and -o subdir/../../../tmp/pwned (innocuous leading component) both pass the check and resolve outside the root, while the naive -o ../../tmp/pwned is the only form the check stops.\n\n- **Runtime-confirmed scope (what was executed vs source-confirmed):** the write escape is runtime-confirmed for catalog-generate (Steps 2\u20134 above). profile-generate and ssp-generate are source-confirmed siblings \u2014 same trestle_root / args.output join prof.py:110, ssp.py:111), same is_directory_name_allowed-only gate prof.py:86, ssp.py:97), no validate_local_path \u2014 and should be fixed in the same patch. The --force-overwrite recursive-delete primitive clear_folder \u2192 shutil.rmtree, with an early return unless the target is an existing directory) is source-confirmed; the PoC above exercises the write escape, not -fo.\n\n## Suggested Fix\n\n**Root-cause fix:** Mirror the jinja fix in the three generate commands (and, for completeness, createreplicate): after constructing the output path, call the existing guard before any mkdir/write.\n\n```python\n# catalog.py / ssp.py / prof.py, immediately after markdown_path = trestle_root / args.output\nfrom trestle.core.remote.security import PathSecurityValidator\nPathSecurityValidator.validate_local_path(markdown_path, trestle_root)\n```\n\nis_directory_name_allowed() should be retained for its original purpose (OSCAL-dir-collision prevention) but must not be relied on for traversal defence.\n\n**Defense-in-depth:** Harden is_directory_name_allowed to reject absolute paths pathed_name.is_absolute()) and any .. component so it provides a secondary layer even if the primary validate_local_path call is accidentally omitted in future.\n\n## References\n\n- Vendor security policy: https://github.com/oscal-compass/compliance-trestle/security/policy\n\n- Submission endpoint: https://github.com/oscal-compass/compliance-trestle/security/advisories/new\n\n- Parent advisory (incompletely fixed): GHSA-4q5v-7g7x-j79w / CVE-2026-46345 \u2014 \"Arbitrary File Write via Path Traversal in compliance-trestle \u2013 jinja\"\n\n- Coordinated disclosure batch (part of the same PathSecurityValidator remediation): GHSA-gg2g-p7xc-qqmm (SSTI RCE), GHSA-g3vg-vx23-3858 (cache path traversal), GHSA-mj4x-vf5c-5xg8 (profile-import path traversal read), GHSA-w76h-q7c6-jpjp (SSRF)\n\n- Fix commits (jinja-only scope): 247fcce289f60103f3d8e28d8ec51a6986b94fb6, 7d107b3ac53caca7bde97a6278b23cd739d94525\n\n- Affected sinks: trestle/core/commands/author/catalog.py:69,90; author/ssp.py:97,111; author/prof.py:86,110; bypassed guard trestle/common/file_utils.py:95; write sink trestle/core/catalog/catalog_api.py:72; unused-here correct guard trestle/core/remote/security.py:326\n\n- Additional unguarded siblings: trestle/core/commands/create.py:95, trestle/core/commands/replicate.py:90",
"id": "GHSA-r4vp-3vw6-r2x5",
"modified": "2026-09-24T19:52:34Z",
"published": "2026-09-24T19:52:34Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/oscal-compass/compliance-trestle/security/advisories/GHSA-4q5v-7g7x-j79w"
},
{
"type": "WEB",
"url": "https://github.com/oscal-compass/compliance-trestle/security/advisories/GHSA-r4vp-3vw6-r2x5"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-57171"
},
{
"type": "WEB",
"url": "https://github.com/oscal-compass/compliance-trestle/pull/2270"
},
{
"type": "WEB",
"url": "https://github.com/oscal-compass/compliance-trestle/commit/37ed44f5f2e074202c8eb7c2f203c05d19461cdc"
},
{
"type": "WEB",
"url": "https://github.com/oscal-compass/compliance-trestle/commit/5335ff873a2a68eb7de43df029bea09cadff22fd"
},
{
"type": "PACKAGE",
"url": "https://github.com/oscal-compass/compliance-trestle"
},
{
"type": "WEB",
"url": "https://github.com/oscal-compass/compliance-trestle/releases/tag/v3.12.4"
},
{
"type": "WEB",
"url": "https://github.com/oscal-compass/compliance-trestle/releases/tag/v4.1.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Trestle is vulnerable to arbitrary file write via path traversal in author generate commands (Incomplete fix of CVE-2026-46345)"
}
GHSA-R4VP-4F57-WHHF
Vulnerability from github – Published: 2023-09-08 15:30 – Updated: 2024-04-04 07:34SolarView Compact < 6.00 is vulnerable to Directory Traversal.
{
"affected": [],
"aliases": [
"CVE-2023-40924"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-09-08T13:15:08Z",
"severity": "HIGH"
},
"details": "SolarView Compact \u003c 6.00 is vulnerable to Directory Traversal.",
"id": "GHSA-r4vp-4f57-whhf",
"modified": "2024-04-04T07:34:10Z",
"published": "2023-09-08T15:30:18Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-33620"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-40924"
},
{
"type": "WEB",
"url": "https://github.com/Yobing1/CVE-2023-40924/blob/main/README.md"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
Mitigation MIT-5.1
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- When validating filenames, use stringent allowlists that limit the character set to be used. If feasible, only allow a single "." character in the filename to avoid weaknesses such as CWE-23, and exclude directory separators such as "/" to avoid CWE-36. Use a list of allowable file extensions, which will help to avoid CWE-434.
- Do not rely exclusively on a filtering mechanism that removes potentially dangerous characters. This is equivalent to a denylist, which may be incomplete (CWE-184). For example, filtering "/" is insufficient protection if the filesystem also supports the use of "\" as a directory separator. Another possible error could occur when the filtering is applied in a way that still produces dangerous data (CWE-182). For example, if "../" sequences are removed from the ".../...//" string in a sequential fashion, two instances of "../" would be removed from the original string, but the remaining characters would still form the "../" string.
Mitigation MIT-15
For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Mitigation MIT-20.1
Strategy: Input Validation
- Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
- Use a built-in path canonicalization function (such as realpath() in C) that produces the canonical version of the pathname, which effectively removes ".." sequences and symbolic links (CWE-23, CWE-59). This includes:
- realpath() in C
- getCanonicalPath() in Java
- GetFullPath() in ASP.NET
- realpath() or abs_path() in Perl
- realpath() in PHP
Mitigation MIT-4
Strategy: Libraries or Frameworks
Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
Mitigation MIT-29
Strategy: Firewall
Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].
Mitigation MIT-17
Strategy: Environment Hardening
Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
Mitigation MIT-21.1
Strategy: Enforcement by Conversion
- When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.
- For example, ID 1 could map to "inbox.txt" and ID 2 could map to "profile.txt". Features such as the ESAPI AccessReferenceMap [REF-185] provide this capability.
Mitigation MIT-22
Strategy: Sandbox or Jail
- Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software.
- OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations.
- This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise.
- Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-34
Strategy: Attack Surface Reduction
- Store library, include, and utility files outside of the web document root, if possible. Otherwise, store them in a separate directory and use the web server's access control capabilities to prevent attackers from directly requesting them. One common practice is to define a fixed constant in each calling program, then check for the existence of the constant in the library/include file; if the constant does not exist, then the file was directly requested, and it can exit immediately.
- This significantly reduces the chance of an attacker being able to bypass any protection mechanisms that are in the base program but not in the include files. It will also reduce the attack surface.
Mitigation MIT-39
- Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success.
- If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files.
- Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.
- In the context of path traversal, error messages which disclose path information can help attackers craft the appropriate attack strings to move through the file system hierarchy.
Mitigation MIT-16
Strategy: Environment Hardening
When using PHP, configure the application so that it does not use register_globals. During implementation, develop the application so that it does not rely on this feature, but be wary of implementing a register_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.
CAPEC-126: Path Traversal
An adversary uses path manipulation methods to exploit insufficient input validation of a target to obtain access to data that should be not be retrievable by ordinary well-formed requests. A typical variety of this attack involves specifying a path to a desired file together with dot-dot-slash characters, resulting in the file access API or function traversing out of the intended directory structure and into the root file system. By replacing or modifying the expected path information the access function or API retrieves the file desired by the attacker. These attacks either involve the attacker providing a complete path to a targeted file or using control characters (e.g. path separators (/ or \) and/or dots (.)) to reach desired directories or files.
CAPEC-64: Using Slashes and URL Encoding Combined to Bypass Validation Logic
This attack targets the encoding of the URL combined with the encoding of the slash characters. An attacker can take advantage of the multiple ways of encoding a URL and abuse the interpretation of the URL. A URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An attacker will try to craft an URL with a sequence of special characters which once interpreted by the server will be equivalent to a forbidden URL. It can be difficult to protect against this attack since the URL can contain other format of encoding such as UTF-8 encoding, Unicode-encoding, etc.
CAPEC-76: Manipulating Web Input to File System Calls
An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.
CAPEC-78: Using Escaped Slashes in Alternate Encoding
This attack targets the use of the backslash in alternate encoding. An adversary can provide a backslash as a leading character and causes a parser to believe that the next character is special. This is called an escape. By using that trick, the adversary tries to exploit alternate ways to encode the same character which leads to filter problems and opens avenues to attack.
CAPEC-79: Using Slashes in Alternate Encoding
This attack targets the encoding of the Slash characters. An adversary would try to exploit common filtering problems related to the use of the slashes characters to gain access to resources on the target host. Directory-driven systems, such as file systems and databases, typically use the slash character to indicate traversal between directories or other container components. For murky historical reasons, PCs (and, as a result, Microsoft OSs) choose to use a backslash, whereas the UNIX world typically makes use of the forward slash. The schizophrenic result is that many MS-based systems are required to understand both forms of the slash. This gives the adversary many opportunities to discover and abuse a number of common filtering problems. The goal of this pattern is to discover server software that only applies filters to one version, but not the other.