Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JIT][Security] Do not blindly eval input string (#89189) #89925

Merged
merged 1 commit into from Nov 30, 2022

Conversation

atalman
Copy link
Contributor

@atalman atalman commented Nov 30, 2022

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 #88868

Pull Request resolved: #89189
Approved by: https://github.com/suo

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 pytorch#88868

Pull Request resolved: pytorch#89189
Approved by: https://github.com/suo
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 30, 2022

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/89925

Note: Links to docs will display an error until the docs builds have been completed.

❌ 3 Failures, 2 Pending

As of commit 78cad99:

The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the release notes: jit release notes category label Nov 30, 2022
@malfet malfet merged commit 74a9ca9 into pytorch:release/1.13 Nov 30, 2022
@weiwangmeta
Copy link
Contributor

For the above 3 failures, 1168f42 can close the xla one.
We are working on the functorch and default one (win-vs2019-cpu-py3). Almost all other cherry-pick commits also failed these.

atalman added a commit to atalman/pytorch that referenced this pull request Nov 30, 2022
@atalman atalman deleted the cherry_pick_security branch December 6, 2022 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: jit release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants