CVE-2025-58158 Harness Affected by Arbitrary File Write in Gitness LFS server

High 8.8 Published Updated

Authenticated attackers can write arbitrary files to the server via the Git LFS upload API due to improper path sanitization, potentially compromising the system.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-58158?

CVE-2025-58158 is a high-severity path traversal vulnerability in harness, published on 29 Aug 2025. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

Harness Open Source is an end-to-end developer platform with Source Control Management, CI/CD Pipelines, Hosted Developer Environments, and Artifact Registries. Prior to version 3.3.0, Open Source Harness git LFS server (Gitness) exposes api to retrieve and upload files via git LFS. Implementation of upload git LFS file api is vulnerable to arbitrary file write. Due to improper sanitization for upload path, a malicious authenticated user who has access to Harness Gitness server api can use a crafted upload request to write arbitrary file to any location on file system, may even compromise the server. Users using git LFS are vulnerable. This issue has been patched in version 3.3.0.

Weakness: CWE-73, CWE-22

Which versions are affected by CVE-2025-58158?

5 open source packages ship an affected version, including github.com/harness/gitness.

PackageAffectedFixed in
github.com/harness/gitness GoAll versions1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13
github.com/harness/gitness GoAll versions1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13
github.com/harness/gitness GoAll versions1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13
github.com/harness/gitness GoFrom 1.0.43.3.0
github.com/harness/gitness GoFrom 1.0.43.3.0

How do I fix CVE-2025-58158?

Upgrade github.com/harness/gitness to a fixed version for your release line: 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13 or 3.3.0.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2025-58158 being exploited?

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

Sources

Also known as GHSA-w469-hj2f-jpr5, GO-2025-3926.

Is CVE-2025-58158 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free