GHSA-432c-wxpg-m4q3: Xml2rfc Xml2rfc Has File Inclusion Irregularities Vulnerability
MODERATEGHSA-432c-wxpg-m4q3 is a MODERATE xml2rfc has file inclusion irregularities vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Xml2rfc libraries in the PyPI ecosystem. The issue involves xml2rfc has file inclusion irregularities. Remediation is available by upgrading affected packages to version 3.27.0.
GHSA-432c-wxpg-m4q3 at a Glance
How to Fix GHSA-432c-wxpg-m4q3
To remediate this vulnerability, upgrade all affected Xml2rfc dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install xml2rfc>=3.27.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show xml2rfc
How to Check if You Are Affected
To determine whether your Python environment is affected by GHSA-432c-wxpg-m4q3, inspect your installed packages using pip:
pip show xml2rfc
Analyze the terminal output to locate any version of Xml2rfc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.27.0), your application is affected.
Note: The pip show xml2rfc command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where 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. In Xml2rfc, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-432c-wxpg-m4q3 Affected Xml2rfc Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
xml2rfc
|
PyPI |
≥ 3.12.0
< 3.27.0
|
3.27.0
|
References
Frequently Asked Questions
What is GHSA-432c-wxpg-m4q3?
Which Xml2rfc versions are affected?
What version fixes GHSA-432c-wxpg-m4q3?
Is xml2rfc affected?
What CWE is associated with GHSA-432c-wxpg-m4q3?
How can I check PyPI dependencies for GHSA-432c-wxpg-m4q3?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-432c-wxpg-m4q3",
"modified" : "2025-02-07T20:32:27Z",
"published" : "2025-02-07T20:32:27Z",
"aliases" : [ ],
"summary" : "xml2rfc has file inclusion irregularities",
"details" : "Version [3.12.0](https://github.com/ietf-tools/xml2rfc/blob/main/CHANGELOG.md#3120---2021-12-08) changed `xml2rfc` so that it would not access local files without the presence of its new `--allow-local-file-access` flag.\nThis prevented XML External Entity (XXE) injection attacks with `xinclude` and XML entity references.\n\nIt was discovered that `xml2rfc` does not respect `--allow-local-file-access` when a local file is specified as `src` in `artwork` or `sourcecode` elements. Furthermore, XML entity references can include any file inside the source dir and below without using the `--allow-local-file-access` flag. \n\nThe `xml2rfc <= 3.26.0` behaviour:\n\n| | `xinclude` | XML entity reference | `artwork src=` | `sourcecode src=` |\n|---|---|---|---|---|\n| without `--allow-local-file-access` flag | No filesystem access | Any file in xml2rfc templates dir and below, any file in source directory and below | Access source directory and below | Access source directory and below |\n| with `--allow-local-file-access` flag | Access any file on filesystem[^1] | Access any file on filesystem[^1] | Access source directory and below | Access source directory and below | Access source directory and below |\n\n [^1]: Access any file of the filesystem with the permissions of the user running `xml2rfc` can access.\n\n### Impact\n\nAnyone running `xml2rfc` as a service that accepts input from external users is impacted by this issue.\nSpecifying a file in `src` attribute in `artwork` or `sourcecode` elements will cause the contents of that file to appear in xml2rfc’s output results.\nBut that file has to be inside the same directory as the XML input source file.\nFor `artwork` and `sourcecode`, `xml2rfc` will not look above the source file directory.\n\n### The proposed new behaviour\n- Generalize file access checks.\n- Only allow access to files within src dir and below. (xml entity include can access templates dir).\n- Always allow access to `templates_dir` for XML entity includes.\n\nNew behaviour:\n\n| | `xinclude` | XML entity reference | `artwork src=` | `sourcecode src=` |\n|---|---|---|---|---|\n| without `--allow-local-file-access` flag | No filesystem access | No filesystem access _(except for `templates_dir`)_ | No filesystem access | No filesystem access |\n| with `--allow-local-file-access` flag | Access source directory and below | Access source directory and below _(Can access`templates_dir`)._ | Access source directory and below | Access source directory and below |\n\n### Workarounds\n\nUse a secure temporary directory to process un-trusted XML files, and do not reuse it for processing other XML documents.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "xml2rfc"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.12.0"
}, {
"fixed" : "3.27.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ietf-tools/xml2rfc/security/advisories/GHSA-432c-wxpg-m4q3"
}, {
"type" : "WEB",
"url" : "https://github.com/ietf-tools/xml2rfc/commit/ec98f9cb4b9a8658222117df037dda473ca3f4e4"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ietf-tools/xml2rfc"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-02-07T20:32:27Z",
"nvd_published_at" : null
}
}