Heads up: max_program_size deprecation will require re2j changes to allow validation
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
The issue points to re2j's Pattern and Prog.inst, while noting that this repository may not explicitly manage GoogleRE2. First check whether java-control-plane has a validation entry point for regex program size; done would require confirming whether implementation is needed and scoping any relevant re2j change.
Written by the indexing model from the issue text.
Description
This is just documenting the information that may be necessary if java-control-plane wants to start validating regular expression max_program_sizes. This is unnecessary if the regular expressions are considered "trusted" (known to be non-malicious).
I had this information and wanted to dump it somewhere that it may be useful if the need arises. It seems there is no explicit management of GoogleRE2 in this repo. Feel free to close.
In https://github.com/envoyproxy/envoy/pull/10971, Envoy deprecated the max_program_size configuration field in favor of the control plane being responsible. This is great, and works for C++ and Go languages, but leaves some TODOs for Java.
The C++ re2 exposes RE2::ProgramSize() which reports the number of instructions of the compiled regular expression. This is the "program size" that Envoy was referring to.
Go's regexp/syntax package allows getting something similar:
regex, err := syntax.Parse("INPUT HERE", 0)
prog, err := syntax.Compile(regex)
len(prog.Inst) // this is the program size
But it does not appear re2j supports such a feature. Basically, you will need a new Pattern method that returns the length of Prog.inst (via re2.prog).
- Dominant language
- Java
- Stars
- 312
- Forks
- 150
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from envoyproxy/java-control-plane
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
envoyproxy/java-control-plane#481 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
envoyproxy/java-control-plane#471 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
envoyproxy/java-control-plane#463 ·
-
help Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
envoyproxy/java-control-plane#432 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
envoyproxy/java-control-plane#411 ·
All issues in envoyproxy/java-control-plane
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100