Skip to content

Commit 0c226b9

Browse files
authored
fix(providers): allow HTTP for self-hosted vLLM endpoints (#5078)
Pass allowHttp to validateUrlWithDNS so plain-HTTP self-hosted vLLM endpoints are permitted. This only relaxes the protocol check; the private/reserved-IP blocklist and blocked-port checks still apply, so SSRF protection is unchanged.
1 parent cbd3d22 commit 0c226b9

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

apps/sim/providers/vllm/index.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ describe('vllmProvider', () => {
155155

156156
expect(mockValidateUrlWithDNS).toHaveBeenCalledWith(
157157
'https://my-vllm.example.com',
158-
'vLLM endpoint'
158+
'vLLM endpoint',
159+
{ allowHttp: true }
159160
)
160161
expect(mockCreatePinnedFetch).toHaveBeenCalledWith('203.0.113.10')
161162
expect(openAIArgs[0].baseURL).toBe('https://my-vllm.example.com/v1')

apps/sim/providers/vllm/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,16 @@ export const vllmProvider: ProviderConfig = {
108108
* central SSRF guard and pin the connection to the resolved IP to defeat DNS
109109
* rebinding. The operator-configured `VLLM_BASE_URL` is trusted and left
110110
* unvalidated, mirroring the Azure providers.
111+
*
112+
* `allowHttp` is enabled because self-hosted vLLM is frequently served over
113+
* plain HTTP; this only relaxes the protocol requirement — the private/reserved
114+
* IP blocklist and blocked-port checks still apply, so SSRF protection is intact.
111115
*/
112116
let pinnedFetch: typeof fetch | undefined
113117
if (userProvidedEndpoint) {
114-
const validation = await validateUrlWithDNS(userProvidedEndpoint, 'vLLM endpoint')
118+
const validation = await validateUrlWithDNS(userProvidedEndpoint, 'vLLM endpoint', {
119+
allowHttp: true,
120+
})
115121
if (!validation.isValid) {
116122
logger.warn('Blocked SSRF attempt via vLLM endpoint', {
117123
endpoint: userProvidedEndpoint,

0 commit comments

Comments
 (0)