Advisory

GHSA-vx24-x4mv-vwr5

Also known as: CVE-2024-41815, RUSTSEC-2024-0446

Summary

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

Details

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.

Severity

High Basis: The source's own band: HIGH

Dates

Published
2024-07-26 21:24 UTC
Modified
2025-12-22 16:44 UTC

Affected packages and fixes

starship

crates.io · All systems

Affected

  • introduced 1.0.0, fixed 1.20.0 (semver)

Fixed versions

1.20.0

Fix

  • Fixed version 1.20.0
    cargo update -p starship --precise 1.20.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences