mirror of
https://github.com/google-gemini/gemini-cli
synced 2026-04-21 13:37:17 +00:00
fix(cli): stricter path validation to only permit safe characters
permitted characters: alphanumeric characters, hyphens, and underscores
This commit is contained in:
parent
9492422f28
commit
1ab411addd
1 changed files with 2 additions and 2 deletions
|
|
@ -255,8 +255,8 @@ export async function parseArguments(
|
|||
return 'The --session-id flag requires a non-empty value';
|
||||
}
|
||||
|
||||
if (trimmedSessionId === '.' || trimmedSessionId === '..') {
|
||||
return 'Invalid --session-id value. "." and ".." are not allowed.';
|
||||
if (!/^[a-zA-Z0-9_-]+$/.test(trimmedSessionId)) {
|
||||
return 'Invalid --session-id value. Only alphanumeric characters, hyphens, and underscores are allowed.';
|
||||
}
|
||||
argv['sessionId'] = trimmedSessionId;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue