CVE-2024-41815:
Starship vulnerable to shell injection via undocumented, unpredictable shell expansion in custom commands
7.4
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.2808%
CWE
Published
7/26/2024
Updated
9/19/2024
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
starship | rust | >= 1.0.0, <= 1.19.0 | 1.20.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from how custom command output was handled in the StringFormatter. The pre-patch code in src/modules/custom.rs used map_no_escaping for the 'output' variable, which disabled escaping of special characters. This is shown in the commit diff where output handling was moved to a variables_closure and made conditional on the new unsafe_no_escape flag. The addition of escaping by default (using .map() instead of .map_no_escaping()) in the patched version directly addresses the command injection vulnerability. The test cases added in the commit (output_is_escaped and unsafe_no_escape) further confirm this was the vulnerable code path.