{"action":"created","issue":{"url":"https://api.github.com/repos/universal-ctags/ctags/issues/1349","repository_url":"https://api.github.com/repos/universal-ctags/ctags","labels_url":"https://api.github.com/repos/universal-ctags/ctags/issues/1349/labels{/name}","comments_url":"https://api.github.com/repos/universal-ctags/ctags/issues/1349/comments","events_url":"https://api.github.com/repos/universal-ctags/ctags/issues/1349/events","html_url":"https://github.com/universal-ctags/ctags/issues/1349","id":223362274,"number":1349,"title":"provide secure mode for ctags ","user":{"login":"hanwen","id":31547,"avatar_url":"https://avatars3.githubusercontent.com/u/31547?v=3","gravatar_id":"","url":"https://api.github.com/users/hanwen","html_url":"https://github.com/hanwen","followers_url":"https://api.github.com/users/hanwen/followers","following_url":"https://api.github.com/users/hanwen/following{/other_user}","gists_url":"https://api.github.com/users/hanwen/gists{/gist_id}","starred_url":"https://api.github.com/users/hanwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hanwen/subscriptions","organizations_url":"https://api.github.com/users/hanwen/orgs","repos_url":"https://api.github.com/users/hanwen/repos","events_url":"https://api.github.com/users/hanwen/events{/privacy}","received_events_url":"https://api.github.com/users/hanwen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"masatake","id":77077,"avatar_url":"https://avatars1.githubusercontent.com/u/77077?v=3","gravatar_id":"","url":"https://api.github.com/users/masatake","html_url":"https://github.com/masatake","followers_url":"https://api.github.com/users/masatake/followers","following_url":"https://api.github.com/users/masatake/following{/other_user}","gists_url":"https://api.github.com/users/masatake/gists{/gist_id}","starred_url":"https://api.github.com/users/masatake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masatake/subscriptions","organizations_url":"https://api.github.com/users/masatake/orgs","repos_url":"https://api.github.com/users/masatake/repos","events_url":"https://api.github.com/users/masatake/events{/privacy}","received_events_url":"https://api.github.com/users/masatake/received_events","type":"User","site_admin":false},"assignees":[{"login":"masatake","id":77077,"avatar_url":"https://avatars1.githubusercontent.com/u/77077?v=3","gravatar_id":"","url":"https://api.github.com/users/masatake","html_url":"https://github.com/masatake","followers_url":"https://api.github.com/users/masatake/followers","following_url":"https://api.github.com/users/masatake/following{/other_user}","gists_url":"https://api.github.com/users/masatake/gists{/gist_id}","starred_url":"https://api.github.com/users/masatake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masatake/subscriptions","organizations_url":"https://api.github.com/users/masatake/orgs","repos_url":"https://api.github.com/users/masatake/repos","events_url":"https://api.github.com/users/masatake/events{/privacy}","received_events_url":"https://api.github.com/users/masatake/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2017-04-21T11:56:15Z","updated_at":"2017-04-21T14:58:52Z","closed_at":null,"body":"I would like to run ctags on untrusted input for a public service. Since ctags is written in C, there is a big potential for the service to be compromised if someone finds a buffer overflow somewhere.\r\n\r\nIn order to mitigate this, I would like to request a secure mode.\r\n\r\nAs a first approximation, it could work like this:\r\n\r\n* ctags mallocs a chunk of memory (size is configurable) \r\n* ctags opening its first input file, ctags drops all capabiilties using seccomp.\r\n* ctags frees the chunk \r\n* ctags prints tags on stdout (unsorted).\r\n\r\nthis would let one securely run ctags over a single file. \r\n\r\na more advanced design would look like this: \r\n\r\n* ctags drops capabilities\r\n* ctags receives instructions over stdin:\r\n\r\n  FILENAME SIZE '\\n'\r\n  {SIZE bytes of content}\r\n\r\n* ctags prints on output\r\n\r\n  {ctags data for file}\r\n  {empty line}\r\n\r\nthis would let one keep a single ctags binary running \"hot\". Maybe this isn't warranted though, given given the speed of the program.\r\n"},"comment":{"url":"https://api.github.com/repos/universal-ctags/ctags/issues/comments/296214732","html_url":"https://github.com/universal-ctags/ctags/issues/1349#issuecomment-296214732","issue_url":"https://api.github.com/repos/universal-ctags/ctags/issues/1349","id":296214732,"user":{"login":"tmm1","id":2567,"avatar_url":"https://avatars1.githubusercontent.com/u/2567?v=3","gravatar_id":"","url":"https://api.github.com/users/tmm1","html_url":"https://github.com/tmm1","followers_url":"https://api.github.com/users/tmm1/followers","following_url":"https://api.github.com/users/tmm1/following{/other_user}","gists_url":"https://api.github.com/users/tmm1/gists{/gist_id}","starred_url":"https://api.github.com/users/tmm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmm1/subscriptions","organizations_url":"https://api.github.com/users/tmm1/orgs","repos_url":"https://api.github.com/users/tmm1/repos","events_url":"https://api.github.com/users/tmm1/events{/privacy}","received_events_url":"https://api.github.com/users/tmm1/received_events","type":"User","site_admin":false},"created_at":"2017-04-21T14:58:52Z","updated_at":"2017-04-21T14:58:52Z","body":">I would like to run ctags on untrusted input for a public service. Since ctags is written in C, there is a big potential for the service to be compromised if someone finds a buffer overflow somewhere.\r\n\r\nA colleague of mine wrote another patch which adds seccomp to ctags, to limit which syscalls can be invoked in the case of an exploit. We are not using it but I can share the patch if you are interested.\r\n\r\nI also recommend something like firejail for running ctags in a sandbox."}}
{"actor":{"display_login":"tmm1"}}