zhang-arvin opened a new pull request, #7024:
URL: https://github.com/apache/shenyu/pull/7024

   Fixes #7020
   
   ## What changes were proposed in this pull request?
   
   AiProxy's `extractPrompt` method forwards the entire request body to the 
upstream AI provider when no `prompt` or `content` field is found at the top 
level. This includes the internal `fallbackConfig` field with credentials 
(provider, apiKey, etc.), leaking sensitive configuration to the upstream.
   
   ## Changes
   
   - Modified `AiProxyConfigService.extractPrompt()` to strip the 
`fallbackConfig` field from the JSON body before forwarding to upstream
   - Updated test `testExtractPromptWithFallbackConfigButNoPromptOrContent` to 
verify the fix
   
   ## How was this patch tested?
   
   - Unit tests: `AiProxyConfigServiceTest` (19/19 pass)
   - Verified that `fallbackConfig` is removed from the forwarded body when 
present alongside `messages`/other fields


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to