Vulnerabilities in pkg:golang/github.com/harness/gitness

PACKAGE
Advisory Identifier: GHSA-w469-hj2f-jpr5
Advisory Summary

CVE-2025-58158 is a HIGH (CVSS 8.8) harness allows arbitrary file write vulnerability (CWE-73: External Control of File Name or Path) affecting Github.com/harness/gitness libraries in the Go ecosystem. The issue involves harness allows arbitrary file write in gitness lfs server. Remediation is available by upgrading affected packages to version 3.3.0, 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/harness/gitness

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/harness/gitness. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-w469-hj2f-jpr5 CVE-2025-58158 HIGH Harness Allows Arbitrary File Write in Gitness LFS server

CVE-2025-58158 at a Glance

CVE Identifier CVE-2025-58158
GHSA Identifier GHSA-w469-hj2f-jpr5
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-73: External Control of File Name or Path
Affected Product Github.com/harness/gitness
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2025-58158

To remediate this vulnerability, upgrade all affected Github.com/harness/gitness dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/harness/gitness fixed: 3.3.0
Upgrade github.com/harness/gitness to 3.3.0
github.com/harness/gitness fixed: 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13
Upgrade github.com/harness/gitness to 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/harness/gitness

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-58158, inspect your project dependencies for Github.com/harness/gitness:

inspect dependencies for github.com/harness/gitness

Analyze the terminal output to locate any version of Github.com/harness/gitness in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.3.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-73: External Control of File Name or Path, where the product allows user input to control or influence paths or file names that are used in filesystem operations. In Github.com/harness/gitness, 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

### Impact 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. ### Patches Users have to upgrade to v3.3.0 . All previous versions are affected by this vulnerability.

CVE-2025-58158 Affected Github.com/harness/gitness Versions

2 component(s)
Fixed Versions:
3.3.01.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13
Product / Package Ecosystem Affected Versions Fixed Version
github.com/harness/gitness
Go
≥ 1.0.4
< 3.3.0
3.3.0
github.com/harness/gitness
Go
< 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13
1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13

References

Frequently Asked Questions

What is CVE-2025-58158?
CVE-2025-58158 is a security vulnerability in Github.com/harness/gitness involving Harness Allows Arbitrary File Write in Gitness LFS server under CWE-73: External Control of File Name or Path.
Which Github.com/harness/gitness versions are affected?
Affected versions include releases prior to 3.3.0, 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13 across affected packages: github.com/harness/gitness.
What version fixes CVE-2025-58158?
Upgrading to 3.3.0, 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/harness/gitness affected?
Yes, github.com/harness/gitness is affected in releases prior to 3.3.0, 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13. Upgrade your dependency to 3.3.0, 1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13 or later.
What is the CVSS score of CVE-2025-58158?
CVE-2025-58158 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2025-58158?
CVE-2025-58158 is classified under CWE-73: External Control of File Name or Path (The product allows user input to control or influence paths or file names that are used in filesystem operations.).
How can I check Go dependencies for CVE-2025-58158?
Run the dependency tree command: 'inspect dependencies for github.com/harness/gitness'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w469-hj2f-jpr5",
  "modified" : "2025-08-29T21:09:11Z",
  "published" : "2025-08-29T16:41:57Z",
  "aliases" : [ "CVE-2025-58158" ],
  "summary" : "Harness Allows Arbitrary File Write in Gitness LFS server",
  "details" : "### Impact\nOpen 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. \n\nUsers using git LFS are vulnerable.\n\n### Patches\nUsers have to upgrade to v3.3.0 . All previous versions are affected by this vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/harness/gitness"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.4"
      }, {
        "fixed" : "3.3.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/harness/gitness"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.4-gitspaces-beta.0.20250808064055-21c5ce42ae13"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/harness/harness/security/advisories/GHSA-w469-hj2f-jpr5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-58158"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/harness/harness/commit/21c5ce42ae13740b1cad47706c2ec85e72cc8c20"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/harness/harness"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-73" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-08-29T16:41:57Z",
    "nvd_published_at" : "2025-08-29T18:15:42Z"
  }
}