{"action":"created","issue":{"url":"https://api.github.com/repos/chrissimpkins/crypto/issues/8","labels_url":"https://api.github.com/repos/chrissimpkins/crypto/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/chrissimpkins/crypto/issues/8/comments","events_url":"https://api.github.com/repos/chrissimpkins/crypto/issues/8/events","html_url":"https://github.com/chrissimpkins/crypto/issues/8","id":67468726,"number":8,"title":"User-input handling","user":{"login":"chrisidefix","id":382555,"avatar_url":"https://avatars.githubusercontent.com/u/382555?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisidefix","html_url":"https://github.com/chrisidefix","followers_url":"https://api.github.com/users/chrisidefix/followers","following_url":"https://api.github.com/users/chrisidefix/following{/other_user}","gists_url":"https://api.github.com/users/chrisidefix/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisidefix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisidefix/subscriptions","organizations_url":"https://api.github.com/users/chrisidefix/orgs","repos_url":"https://api.github.com/users/chrisidefix/repos","events_url":"https://api.github.com/users/chrisidefix/events{/privacy}","received_events_url":"https://api.github.com/users/chrisidefix/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chrissimpkins/crypto/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-04-09T23:02:36Z","updated_at":"2015-05-08T04:13:03Z","closed_at":null,"body":"I believe there is an issue the way user-input is processed. Specifically, I am concerned about the passphrase. The input passphrase is passed along to the execution module `Naked.toolshed.shell.execute()` without any safety checks. The code either uses `Naked.toolshed.shell.execute()` or `Naked.toolshed.shell.muterun()` to run all gpg commands.\r\n\r\nThe problem with this is that `execute()`/`muterun()` apparently will trigger `subprocess.call`/`subprocess.check_output` with `shell=True`. This is a relevant security problem as the user could (accidentally or not) execute any shell command this way. This exact scenario is actually documented here:\r\nhttps://docs.python.org/2/library/subprocess.html#frequently-used-arguments\r\n\r\nI am not sure if this is all still true in Python 3 or if getpass does anything special (I don't think so, other than not displaying what the user types). This should probably be addressed somehow, though."},"comment":{"url":"https://api.github.com/repos/chrissimpkins/crypto/issues/comments/100096896","html_url":"https://github.com/chrissimpkins/crypto/issues/8#issuecomment-100096896","issue_url":"https://api.github.com/repos/chrissimpkins/crypto/issues/8","id":100096896,"user":{"login":"chrissimpkins","id":4249591,"avatar_url":"https://avatars.githubusercontent.com/u/4249591?v=3","gravatar_id":"","url":"https://api.github.com/users/chrissimpkins","html_url":"https://github.com/chrissimpkins","followers_url":"https://api.github.com/users/chrissimpkins/followers","following_url":"https://api.github.com/users/chrissimpkins/following{/other_user}","gists_url":"https://api.github.com/users/chrissimpkins/gists{/gist_id}","starred_url":"https://api.github.com/users/chrissimpkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrissimpkins/subscriptions","organizations_url":"https://api.github.com/users/chrissimpkins/orgs","repos_url":"https://api.github.com/users/chrissimpkins/repos","events_url":"https://api.github.com/users/chrissimpkins/events{/privacy}","received_events_url":"https://api.github.com/users/chrissimpkins/received_events","type":"User","site_admin":false},"created_at":"2015-05-08T04:13:02Z","updated_at":"2015-05-08T04:13:02Z","body":"I backported the `shlex.quote()` function as [`shellescape`](https://github.com/chrissimpkins/shellescape) and will push it to PyPI in the morning after I test a bit more.  Works in Py 2 & all versions of 3.  \r\n\r\nWe can import this into crypto and confirm that it works with passphrases that include single quotes to address this issue."}}