Skip to content

core: restrict :named-rewrite name to known words - #2008

Merged
brharrington merged 1 commit into
Netflix:mainfrom
brharrington:named-rewrite-name
Oct 22, 2026
Merged

brharrington merged 1 commit into
Netflix:mainfrom
brharrington:named-rewrite-name

Conversation

@brharrington

Copy link
Copy Markdown
Contributor

The name of a named rewrite is rendered as :$name and the display expression is executed again when the expression is rewritten, for example when HostRewriter adds a restriction. Escaped commas in the name were a single token on the first parse, but became separate operations on the second, allowing arbitrary operations to be injected that could drop the added restriction. Require the name to be a word in the vocabulary.

The re-execution runs with unstable features enabled, so the name must also be a stable word unless the caller enabled unstable features. Otherwise the rewrite could bypass the feature gate.

The name of a named rewrite is rendered as `:$name` and the display
expression is executed again when the expression is rewritten, for
example when HostRewriter adds a restriction. Escaped commas in the
name were a single token on the first parse, but became separate
operations on the second, allowing arbitrary operations to be
injected that could drop the added restriction. Require the name to
be a word in the vocabulary.

The re-execution runs with unstable features enabled, so the name
must also be a stable word unless the caller enabled unstable
features. Otherwise the rewrite could bypass the feature gate.
@brharrington brharrington added this to the 1.9.0 milestone Oct 22, 2026
@brharrington
brharrington merged commit 3356cd1 into Netflix:main Oct 22, 2026
5 checks passed
@brharrington
brharrington deleted the named-rewrite-name branch October 22, 2026 16:44
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