forked from hans/Nominatim
Replaces eval with json.loads for safer dict parsing
Switches from eval to json.loads when parsing string representations of dictionaries to prevent arbitrary code execution.
This commit is contained in:
@@ -58,7 +58,7 @@ COMPARISON_FUNCS = {
|
||||
None: lambda val, exp: str(val) == exp,
|
||||
'i': lambda val, exp: str(val).lower() == exp.lower(),
|
||||
'fm': lambda val, exp: re.fullmatch(exp, val) is not None,
|
||||
'dict': lambda val, exp: val is None if exp == '-' else (val == eval('{' + exp + '}')),
|
||||
'dict': lambda val, exp: val is None if exp == '-' else (val == json.loads('{' + exp + '}')),
|
||||
'in_box': within_box
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user