Skip to content

CIDR notation in NO_PROXY is not evaluated #31954

@abx-its-e2emon

Description

@abx-its-e2emon

Describe the bug
I am forced to use a company proxy for extranet connections, but not for intranet connections.
HC vault CLI disrespects CIDR subnet notation in NO_PROXY and tries to use the proxy to connect to an internal Vault instance running at vault.mycompany.tld. At least under Windows in PowerShell.

To Reproduce
Steps to reproduce the behavior:

  1. In PowerShell 7.6 set the environment variables $env:VAULT_ADDR="https://vault.mycompany.tld/", $env:HTTP_PROXY, $env:HTTPS_PROXY and $env:NO_PROXY. Set $env:NO_PROXY="localhost,127.0.0.1,10.66.0.0/16"
  2. Run either vault status or vault login
  3. See error HTML from Proxy

Expected behavior
I would expect the HC Vault CLI's HTTP framework to:

  • go through comma-separated NO_PROXY entries
  • if the entry contains a subnet in CIDR notation expand the "10.66.0.0/16" to an address range
  • do the nslookup of vault.mycompany.tld
  • match the returned IP of 10.66.0.88
  • realize that it is on the subnet of 10.66.0.0/16
  • do NOT use a proxy when connecting to vault.mycompany.tld

Environment:

  • Vault Server Version: 1.17.2
  • Vault CLI Version: Vault v2.0.0 (cf1ce4d), built 2026-04-13T18:49:01Z, installed using WinGet
  • Server Operating System/Architecture: Windows AMD64 PowerShell 7.6.1

Additional context
Setting $env:NO_PROXY="localhost,127.0.0.1,10.66.0.0/16,.mycompany.tld" including the domain works just fine with Vault CLI. Then it matches and does not use the proxy.

Seems like the HTTP framework within HC Vault CLI is not calculating CIDR subnets and matching them to the IP returned by the hostname lookup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUsed to indicate a potential bugcore/cli

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions