CVE-2024-41815: Starship Starship Vulnerable To Shell Injection Vulnerability
HIGHCVE-2024-41815 is a HIGH (CVSS 7.4) starship vulnerable to shell injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Starship libraries in the crates.io ecosystem. The issue involves starship vulnerable to shell injection via undocumented, unpredictable shell expansion in custom commands. Remediation is available by upgrading affected packages to version 1.20.0.
CVE-2024-41815 at a Glance
Security Impact
CVSS: 7.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2024-41815
To remediate this vulnerability, upgrade all affected Starship 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 starship to 1.20.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for starship
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-41815, inspect your project dependencies for Starship:
inspect dependencies for starship
Analyze the terminal output to locate any version of Starship in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.20.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-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 Starship, 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-41815 Affected Starship Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
starship
|
crates.io |
≥ 1.0.0
< 1.20.0
|
1.20.0
|
References
Frequently Asked Questions
What is CVE-2024-41815?
Which Starship versions are affected?
What version fixes CVE-2024-41815?
Is starship affected?
What is the CVSS score of CVE-2024-41815?
What CWE is associated with CVE-2024-41815?
How can I check crates.io dependencies for CVE-2024-41815?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vx24-x4mv-vwr5",
"modified" : "2025-12-22T16:31:41Z",
"published" : "2024-07-26T21:24:18Z",
"aliases" : [ "CVE-2024-41815" ],
"summary" : "Starship vulnerable to shell injection via undocumented, unpredictable shell expansion in custom commands",
"details" : "## Description \nStarship is a cross-shell prompt. Starting in version 1.0.0 and prior to version 1.20.0, undocumented and unpredictable shell expansion and/or quoting rules make it easily to accidentally cause shell injection when using custom commands with starship in bash. Version 1.20.0 fixes the vulnerability.\n\n### PoC\nHave some custom command which prints out information from a potentially untrusted/unverified source.\n```\n[custom.git_commit_name]\ncommand = 'git show -s --format=\"%<(25,mtrunc)%s\"'\nstyle = \"italic\"\nwhen = true\n```\n\n### Impact\nThis issue only affects users with custom commands, so the scope is limited, and without knowledge of others' commands, it could be hard to successfully target someone.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "starship"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.20.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.19.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/starship/starship/security/advisories/GHSA-vx24-x4mv-vwr5"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-41815"
}, {
"type" : "WEB",
"url" : "https://github.com/starship/starship/commit/cfc58161e0ec595db90af686ad77a73df6d44d74"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/starship/starship"
}, {
"type" : "WEB",
"url" : "https://github.com/starship/starship/releases/tag/v1.20.0"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2024-0446.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-77", "CWE-78" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-07-26T21:24:18Z",
"nvd_published_at" : "2024-07-26T21:15:14Z"
}
}