Skip to content

Commit 8ff6d97

Browse files
committed
heuristic: added corner case for map keys regex
1 parent 0d4eabd commit 8ff6d97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arjun/plugins/heuristic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
re_not_junk = re.compile(r'^[A-Za-z0-9_]+$')
66
def is_not_junk(param):
7-
return re_not_junk.match(param)
7+
return (re_not_junk.match(param) is not None)
88

99
# TODO: for map keys, javascript tolerates { param: "value" }
1010
re_input_names = re.compile(r'''(?i)<input.+?name=["']?([^"'\s>]+)''')
1111
re_input_ids = re.compile(r'''(?i)<input.+?id=["']?([^"'\s>]+)''')
1212
re_empty_vars = re.compile(r'''([^\s!=<>]+)\s*=\s*(?:['"`]{2}|true|false|null)''')
13-
re_map_keys = re.compile(r'''([^'"]+)['"]:\s?['"`]''')
13+
re_map_keys = re.compile(r'''([^'"]+)['"]\s*:\s*['"`]''')
1414
def heuristic(response, wordlist):
1515
potential_params = []
1616

0 commit comments

Comments
 (0)