66<overview >
77<p >
88Constructing a regular expression with unsanitized user input can be dangerous.
9- A malicious user may be able to modify the meaning of the expression causing it
10- to match unexpected strings and to construct large regular expressions by using
9+ A malicious user may be able to modify the meaning of the expression, causing it
10+ to match unexpected strings and construct large regular expressions by using
1111counted repetitions.
1212</p >
1313</overview >
@@ -22,13 +22,13 @@ escape meta-characters that have special meaning.
2222<p >
2323If purposefully supporting user supplied regular expressions, then use <a
2424href=" https://docs.rs/regex/latest/regex/struct.RegexBuilder.html#method.size_limit" >RegexBuilder::size_limit</a >
25- to limit the pattern size such that it is no larger than necessary.
25+ to limit the pattern size so that it is no larger than necessary.
2626</p >
2727</recommendation >
2828
2929<example >
3030<p >
31- The following example construct a regular expressions from the user input
31+ The following example constructs a regular expressions from the user input
3232<code >key</code > without escaping it first.
3333</p >
3434
@@ -41,16 +41,16 @@ malicious user might inject the regular expression <code>".*^|key"</code> and
4141unexpectedly cause strings such as <code >"key=secret"</code > to match.
4242</p >
4343<p >
44- If user input is used to construct a regular expression it should be escaped
45- first. This ensures that the user cannot insert characters that have special
44+ If user input is used to construct a regular expression, it should be escaped
45+ first. This ensures that the malicious users cannot insert characters that have special
4646meanings in regular expressions.
4747</p >
4848<sample src =" RegexInjectionGood.rs" />
4949</example >
5050
5151<references >
5252<li >
53- <code >regex</code > crate documentation: <a href =" https://docs.rs/regex/latest/regex/index.html#untrusted-patterns" >Untrusted patterns</a >
53+ <code >regex</code > crate documentation: <a href =" https://docs.rs/regex/latest/regex/index.html#untrusted-patterns" >Untrusted patterns</a >.
5454</li >
5555</references >
5656</qhelp >
0 commit comments