Vulnerabilities in pkg:pypi/hyper-bump-it
PACKAGECVE-2023-41057 is a LOW (CVSS 3.3) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Hyper bump it libraries in the PyPI ecosystem. The issue involves improper limitation of a pathname to a restricted directory ('path traversal') in hyper-bump-it. Remediation is available by upgrading affected packages to version 0.5.1.
pkg:pypi/hyper-bump-it
Vulnerability advisories affecting package pkg:pypi/hyper-bump-it. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-xc27-f9q3-4448 | CVE-2023-41057 | LOW | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in hyper-bump-it |
CVE-2023-41057 at a Glance
Security Impact
CVSS: 3.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N).
How to Fix CVE-2023-41057
To remediate this vulnerability, upgrade all affected Hyper bump it 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 hyper-bump-it>=0.5.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show hyper-bump-it
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2023-41057, inspect your installed packages using pip:
pip show hyper-bump-it
Analyze the terminal output to locate any version of Hyper bump it in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.1), your application is affected.
Note: The pip show hyper-bump-it 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 Hyper bump it, 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
CVE-2023-41057 Affected Hyper bump it Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
hyper-bump-it
|
PyPI |
< 0.5.1
|
0.5.1
|
References
Frequently Asked Questions
What is CVE-2023-41057?
Which Hyper bump it versions are affected?
What version fixes CVE-2023-41057?
Is hyper-bump-it affected?
What is the CVSS score of CVE-2023-41057?
What CWE is associated with CVE-2023-41057?
How can I check PyPI dependencies for CVE-2023-41057?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xc27-f9q3-4448",
"modified" : "2023-10-09T19:51:02Z",
"published" : "2023-09-04T17:02:36Z",
"aliases" : [ "CVE-2023-41057" ],
"summary" : "Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in hyper-bump-it",
"details" : "### Summary\n`hyper-bump-it` reads a file glob pattern from the configuration file. That is combined with the project root directory to construct a full glob pattern that is used to find files that should be edited. These matched files should be contained within the project root directory, but that is not checked. This could result in changes being written to files outside of the project.\n\nThe default behaviour of `hyper-bump-it` is to display the planned changes and prompt the user for confirmation before editing any files. However, the configuration file provides a field that can be used cause files to be edited without displaying the prompt.\n\n### Details\n\nThe vulnerability is present in \n\nhttps://github.com/plannigan/hyper-bump-it/blob/49c726201bbdc02c052302e03fd907d2170e1f47/hyper_bump_it/_hyper_bump_it/files.py#L35\n\nThat code joins the project root directory with a string read from the configuration file without checking if the final path is located outside the project root directory.\n\nThe following configuration file contents would cause `hyper-bump-it` to replace every instance of \"hello\" in every file adjacent to the project root directory with \"world\". The line setting `show_confirm_prompt` to `false` is not required, but will result in the user file edits to occur without the user having a chance to reject the changes (The fact that changes happened would still be displayed). \n\n```toml\n[hyper-bump-it]\ncurrent_version = \"1.2.3\"\nshow_confirm_prompt=false\n\n[[hyper-bump-it.files]]\nfile_glob = \"../*\"\nsearch_format_pattern = \"hello\"\nreplace_format_pattern = \"world\"\n```\n\n### Patches\nA fix that been released as part of v0.5.1. The changes can be view as part of PR #307.\n\n### Workarounds\nUsers that are unable to update from vulnerable versions, executing `hyper-bump-it` with the `--interactive` command line argument will ensure that all planned changes are displayed and prompt the user for confirmation before editing any files, even if the configuration file contains `show_confirm_prompt=true`.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "hyper-bump-it"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.5.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/plannigan/hyper-bump-it/security/advisories/GHSA-xc27-f9q3-4448"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-41057"
}, {
"type" : "WEB",
"url" : "https://github.com/plannigan/hyper-bump-it/pull/307"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/plannigan/hyper-bump-it"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2023-09-04T17:02:36Z",
"nvd_published_at" : "2023-09-04T18:15:09Z"
}
}