CVE-2024-3135: Github.com/go skynet/LocalAI LocalAI Cross-site Request Forgery Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-jhvf-7c85-3c9g
CVSS 6.5
CWE-352
Published
Advisory Summary

CVE-2024-3135 is a MODERATE (CVSS 6.5) localai cross-site request forgery vulnerability vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Github.com/go skynet/LocalAI libraries in the Go ecosystem. The issue involves localai cross-site request forgery vulnerability. Remediation is available in the latest vendor maintenance releases.

CVE-2024-3135 at a Glance

CVE Identifier CVE-2024-3135
GHSA Identifier GHSA-jhvf-7c85-3c9g
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-352: Cross-Site Request Forgery (CSRF)
Affected Product Github.com/go skynet/LocalAI
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.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).

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

How to Fix CVE-2024-3135

To remediate this vulnerability, upgrade all affected Github.com/go skynet/LocalAI 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/go-skynet/LocalAI fixed: Latest secure release
Upgrade github.com/go-skynet/LocalAI to Latest secure release
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/go-skynet/LocalAI

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-3135, inspect your project dependencies for Github.com/go skynet/LocalAI:

inspect dependencies for github.com/go-skynet/LocalAI

Analyze the terminal output to locate any version of Github.com/go skynet/LocalAI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), 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-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. In Github.com/go skynet/LocalAI, 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

A Cross-Site Request Forgery (CSRF) vulnerability exists in the mudler/localai application, allowing attackers to craft malicious webpages that, when visited by a victim, perform unauthorized actions on the victim's local LocalAI instance without their consent. This vulnerability enables attackers to exhaust system resources, consume credits, and fill disk space by making numerous resource-intensive API calls, such as generating images or uploading files. The vulnerability stems from the application's acceptance of simple request content-types without requiring CSRF tokens or implementing other CSRF mitigation measures. Successful exploitation does not require network access to the vulnerable LocalAI environment.

CVE-2024-3135 Affected Github.com/go skynet/LocalAI Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
github.com/go-skynet/LocalAI
Go
≤ 2.7.0

References

Frequently Asked Questions

What is CVE-2024-3135?
CVE-2024-3135 is a security vulnerability in Github.com/go skynet/LocalAI involving LocalAI cross-site request forgery vulnerability under CWE-352: Cross-Site Request Forgery (CSRF).
Which Github.com/go skynet/LocalAI versions are affected?
Affected versions include releases prior to current release patches across affected packages: github.com/go-skynet/LocalAI.
What version fixes CVE-2024-3135?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/go-skynet/LocalAI affected?
Yes, github.com/go-skynet/LocalAI is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2024-3135?
CVE-2024-3135 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2024-3135?
CVE-2024-3135 is classified under CWE-352: Cross-Site Request Forgery (CSRF) (The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.).
How can I check Go dependencies for CVE-2024-3135?
Run the dependency tree command: 'inspect dependencies for github.com/go-skynet/LocalAI'. 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-jhvf-7c85-3c9g",
  "modified" : "2024-04-16T15:49:36Z",
  "published" : "2024-04-01T21:30:46Z",
  "aliases" : [ "CVE-2024-3135" ],
  "summary" : "LocalAI cross-site request forgery vulnerability",
  "details" : "A Cross-Site Request Forgery (CSRF) vulnerability exists in the mudler/localai application, allowing attackers to craft malicious webpages that, when visited by a victim, perform unauthorized actions on the victim's local LocalAI instance without their consent. This vulnerability enables attackers to exhaust system resources, consume credits, and fill disk space by making numerous resource-intensive API calls, such as generating images or uploading files. The vulnerability stems from the application's acceptance of simple request content-types without requiring CSRF tokens or implementing other CSRF mitigation measures. Successful exploitation does not require network access to the vulnerable LocalAI environment.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/go-skynet/LocalAI"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-3135"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mudler/LocalAI"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/7afdc4d3-4b68-45ea-96d0-cf9ed3712ae8"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-352" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-02T14:01:01Z",
    "nvd_published_at" : "2024-04-01T19:15:46Z"
  }
}