mirror of
https://github.com/storytold/craft-launcher.git
synced 2026-11-16 15:14:56 +00:00
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:
1 file changed
+3
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user