Skip to content

Commit dcd9cf9

Browse files
committed
Preventing stack overflow exceptions via limiting the depth of the parser rules - moving to 500 deep as a starting point
1 parent 8a1c884 commit dcd9cf9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/graphql/parser/ParserOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ public class ParserOptions {
3535
/**
3636
* A graphql hacking vector is to send nonsensical queries that have lots of grammar rule depth to them which
3737
* can cause stack overflow exceptions during the query parsing. To prevent this for most users, graphql-java
38-
* sets this value to 1000.
38+
* sets this value to 500 grammar rules deep.
3939
* <p>
4040
* If you want to allow more, then {@link #setDefaultParserOptions(ParserOptions)} allows you to change this
4141
* JVM wide.
4242
*/
43-
public static final int MAX_RULE_DEPTH = 1_000;
43+
public static final int MAX_RULE_DEPTH = 500;
4444

4545
private static ParserOptions defaultJvmParserOptions = newParserOptions()
4646
.captureIgnoredChars(false)

0 commit comments

Comments
 (0)