mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-10 20:39:59 +00:00
fix(security): remove space from token validation charset in key-request.sh (#2074)
API tokens never contain spaces; allowing them risks word splitting in downstream unquoted uses of these env vars. Updated both the shell regex in key-request.sh and the corresponding TypeScript regexes in digitalocean.ts to stay in sync. Fixes #2072 Agent: code-health Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
bb4deaf24c
commit
69d1971abf
2 changed files with 4 additions and 5 deletions
|
|
@ -202,7 +202,7 @@ function loadTokenFromConfig(): string | null {
|
|||
if (!token) {
|
||||
return null;
|
||||
}
|
||||
if (!/^[a-zA-Z0-9._/@:+=, -]+$/.test(token)) {
|
||||
if (!/^[a-zA-Z0-9._/@:+=-]+$/.test(token)) {
|
||||
return null;
|
||||
}
|
||||
return token;
|
||||
|
|
@ -217,7 +217,7 @@ function loadRefreshToken(): string | null {
|
|||
if (!refreshToken) {
|
||||
return null;
|
||||
}
|
||||
if (!/^[a-zA-Z0-9._/@:+=, -]+$/.test(refreshToken)) {
|
||||
if (!/^[a-zA-Z0-9._/@:+=-]+$/.test(refreshToken)) {
|
||||
return null;
|
||||
}
|
||||
return refreshToken;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue