projectdiscovery/nuclei · error

both follow redirects and disable redirects specified

Error message

both follow redirects and disable redirects specified

What it means

interfaceAddress walks the named interface's addresses and keeps the first non-loopback IPv4; if none exists (IPv6-only, loopback-only, or unassigned interface) dialer setup fails with this error. The -interface code path requires a concrete IPv4 bind address.

Source

Thrown at internal/runner/options.go:167

		errs := []string{}
		for _, err := range err.(validator.ValidationErrors) {
			errs = append(errs, err.Namespace()+": "+err.Tag())
		}
		return errors.Wrap(errors.New(strings.Join(errs, ", ")), "validation failed for these fields")
	}
	if options.Verbose && options.Silent {
		return errors.New("both verbose and silent mode specified")
	}

	if (options.HeadlessOptionalArguments != nil || options.ShowBrowser || options.UseInstalledChrome) && !options.Headless {
		return errors.New("headless mode (-headless) is required if -ho, -sb, -sc or -lha are set")
	}

	if options.FollowHostRedirects && options.FollowRedirects {
		return errors.New("both follow host redirects and follow redirects specified")
	}
	if options.ShouldFollowHTTPRedirects() && options.DisableRedirects {
		return errors.New("both follow redirects and disable redirects specified")
	}
	// loading the proxy server list from file or cli and test the connectivity
	if err := loadProxyServers(options); err != nil {
		return err
	}
	if options.Validate {
		validateTemplatePaths(options.Logger, config.DefaultConfig.TemplatesDirectory, options.Templates, options.Workflows)
	}
	if options.DAST {
		if err := validateDASTOptions(options); err != nil {
			return err
		}
	}

	// Verify if any of the client certificate options were set since it requires all three to work properly
	if options.HasClientCertificates() {
		if generic.EqualsAny("", options.ClientCertFile, options.ClientKeyFile, options.ClientCAFile) {
			return errors.New("if a client certification option is provided, then all three must be provided")

View on GitHub (pinned to 265b3a3dec)

Solutions

  1. Assign an IPv4 address to the interface or select a different one
  2. Use -source-ip with an IPv4 the host owns instead of -interface
  3. Bring the interface up or renew its lease and retry

Example fix

# before
nuclei -interface tun6   # IPv6-only interface
# after
nuclei -interface eth0
Defensive patterns

Strategy: validation

Validate before calling

import "net"

func hasBindableIPv4(iface string) bool {
    i, err := net.InterfaceByName(iface)
    if err != nil {
        return false
    }
    addrs, _ := i.Addrs()
    for _, a := range addrs {
        if ipnet, ok := a.(*net.IPNet); ok && !ipnet.IP.IsLoopback() && ipnet.IP.To4() != nil {
            return true
        }
    }
    return false
}

Prevention

When it happens

Trigger: nuclei -interface <iface> where iface is an IPv6-only tunnel, an unaddressed bridge, or a dummy loopback interface.

Common situations: Freshly created VPN or bridge interfaces without IPv4; IPv6-only links; interface not yet up or lacking a DHCP lease.

Related errors


AI-assisted analysis of projectdiscovery/nuclei@265b3a3dec (2026-08-15). Data as JSON: /api/errors/78c74438ad47b055. Report an issue: GitHub.