Skip to content

Commit 7f95266

Browse files
committed
fix(security): forward allowHttp option through redirect validation
Pass allowHttp to validateUrlWithDNS in the redirect handler of secureFetchWithPinnedIP so HTTP-to-HTTP redirects work when allowHttp is enabled for webhook delivery.
1 parent b2cf0bc commit 7f95266

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/sim/lib/core/security/input-validation.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ function resolveRedirectUrl(baseUrl: string, location: string): string {
248248
export async function secureFetchWithPinnedIP(
249249
url: string,
250250
resolvedIP: string,
251-
options: SecureFetchOptions = {},
251+
options: SecureFetchOptions & { allowHttp?: boolean } = {},
252252
redirectCount = 0
253253
): Promise<SecureFetchResponse> {
254254
const maxRedirects = options.maxRedirects ?? DEFAULT_MAX_REDIRECTS
@@ -296,7 +296,7 @@ export async function secureFetchWithPinnedIP(
296296
res.resume()
297297
const redirectUrl = resolveRedirectUrl(url, location)
298298

299-
validateUrlWithDNS(redirectUrl, 'redirectUrl')
299+
validateUrlWithDNS(redirectUrl, 'redirectUrl', { allowHttp: options.allowHttp })
300300
.then((validation) => {
301301
if (!validation.isValid) {
302302
reject(new Error(`Redirect blocked: ${validation.error}`))

0 commit comments

Comments
 (0)