CVE-2024-41956: Github.com/charmbracelet/soft serve Soft-serve Vulnerable To Arbitrary Code Vulnerability
HIGHCVE-2024-41956 is a HIGH (CVSS 8.1) soft-serve vulnerable to arbitrary code vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Github.com/charmbracelet/soft serve libraries in the Go ecosystem. The issue involves soft-serve vulnerable to arbitrary code execution by crafting git-lfs requests. Remediation is available by upgrading affected packages to version 0.7.5.
CVE-2024-41956 at a Glance
Security Impact
CVSS: 8.1
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:N).
How to Fix CVE-2024-41956
To remediate this vulnerability, upgrade all affected Github.com/charmbracelet/soft serve 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/charmbracelet/soft-serve to 0.7.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/charmbracelet/soft-serve
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-41956, inspect your project dependencies for Github.com/charmbracelet/soft serve:
inspect dependencies for github.com/charmbracelet/soft-serve
Analyze the terminal output to locate any version of Github.com/charmbracelet/soft serve in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.7.5), 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-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Github.com/charmbracelet/soft serve, 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-41956 Affected Github.com/charmbracelet/soft serve Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/charmbracelet/soft-serve
|
Go |
< 0.7.5
|
0.7.5
|
References
Frequently Asked Questions
What is CVE-2024-41956?
Which Github.com/charmbracelet/soft serve versions are affected?
What version fixes CVE-2024-41956?
Is github.com/charmbracelet/soft-serve affected?
What is the CVSS score of CVE-2024-41956?
What CWE is associated with CVE-2024-41956?
How can I check Go dependencies for CVE-2024-41956?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m445-w3xr-vp2f",
"modified" : "2024-08-07T19:26:34Z",
"published" : "2024-08-02T12:51:12Z",
"aliases" : [ "CVE-2024-41956" ],
"summary" : "soft-serve vulnerable to arbitrary code execution by crafting git-lfs requests",
"details" : "### Impact\nAny servers using soft-serve server and git\n\n### Patches\n>0.7.5\n\n### Workarounds\nNone.\n\n### References\nn/a.\n\n---\n\nIt is possible for a user who can commit files to a repository hosted by Soft Serve to execute arbitrary code via environment manipulation and Git.\n\nThe issue is that Soft Serve passes all environment variables given by the client to git subprocesses. This includes environment variables that control program execution, such as `LD_PRELOAD`.\n\nThis can be exploited to execute arbitrary code by, for example, uploading a malicious shared object file to Soft Serve via Git LFS (uploading it via LFS ensures that it is not compressed on disk and easier to work with). The file will be stored under its SHA256 hash, so it has a predictable name.\n\nThis file can then be referenced in `LD_PRELOAD` via a Soft Serve SSH session that causes git to be invoked. For example:\n\n```bash\nLD_PRELOAD=/.../data/lfs/1/objects/a2/b5/a2b585befededf5f95363d06d83655229e393b1b45f76d9f989a336668665a2f ssh server git-upload-pack repo\n```\n\nThe example LFS file patches a shared library function called by git to execute a shell.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/charmbracelet/soft-serve"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.7.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/charmbracelet/soft-serve/security/advisories/GHSA-m445-w3xr-vp2f"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-41956"
}, {
"type" : "WEB",
"url" : "https://github.com/charmbracelet/soft-serve/commit/4daebdd422a6ba8c04162d023f8be355a8fe3184"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/charmbracelet/soft-serve"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2024-3019"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-08-02T12:51:12Z",
"nvd_published_at" : "2024-08-01T22:15:29Z"
}
}