Security-sensitive data and sinks must be hardened before use. Concretely:
1) Auth/token validity guarantees
getAuth) so all call sites benefit, using a refresh threshold that matches real provider behavior (e.g., provider-specific skew rather than a one-size-fits-all 30 minutes).2) Sanitize strings embedded into terminal escape sequences
\x00-\x1f and \x7f).3) Use secure, permissioned temp locations
0700).tmpdir() unless you can enforce the same security model.Example (sanitizing OSC 8 link URLs):
function stripControlChars(s: string): string {
return s.replace(/[\x00-\x1f\x7f]/g, "");
}
const href = stripControlChars(token.href ?? "");
const osc8Open = `\x1b]8;;${href}\x07`;
const osc8Close = `\x1b]8;;\x07`;
Enter the URL of a public GitHub repository