Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display TaintConfig Error locations when available (#739)
Summary: **Pre-submission checklist** - [x] I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running `pip install -r requirements-dev.txt && pre-commit install` - [x] `pre-commit run` Display TaintConfigurationError locations when available. The Ocaml binary now returns positions after Github PR: #734 (commit 59d2cf0). Parse and print when the location(s) are available. Pull Request resolved: #739 Test Plan: Invocation command in all of the below: `python3 -m pyre-check.client.pyre analyze --no-verify` - Run pyre check with the following `faulty` taint.config: (modify `documentation/pysa_tutorial/exercise1`) ```json { "sources": [ { "name": "CustomUserControlled", "comment": "use to annotate user input" } ], "sinks": [ { "name": "CodeExecution", "comment": "use to annotate execution of python code" } ], "features": [], "rules": [ { "name": "Possible RCE:", "code": 5001, "sources": [ "CustomUserControlled" ], "sinks": [ "CodeExecution" ], "message_format": "User specified data may reach a code execution sink" } { "name": "test-duplicate", "code": 5001, "sources": [ "CustomUserControlled" ], "sinks": [ "CodeExecution" ], "message_format": "duplicate" } ] } ``` - Before: <img width="1137" alt="Screenshot 2023-05-31 at 2 45 34 PM" src="https://github.com/facebook/pyre-check/assets/8947010/3b2e24c4-98ab-4927-9838-f91592b504e5"> - After: <img width="1137" alt="Screenshot 2023-05-31 at 2 36 49 PM" src="https://github.com/facebook/pyre-check/assets/8947010/43f6aaf1-5d0a-42ee-889c-e59f10e3beef"> - Run with the stock taint.config: (same results before and after) <img width="1137" alt="Screenshot 2023-05-31 at 2 48 33 PM" src="https://github.com/facebook/pyre-check/assets/8947010/58aae8d6-0eeb-4cc5-b676-31dcfcdbe826"> - `tox -e py` - Github Actions (pysa action was failing before this PR and is failing due to an unrelated issue - possibly outdated opam cache?) Fixes part of MLH-Fellowship#82 Signed-off-by: Abishek V Ashok <abishekvashok@gmail.com> Reviewed By: saputkin Differential Revision: D47589562 Pulled By: arthaud fbshipit-source-id: d17127a38096a1f95ade8648f14a853fd7ab0055
- Loading branch information