Skip to content

Refuse an unroutable hostname at the API door too - #149

Merged
Shine-neko merged 1 commit into
mainfrom
fix/api-accepts-any-hostname
Aug 23, 2026
Merged

Refuse an unroutable hostname at the API door too#149
Shine-neko merged 1 commit into
mainfrom
fix/api-accepts-any-hostname

Conversation

@Shine-neko

Copy link
Copy Markdown
Contributor

#145 refused a hostname Sozu would read as a pattern — one containing / becomes a regex, a bare * matches every host — on two doors: the label parser and the HTTP provider. The API was left open, so a single POST or PUT could still install a rule at RulePosition::Pre in front of every legitimate route.

Both handlers now apply the same gate and answer 400, naming the offending value. A leading *. stays accepted; that is a wildcard Sozu handles natively.

Found by an adversarial review of #140-#145, which noted the gate was not a system-wide invariant: it held for labels and the HTTP provider only.

@Shine-neko
Shine-neko merged commit 8696a44 into main Aug 23, 2026
3 checks passed
@Shine-neko
Shine-neko deleted the fix/api-accepts-any-hostname branch August 23, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant