Skip to content

deploy: host validator under-counts adjacent colons — unbracketed IPv6-ish hosts like '::1:22' pass validation #3086

Description

@bpamiri

Summary

Validator.$validateHost counts colons with arrayLen(listToArray(arguments.host, ":", false, true)) - 1 (cli/lucli/services/deploy/config/Validator.cfc:72). includeEmptyFields=false collapses adjacent/leading delimiters, so ::1:22 tokenizes to ['1','22'] → colonCount 1 → accepted, even though the source comment and config-reference.mdx both promise "multiple colons without brackets are rejected" (and document ::1:22 as the canonical reject case).

Repro (wheels 4.0.3 and develop)

servers: ["h:1:2"]    → DeployConfigError: invalid host: 'h:1:2'   ✓
servers: ["::1:22"]   → accepted, wheels deploy config succeeds    ✗ (3 colons, unbracketed)

Impact

The ambiguous host string flows into SshPool host parsing and remote command dispatch with whatever interpretation the splitter picks — exactly the ambiguity the check exists to reject. Validation-bypass shape adjacent to the #2956 name-validation work but a distinct root cause.

Proposed direction

Count colons directly (e.g. len(host) - len(replace(host, ":", "", "all"))) or pass includeEmptyFields=true. Extend ValidatorSpec with ::1:22, :a:b, a::b cases.

Acceptance

  • Unbracketed multi-colon hosts are rejected with the documented invalid-host error; bracketed [::1]:22 still accepted; spec cases above pass.

Reported by the guide-behavioral-audit P1 batch 2 (work item p1-16-deploy, claim cfg-03; wheels CLI 4.0.3 + develop source).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions