Do not pass the launcher's GitHub token to child processes

Every program the launcher starts inherited its environment, including
ARTCRAFT_LAUNCHER_GITHUB_TOKEN. Installed apps, including approved community
apps, could read the launcher's own API credential. Command construction now
removes it, so apps and helpers never receive it.
This commit is contained in:
Dylan M. Taylor committed 2026-11-14 14:20:25 -05:00
1 parent ba56c4587f
commit 3180dd6c7c
1 file changed
+3
+3
View File
@@ -11,6 +11,9 @@ use std::time::{Duration, Instant};
pub fn command(program: impl AsRef<std::ffi::OsStr>) -> Command {
#[allow(unused_mut)]
let mut cmd = Command::new(program);
// The launcher's GitHub token is its own credential. Installed apps, including approved
// community apps, have no business with it (audit: launcher #2).
cmd.env_remove("ARTCRAFT_LAUNCHER_GITHUB_TOKEN");
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;