# CVE-2023-41057: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in hyper-bump-it

> Attackers can modify files outside the project directory via crafted glob patterns in the configuration file, requiring non-default configuration to bypass confirmation prompts.

- **Severity:** Medium 5.5 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 4 Sep 2023
- **Updated:** 27 Sep 2024
- **Also known as:** GHSA-xc27-f9q3-4448, PYSEC-2026-1456

## What is CVE-2023-41057?

CVE-2023-41057 is a medium-severity path traversal vulnerability in plannigan hyper-bump-it, published on 4 Sep 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

hyper-bump-it is a command line tool for updating the version in project files.`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. The 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. This issue has been fixed in release version 0.5.1. Users are advised to upgrade. Users 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`.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2023-41057?

3 open source packages ship an affected version, including hyper-bump-it. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `hyper-bump-it` | PyPI | All versions | 0.5.1 |
| `hyper-bump-it` | PyPI | All versions | 0.5.1 |
| `hyper-bump-it` | PyPI | All versions | 0.5.1 |

Products: Plannigan Hyper Bump It.

## How do I fix CVE-2023-41057?

Upgrade hyper-bump-it to 0.5.1 or later.

## Is CVE-2023-41057 being exploited?

There is no known exploitation of CVE-2023-41057 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-41057 and fix it if it is affected.

What it is: CVE-2023-41057 is a medium-severity path traversal vulnerability in plannigan hyper-bump-it, published on 4 Sep 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2023-41057 in the wild and no public exploit code.

Affected packages and fixed versions:
- hyper-bump-it (PyPI): affected all versions; fixed in 0.5.1
- hyper-bump-it (PyPI): affected all versions; fixed in 0.5.1
- hyper-bump-it (PyPI): affected all versions; fixed in 0.5.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-41057/ (Markdown: https://insights.sbomify.com/CVE-2023-41057/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-41057
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-41057
- OSV: https://osv.dev/vulnerability/CVE-2023-41057

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-41057/
Summaries are generated and may contain mistakes; the official description above is the record.
