Skip to content

[wrangler] Add hostname and IP validation for VPC services#12700

Open
RiscadoA wants to merge 1 commit intocloudflare:mainfrom
RiscadoA:rantunes/vpc-hostname-validation
Open

[wrangler] Add hostname and IP validation for VPC services#12700
RiscadoA wants to merge 1 commit intocloudflare:mainfrom
RiscadoA:rantunes/vpc-hostname-validation

Conversation

@RiscadoA
Copy link

@RiscadoA RiscadoA commented Feb 27, 2026

Fixes N/A (internal tracking).

Add RFC 1123 hostname validation to wrangler vpc service create/update. Previously any string was accepted as --hostname with no client-side checks.

Also validates that the configured ipv4/ipv6 addresses are valid ip addresses using net.

Changes

  • validateHostname() in validation.ts: rejects URL schemes, paths, ports, bare IPs (v4/v6), invalid characters, empty/long labels, leading/trailing hyphens, total length >253
  • Wired into validateRequest() — throws UserError with clear messages
  • 15 new tests in vpc.test.ts (13 unit + 2 CLI integration)

  • Tests
    • Tests included/updated
  • Public documentation
    • Documentation not necessary because: validation-only change, no new flags or behavior to document

Open with Devin

@changeset-bot
Copy link

changeset-bot bot commented Feb 27, 2026

🦋 Changeset detected

Latest commit: 49f4ee3

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@RiscadoA RiscadoA force-pushed the rantunes/vpc-hostname-validation branch 5 times, most recently from 90745d1 to bff4947 Compare March 2, 2026 11:45
@RiscadoA RiscadoA marked this pull request as ready for review March 2, 2026 11:48
@RiscadoA RiscadoA requested a review from a team as a code owner March 2, 2026 11:48
@RiscadoA RiscadoA changed the title [wrangler] Add hostname validation for VPC services [wrangler] Add hostname and IP validation for VPC services Mar 2, 2026
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 2, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12700

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12700

miniflare

npm i https://pkg.pr.new/miniflare@12700

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12700

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12700

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12700

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12700

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12700

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12700

wrangler

npm i https://pkg.pr.new/wrangler@12700

commit: 0634685

@RiscadoA RiscadoA force-pushed the rantunes/vpc-hostname-validation branch from bff4947 to d0372c2 Compare March 2, 2026 15:33
devin-ai-integration[bot]

This comment was marked as resolved.

@RiscadoA RiscadoA force-pushed the rantunes/vpc-hostname-validation branch from d0372c2 to c3ef35a Compare March 2, 2026 17:51
@RiscadoA RiscadoA requested a review from emily-shen March 2, 2026 17:51
@workers-devprod
Copy link
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • packages/wrangler/src/tests/vpc.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/vpc/validation.ts: [@cloudflare/wrangler]

devin-ai-integration[bot]

This comment was marked as resolved.

@RiscadoA RiscadoA force-pushed the rantunes/vpc-hostname-validation branch 2 times, most recently from 50f94a8 to 84f865f Compare March 3, 2026 09:11
@workers-devprod
Copy link
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • packages/wrangler/src/tests/vpc.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/vpc/validation.ts: [@cloudflare/wrangler]

@RiscadoA RiscadoA force-pushed the rantunes/vpc-hostname-validation branch from 36c50eb to 49f4ee3 Compare March 9, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants