We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c93346 commit 9516dadCopy full SHA for 9516dad
apps/sim/lib/core/security/input-validation.server.ts
@@ -81,7 +81,14 @@ export async function validateUrlWithDNS(
81
try {
82
const { address } = await dns.lookup(cleanHostname, { verbatim: true })
83
84
- if (isPrivateOrReservedIP(address) && !isLocalhost) {
+ const resolvedIsLoopback =
85
+ ipaddr.isValid(address) &&
86
+ (() => {
87
+ const ip = ipaddr.process(address).toString()
88
+ return ip === '127.0.0.1' || ip === '::1'
89
+ })()
90
+
91
+ if (isPrivateOrReservedIP(address) && !(isLocalhost && resolvedIsLoopback)) {
92
logger.warn('URL resolves to blocked IP address', {
93
paramName,
94
hostname,
0 commit comments