CVE-2024-40120: Github.com/seaweedfs/seaweedfs SQL Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-q97m-8853-pq76
CVSS 6.5
CWE-89
Published
Advisory Summary

CVE-2024-40120 is a MODERATE (CVSS 6.5) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Github.com/seaweedfs/seaweedfs libraries in the Go ecosystem. The issue involves seaweedfs vulnerable to sql injection. Remediation is available by upgrading affected packages to version 0.0.0-20240625155419-9ac102336200.

CVE-2024-40120 at a Glance

CVE Identifier CVE-2024-40120
GHSA Identifier GHSA-q97m-8853-pq76
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Github.com/seaweedfs/seaweedfs
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:L/I:L/A:N).

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 Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-40120

To remediate this vulnerability, upgrade all affected Github.com/seaweedfs/seaweedfs 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/seaweedfs/seaweedfs fixed: 0.0.0-20240625155419-9ac102336200
Upgrade github.com/seaweedfs/seaweedfs to 0.0.0-20240625155419-9ac102336200
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/seaweedfs/seaweedfs

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-40120, inspect your project dependencies for Github.com/seaweedfs/seaweedfs:

inspect dependencies for github.com/seaweedfs/seaweedfs

Analyze the terminal output to locate any version of Github.com/seaweedfs/seaweedfs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20240625155419-9ac102336200), 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-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Github.com/seaweedfs/seaweedfs, 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

seaweedfs v3.68 was discovered to contain a SQL injection vulnerability via the component /abstract_sql/abstract_sql_store.go.

CVE-2024-40120 Affected Github.com/seaweedfs/seaweedfs Versions

1 component(s)
Fixed Versions:
0.0.0-20240625155419-9ac102336200
Product / Package Ecosystem Affected Versions Fixed Version
github.com/seaweedfs/seaweedfs
Go
< 0.0.0-20240625155419-9ac102336200
0.0.0-20240625155419-9ac102336200

References

Frequently Asked Questions

What is CVE-2024-40120?
CVE-2024-40120 is a security vulnerability in Github.com/seaweedfs/seaweedfs involving SeaweedFS Vulnerable to SQL Injection under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Github.com/seaweedfs/seaweedfs versions are affected?
Affected versions include releases prior to 0.0.0-20240625155419-9ac102336200 across affected packages: github.com/seaweedfs/seaweedfs.
What version fixes CVE-2024-40120?
Upgrading to 0.0.0-20240625155419-9ac102336200 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/seaweedfs/seaweedfs affected?
Yes, github.com/seaweedfs/seaweedfs is affected in releases prior to 0.0.0-20240625155419-9ac102336200. Upgrade your dependency to 0.0.0-20240625155419-9ac102336200 or later.
What is the CVSS score of CVE-2024-40120?
CVE-2024-40120 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2024-40120?
CVE-2024-40120 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Go dependencies for CVE-2024-40120?
Run the dependency tree command: 'inspect dependencies for github.com/seaweedfs/seaweedfs'. 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-q97m-8853-pq76",
  "modified" : "2025-05-16T21:59:35Z",
  "published" : "2025-05-16T15:31:02Z",
  "aliases" : [ "CVE-2024-40120" ],
  "summary" : "SeaweedFS Vulnerable to SQL Injection",
  "details" : "seaweedfs v3.68 was discovered to contain a SQL injection vulnerability via the component /abstract_sql/abstract_sql_store.go.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/seaweedfs/seaweedfs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20240625155419-9ac102336200"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-40120"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/seaweedfs/seaweedfs/issues/5710"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/seaweedfs/seaweedfs/commit/9ac1023362000f6e8e58c9d278653f5926a0d90e"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/sud0why/1b2115c1d644bd3db1c1b3f16684a78c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/seaweedfs/seaweedfs"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/seaweedfs/seaweedfs/releases/tag/3.69"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-05-16T21:59:34Z",
    "nvd_published_at" : "2025-05-16T13:15:51Z"
  }
}