We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2b9a1ae commit c545513Copy full SHA for c545513
packages/components/nodes/chains/ApiChain/postCore.ts
@@ -92,6 +92,21 @@ export class APIChain extends BaseChain implements APIChainInput {
92
93
const { url, data } = JSON.parse(api_url_body)
94
95
+ // Validate request is not to internal/private networks
96
+ const urlObj = new URL(url)
97
+ const hostname = urlObj.hostname
98
+
99
+ if (
100
+ hostname === 'localhost' ||
101
+ hostname === '127.0.0.1' ||
102
+ hostname.startsWith('192.168.') ||
103
+ hostname.startsWith('10.') ||
104
+ hostname.startsWith('172.16.') ||
105
+ hostname.includes('internal')
106
+ ) {
107
+ throw new Error('Access to internal networks is not allowed')
108
+ }
109
110
const res = await fetch(url, {
111
method: 'POST',
112
headers: this.headers,
0 commit comments