Skip to content

Starship vulnerable to shell injection via undocumented, unpredictable shell expansion in custom commands

High severity GitHub Reviewed Published Jul 26, 2024 in starship/starship • Updated Sep 19, 2024

Package

cargo starship (Rust)

Affected versions

>= 1.0.0, <= 1.19.0

Patched versions

1.20.0

Description

Description

Starship 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.

PoC

Have some custom command which prints out information from a potentially untrusted/unverified source.

[custom.git_commit_name]
command = 'git show -s --format="%<(25,mtrunc)%s"'
style = "italic"
when = true

Impact

This 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.

References

@davidkna davidkna published to starship/starship Jul 26, 2024
Published by the National Vulnerability Database Jul 26, 2024
Published to the GitHub Advisory Database Jul 26, 2024
Reviewed Jul 26, 2024
Last updated Sep 19, 2024

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS score

0.046%
(17th percentile)

CVE ID

CVE-2024-41815

GHSA ID

GHSA-vx24-x4mv-vwr5

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.