fix: refuse dot segments in AI proxy paths (#11837)

* fix: refuse dot segments in AI proxy paths

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: refuse spaces, query and fragment markers in AI proxy paths

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: refuse percent signs in AI proxy paths

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-10-17 09:32:59 +02:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 09a59110d9
commit 89f36a73d1
2 changed files with 56 additions and 2 deletions
+4 -2
View File
@@ -37,8 +37,8 @@ use windmill_ai::providers::{
},
};
use windmill_ai::proxy::{
fim::maybe_transform_fim_request, proxy_execution_mode, ProxyBuildArgs, ProxyExecutionMode,
ProxyRequest,
fim::maybe_transform_fim_request, proxy_execution_mode, validate_proxy_path, ProxyBuildArgs,
ProxyExecutionMode, ProxyRequest,
};
use windmill_ai::retry::send_with_retries;
use windmill_audit::{audit_oss::audit_log, ActionKind};
@@ -1103,6 +1103,7 @@ async fn global_proxy(
headers: HeaderMap,
body: Bytes,
) -> impl IntoResponse {
validate_proxy_path(&ai_path)?;
let provider = headers
.get("X-Provider")
.map(|v| v.to_str().unwrap_or("").to_string());
@@ -1221,6 +1222,7 @@ async fn proxy(
headers: HeaderMap,
mut body: Bytes,
) -> impl IntoResponse {
validate_proxy_path(&ai_path)?;
let provider = headers
.get("X-Provider")
.map(|v| v.to_str().unwrap_or("").to_string());