Skip to content

fix(cmd): --url help still said it was optional - #767

Merged
lakhansamani merged 1 commit into
mainfrom
fix/url-flag-help-stale
Aug 14, 2026
Merged

fix(cmd): --url help still said it was optional#767
lakhansamani merged 1 commit into
mainfrom
fix/url-flag-help-stale

Conversation

@lakhansamani

Copy link
Copy Markdown
Contributor

What

One-line fix to the --url flag description.

Was: "Leaving it empty keeps legacy header-based derivation but exposes host-header-injection account takeover (CWE-640) — set this in production"

Is: "REQUIRED: the server refuses to start without it, because deriving its own host from request headers exposes host-header-injection account takeover (CWE-640). This is not --allowed-origins: --url is this server's own address, --allowed-origins is the apps it may redirect to"

Why

#764 made --url mandatory via validateAuthorizerURL, but left the flag's own help text describing the pre-#764 behaviour. authorizer --help therefore documents a configuration the binary rejects at startup — telling operators that omitting it is a supported (if unwise) choice, when it is now a hard failure.

The added --allowed-origins contrast is the same disambiguation the startup error already carries; it belongs in --help too, since confusing the two is the common misconfiguration.

Verification

go build ./... && go vet ./cmd/ # clean
go test ./cmd/ -run 'TestValidateAuthorizerURLRequiresAUsableValue|TestTrustedURLBeatsEveryHeader|TestHeaderDerivationStillWorksWhenUnset'
ok github.com/authorizerdev/authorizer/cmd

Text-only change to a flag description; no behaviour change.

Related

Refs #764

The flag description told operators they could leave --url empty and
keep "legacy header-based derivation". #764 removed that option — the
server refuses to start without it — so `--help` documented a
configuration the binary rejects.
Also names the distinction operators actually get wrong: --url is this
server's own address, --allowed-origins is the apps it may redirect to.
Sign up for freeto 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

@lakhansamani