{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/3436","repository_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy","labels_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/3436/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/3436/comments","events_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/3436/events","html_url":"https://github.com/rust-lang-nursery/rust-clippy/issues/3436","id":382842922,"node_id":"MDU6SXNzdWUzODI4NDI5MjI=","number":3436,"title":"Rule Request: UnnecessaryShellCommand","user":{"login":"mcandre","id":5316,"node_id":"MDQ6VXNlcjUzMTY=","avatar_url":"https://avatars1.githubusercontent.com/u/5316?v=4","gravatar_id":"","url":"https://api.github.com/users/mcandre","html_url":"https://github.com/mcandre","followers_url":"https://api.github.com/users/mcandre/followers","following_url":"https://api.github.com/users/mcandre/following{/other_user}","gists_url":"https://api.github.com/users/mcandre/gists{/gist_id}","starred_url":"https://api.github.com/users/mcandre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcandre/subscriptions","organizations_url":"https://api.github.com/users/mcandre/orgs","repos_url":"https://api.github.com/users/mcandre/repos","events_url":"https://api.github.com/users/mcandre/events{/privacy}","received_events_url":"https://api.github.com/users/mcandre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-20T20:50:07Z","updated_at":"2018-11-20T20:50:07Z","closed_at":null,"author_association":"NONE","body":"As an engineer, I want to be warned early when my application code is trying to shell out for things that libraries already provide, such as:\r\n\r\n* `curl`/`wget` (Can probably use a URL request)\r\n* `sed`/`awk` (Can just use a regular expression)\r\n* `jq` (Can use a JSON marshaller)\r\n\r\nThis rule would encourage more performant applications, remove dependencies on unnecessary software components, reduce attack surfaces, and increase cross-platform support, by avoiding relying on platform-specific shell command syntax.\r\n\r\nExample triggers:\r\n\r\n* Supplying a process object with a launch path ending with `curl`, `wget`, `sed`, `awk`, `jq`, `jq.exe`, etc.\r\n\r\nExample non-triggers:\r\n\r\n* Supplying a process object with an *argument* of `curl`, `wget`, `sed`, `awk`, `jq`, `jq.exe`, etc. While there are plenty of cases where these would constitute unnecessary shell commands, such as `/usr/bin/env curl`... or `exec wget`..., the false positives for such commands are unfortunately more numerous than the true positives.\r\n\r\nThis rule should contain a limited number of common shell commands, such as those listed above. We can add more over time. Configuration for this rule should be able to customize which of these command patterns is relevant to the user's application needs.\r\n\r\nAs a security concern, this rule can reasonably become a default rule, as shelling out introduces additional security risks, including shell injections, compared to sticking to pure library code.\r\n\r\nI would be happy to see this rule be included in clippy's available suite of checks, and if we find we're happy to apply it in a lot of places, then we can always turn it on by default later."}}
{"actor":{"display_login":"mcandre"}}