CVE-2024-5182: Github.com/go skynet/LocalAI Path Traversal Vulnerability
HIGHCVE-2024-5182 is a HIGH (CVSS 7.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/go skynet/LocalAI libraries in the Go ecosystem. The issue involves localai path traversal vulnerability. Remediation is available by upgrading affected packages to version 2.16.0.
CVE-2024-5182 at a Glance
Security Impact
CVSS: 7.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:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2024-5182
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.
Upgrade github.com/go-skynet/LocalAI to 2.16.0
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-5182, 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 2.16.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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. 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
CVE-2024-5182 Affected Github.com/go skynet/LocalAI Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/go-skynet/LocalAI
|
Go |
< 2.16.0
|
2.16.0
|
References
Frequently Asked Questions
What is CVE-2024-5182?
Which Github.com/go skynet/LocalAI versions are affected?
What version fixes CVE-2024-5182?
Is github.com/go-skynet/LocalAI affected?
What is the CVSS score of CVE-2024-5182?
What CWE is associated with CVE-2024-5182?
How can I check Go dependencies for CVE-2024-5182?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cpcx-r2gq-x893",
"modified" : "2024-07-08T21:18:17Z",
"published" : "2024-06-20T00:30:46Z",
"aliases" : [ "CVE-2024-5182" ],
"summary" : "LocalAI path traversal vulnerability",
"details" : "A path traversal vulnerability exists in mudler/localai version 2.14.0, where an attacker can exploit the `model` parameter during the model deletion process to delete arbitrary files. Specifically, by crafting a request with a manipulated `model` parameter, an attacker can traverse the directory structure and target files outside of the intended directory, leading to the deletion of sensitive data. This vulnerability is due to insufficient input validation and sanitization of the `model` parameter.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/go-skynet/LocalAI"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.16.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-5182"
}, {
"type" : "WEB",
"url" : "https://github.com/mudler/localai/commit/1a3dedece06cab1acc3332055d285ac540a47f0e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mudler/LocalAI"
}, {
"type" : "WEB",
"url" : "https://huntr.com/bounties/f7a87f29-c22a-48e8-9fce-b6d5a273e545"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-06-20T16:12:32Z",
"nvd_published_at" : "2024-06-20T00:15:09Z"
}
}