CVE-2023-1800: Github.com/sjqzhang/go fastdfs Path Traversal Vulnerability

CRITICAL
Advisory Identifier: GHSA-xq3x-grrj-fj6x
CVSS 9.8
CWE-24 CWE-434 CWE-22
Published
Advisory Summary

CVE-2023-1800 is a CRITICAL (CVSS 9.8) path traversal vulnerability (CWE-24: Path Traversal: '../filedir') affecting Github.com/sjqzhang/go fastdfs libraries in the Go ecosystem. The issue involves sjqzhang go-fastdfs vulnerable to path traversal. Remediation is available by upgrading affected packages to version 1.4.5-0.20230408141131-61cbff5124c6.

CVE-2023-1800 at a Glance

CVE Identifier CVE-2023-1800
GHSA Identifier GHSA-xq3x-grrj-fj6x
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-24: Path Traversal: '../filedir'
Affected Product Github.com/sjqzhang/go fastdfs
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.8

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
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-2023-1800

To remediate this vulnerability, upgrade all affected Github.com/sjqzhang/go fastdfs 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/sjqzhang/go-fastdfs fixed: 1.4.5-0.20230408141131-61cbff5124c6
Upgrade github.com/sjqzhang/go-fastdfs to 1.4.5-0.20230408141131-61cbff5124c6
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/sjqzhang/go-fastdfs

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-1800, inspect your project dependencies for Github.com/sjqzhang/go fastdfs:

inspect dependencies for github.com/sjqzhang/go-fastdfs

Analyze the terminal output to locate any version of Github.com/sjqzhang/go fastdfs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.5-0.20230408141131-61cbff5124c6), 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-24: Path Traversal: '../filedir', where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize "../" sequences that can resolve to a location that is outside of that directory. In Github.com/sjqzhang/go fastdfs, 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

sjqzhang go-fastdfs up to 1.4.3 is vulnerable to path traversal in the function upload of the file `/group1/upload` of the component `File Upload Handler`. The attack may be launched remotely and the exploit has been disclosed to the public and may be used.

CVE-2023-1800 Affected Github.com/sjqzhang/go fastdfs Versions

1 component(s)
Fixed Versions:
1.4.5-0.20230408141131-61cbff5124c6
Product / Package Ecosystem Affected Versions Fixed Version
github.com/sjqzhang/go-fastdfs
Go
< 1.4.5-0.20230408141131-61cbff5124c6
1.4.5-0.20230408141131-61cbff5124c6

References

Frequently Asked Questions

What is CVE-2023-1800?
CVE-2023-1800 is a security vulnerability in Github.com/sjqzhang/go fastdfs involving sjqzhang go-fastdfs vulnerable to path traversal under CWE-24: Path Traversal: '../filedir'.
Which Github.com/sjqzhang/go fastdfs versions are affected?
Affected versions include releases prior to 1.4.5-0.20230408141131-61cbff5124c6 across affected packages: github.com/sjqzhang/go-fastdfs.
What version fixes CVE-2023-1800?
Upgrading to 1.4.5-0.20230408141131-61cbff5124c6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/sjqzhang/go-fastdfs affected?
Yes, github.com/sjqzhang/go-fastdfs is affected in releases prior to 1.4.5-0.20230408141131-61cbff5124c6. Upgrade your dependency to 1.4.5-0.20230408141131-61cbff5124c6 or later.
What is the CVSS score of CVE-2023-1800?
CVE-2023-1800 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-1800?
CVE-2023-1800 is classified under CWE-24: Path Traversal: '../filedir' (The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize "../" sequences that can resolve to a location that is outside of that directory.).
How can I check Go dependencies for CVE-2023-1800?
Run the dependency tree command: 'inspect dependencies for github.com/sjqzhang/go-fastdfs'. 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-xq3x-grrj-fj6x",
  "modified" : "2024-05-20T21:50:28Z",
  "published" : "2023-04-02T12:30:16Z",
  "aliases" : [ "CVE-2023-1800" ],
  "summary" : "sjqzhang go-fastdfs vulnerable to path traversal",
  "details" : "sjqzhang go-fastdfs up to 1.4.3 is vulnerable to path traversal in the function upload of the file `/group1/upload` of the component `File Upload Handler`. The attack may be launched remotely and the exploit has been disclosed to the public and may be used.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/sjqzhang/go-fastdfs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.5-0.20230408141131-61cbff5124c6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-1800"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sjqzhang/go-fastdfs/commit/61cbff5124c61e292994099372b11c06cdb5b80b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sjqzhang/go-fastdfs"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yangyanglo/ForCVE/blob/93a16663cd32a36d37d8a0f0102e1592254d0279/2023-0x05.md"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yangyanglo/ForCVE/blob/main/2023-0x05.md"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?ctiid.224768"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?id.224768"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-24", "CWE-434" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-04-07T22:24:59Z",
    "nvd_published_at" : "2023-04-02T11:15:00Z"
  }
}