pytorch/torch/csrc/jit/frontend
Nikita Shulga 767f6aa49f [JIT][Security] Do not blindly eval input string (#89189)
Introduce `_eval_no_call` method, that evaluates statement only if it
does not contain any calls(done by examining the bytecode), thus preventing command injection exploit

Added simple unit test to check for that
`torch.jit.annotations.get_signature` would not result in calling random
code.

Although, this code path exists for Python-2 compatibility, and perhaps
should be simply removed.

Fixes https://github.com/pytorch/pytorch/issues/88868

Pull Request resolved: https://github.com/pytorch/pytorch/pull/89189
Approved by: https://github.com/suo
2022-11-17 22:05:30 +00:00
..
builtin_functions.cpp
builtin_functions.h
canonicalize_modified_loop.cpp
canonicalize_modified_loop.h
concrete_module_type.cpp
concrete_module_type.h
convert_to_ssa.cpp
convert_to_ssa.h
edit_distance.cpp
edit_distance.h
error_report.cpp
error_report.h
exit_transforms.cpp
exit_transforms.h
function_schema_parser.cpp [frontend] Fix tensor list alias annotation (#84005) 2022-08-24 19:50:19 +00:00
function_schema_parser.h
inline_loop_condition.cpp
inline_loop_condition.h
ir_emitter.cpp Fix typos in messages under torch (#88961) 2022-11-14 19:06:41 +00:00
ir_emitter.h
lexer.cpp
lexer.h
mini_environment.h
name_mangler.cpp
name_mangler.h
parse_string_literal.h
parser_constants.h
parser.cpp
parser.h
resolver.h
schema_matching.cpp Enable max.unary_out (#86855) 2022-10-13 17:14:53 +00:00
schema_matching.h Enable max.unary_out (#86855) 2022-10-13 17:14:53 +00:00
schema_type_parser.cpp Back out "Revert D38984222: Don't introduce new overload for SymInt (#83628)" (#84173) 2022-08-29 18:01:07 +00:00
schema_type_parser.h
script_type_parser.cpp [JIT][Security] Do not blindly eval input string (#89189) 2022-11-17 22:05:30 +00:00
script_type_parser.h
source_range.cpp Add assertions to fix torch::jit::load bugs (#79192) 2022-08-11 18:03:00 +00:00
source_range.h
source_ref.h
strtod.cpp
strtod.h
sugared_value.cpp
sugared_value.h
tracer.cpp Enable convolution_backward with bias and symints (#85970) 2022-09-30 21:21:11 +00:00
tracer.h Enable convolution_backward with bias and symints (#85970) 2022-09-30 21:21:11 +00:00
tree_views.cpp
tree_views.h
tree.h
versioned_symbols.cpp
versioned_symbols.h