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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.8
- **CVSS:** 8.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, login needed
- **EPSS:** 0.84% (percentile 55, 2026-11-26)
- **CWE:** CWE-22, CWE-73
- **Aliases:** GHSA-w469-hj2f-jpr5, GO-2025-3926
- **Published:** 2025-08-29T16:41:57.000Z
- **Modified:** 2026-10-19T17:10:00.173Z

## Who should check

- Projects that depend on Go package github.com/harness/gitness (\>= 1.0.4, \< 3.3.0)
- Anyone running harness \< 3.3.0

## 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.

## Affected and fixed versions

- Go `github.com/harness/gitness`: affected \>= 1.0.4, \< 3.3.0; fixed 3.3.0, 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13 (osv)
- harness: \< 3.3.0 (cvelist)

## Mitigation

- Upgrade github.com/harness/gitness to one of 3.3.0, 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13 (or later in the same release line).

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-58158. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-58158.md
Affected: github.com/harness/gitness >= 1.0.4, < 3.3.0
Fixed in: 3.3.0, 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13

Steps:
1. Search this machine and project for github.com/harness/gitness (Go), harness: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-58158 being exploited?

There is no confirmed exploitation: CVE-2025-58158 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.84% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-58158?

High: CVSS 8.8 (v3.1, scored by CNA). Remote, login needed.

### Which versions are affected by CVE-2025-58158?

github.com/harness/gitness \>= 1.0.4, \< 3.3.0.

### Is there a fix for CVE-2025-58158?

Yes. Fixed in 3.3.0, 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13. Upgrade github.com/harness/gitness to one of 3.3.0, 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13 (or later in the same release line).

### How do I check if I'm affected by CVE-2025-58158?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/harness/harness/security/advisories/GHSA-w469-hj2f-jpr5>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2025-58158>
- patch: <https://github.com/harness/harness/commit/21c5ce42ae13740b1cad47706c2ec85e72cc8c20>
- other: <https://github.com/harness/harness>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-58158>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-w469-hj2f-jpr5> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GO-2025-3926> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2025-58158> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-58158>
