{"id":80087,"date":"2019-12-17T09:19:46","date_gmt":"2019-12-17T17:19:46","guid":{"rendered":"https:\/\/github.blog\/?p=80087"},"modified":"2024-10-15T08:13:29","modified_gmt":"2024-10-15T15:13:29","slug":"ubuntu-apport-toctou-security-vulnerability-cve-2019-7307","status":"publish","type":"post","link":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/","title":{"rendered":"Ubuntu apport TOCTOU security vulnerability (CVE-2019-7307)"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><p>I started a <a href=\"https:\/\/github.blog\/security\/vulnerability-research\/whoopsie-daisy-chaining-accidental-features-of-ubuntus-crash-reporter-to-get-local-privilege-escalation\">four-part series about Ubuntu&rsquo;s crash reporting system<\/a>. In this second post, I&rsquo;ll focus on apport <a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2019-7307\">CVE-2019-7307<\/a>, a TOCTOU vulnerability that enables a local attacker to include the contents of any file on the system in a crash report.<\/p>\n<h2 id=\"the-bug\" id=\"the-bug\" ><a class=\"heading-link\" href=\"#the-bug\">The bug<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>Apport allows you to place a file in your home directory named <code>~\/.apport-ignore.xml<\/code>. It enables you to specify a custom list of executables that should be ignored by the crash reporter. But what happens if you replace <code>~\/.apport-ignore.xml<\/code> with a symlink to a file that you don&rsquo;t own, such as <code>\/etc\/shadow<\/code>? The code that handles that is at <a href=\"https:\/\/git.launchpad.net\/ubuntu\/+source\/apport\/tree\/apport\/report.py?h=applied\/ubuntu\/bionic-devel&amp;id=2fc8fb446c78e950d643bf49bb7d4a0dc3b05429#n962\">report.py, line 962<\/a>:<\/p>\n<pre><code class=\"language-python\">if not os.access(ifpath, os.R_OK) or os.path.getsize(ifpath) == 0:\n    # create a document from scratch\n    dom = xml.dom.getDOMImplementation().createDocument(None, 'apport', None)\nelse:\n    try:\n        dom = xml.dom.minidom.parse(ifpath)\n    except ExpatError as e:\n        raise ValueError('%s has invalid format: %s' % (_ignore_file, str(e)))\n<\/code><\/pre>\n<p>As you can see, it uses <code>os.access<\/code> to check that the user has permission to access the file. If the permission check passes, then it calls <code>xml.dom.minidom.parse<\/code> to parse the XML. This is a classic example of a &ldquo;time of check to time of use&rdquo; (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Time-of-check_to_time-of-use\">TOCTOU<\/a>) vulnerability. If the file is valid at the time of the <code>os.access<\/code> check, but I quickly replace it with a symlink to a different file before the call to <code>xml.dom.minidom.parse<\/code>, then I can trick apport into using its elevated privileges to read a file which I do not have permission to access myself.<\/p>\n<h3 id=\"subtleties-of-privilege-dropping-in-apport\" id=\"subtleties-of-privilege-dropping-in-apport\" ><a class=\"heading-link\" href=\"#subtleties-of-privilege-dropping-in-apport\">Subtleties of privilege dropping in apport<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h3>\n<p>You may wonder why the <code>os.access<\/code> check would ever fail, because apport is a root process. The reason is that apport drops privileges during its execution in two stages. The first stage happens at <a href=\"https:\/\/git.launchpad.net\/ubuntu\/+source\/apport\/tree\/data\/apport?h=applied\/ubuntu\/bionic-devel&amp;id=2fc8fb446c78e950d643bf49bb7d4a0dc3b05429#n455\">apport, line 455<\/a>:<\/p>\n<pre><code class=\"language-python\"># Partially drop privs to gain proper os.access() checks\ndrop_privileges(True)\n<\/code><\/pre>\n<p>The second stage happens at <a href=\"https:\/\/git.launchpad.net\/ubuntu\/+source\/apport\/tree\/data\/apport?h=applied\/ubuntu\/bionic-devel&amp;id=2fc8fb446c78e950d643bf49bb7d4a0dc3b05429#n601\">line 601<\/a>:<\/p>\n<pre><code class=\"language-python\"># Totally drop privs before writing out the reportfile.\ndrop_privileges()\n<\/code><\/pre>\n<p>What do they mean by &ldquo;partially drop privs&rdquo; and &ldquo;totally drop privs&rdquo;? This is related to the <a href=\"https:\/\/en.wikipedia.org\/wiki\/User_identifier#Process_attributes\">real, effective, and saved user ids<\/a> of the process:<\/p>\n<div data-target=\"content-table-wrap.container\" class=\"content-table-wrap\"><content-table-wrap><table>\n<thead>\n<tr>\n<th><\/th>\n<th>RUID<\/th>\n<th>EUID<\/th>\n<th>SUID<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>root process<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>&ldquo;partially drop privs&rdquo;<\/td>\n<td>1001<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>read files safely<\/td>\n<td>1001<\/td>\n<td>1001<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>&ldquo;totally drop privs&rdquo;<\/td>\n<td>1001<\/td>\n<td>1001<\/td>\n<td>1001<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/content-table-wrap><\/div>\n<p>(0 is the user id of <code>root<\/code> and 1001 is the user id of my own unprivileged account, <code>kev<\/code>.) The real user id (<code>RUID<\/code>) determines the owner of the process, but the effective user id (<code>EUID<\/code>) determines which files the process can read and write. This means that when apport is in the &ldquo;partially drop privs&rdquo; state, it can still read any file on the system.<\/p>\n<p>The correct way for apport to make sure that it doesn&rsquo;t accidentally use its root privileges to read or write a file is to first enter the state that I have named &ldquo;read files safely&rdquo; in the table. Because the saved user id (<code>SUID<\/code>) is still root, the process can temporarily enter the &ldquo;read files safely&rdquo; state and then revert back to &ldquo;partially drop privs&rdquo; after it&rsquo;s done reading the file. Note that the transition to &ldquo;totally drop privs&rdquo; is, in contrast, irreversible.<\/p>\n<p>The <code>os.access<\/code> check is unusual because it uses the <code>RUID<\/code>, rather than the <code>EUID<\/code>, to check whether the real user has permission to access the file. This is the reason why there is a TOCTOU vulnerability. Apport is in the &ldquo;partially drop privs&rdquo; state when <code>os.access<\/code> is called. This means it will reject files that I don&rsquo;t own, but if I can bypass the <code>os.access<\/code> check then the subsequent call to <code>xml.dom.minidom.parse<\/code> will be able to read any file because the <code>EUID<\/code> is still root. I can do this by timing the attack to replace <code>~\/.apport-ignore.xml<\/code> with a symlink just <em>after<\/em> the call to <code>os.access<\/code>.<\/p>\n<h3 id=\"comparison-to-cve-2019-11481\" id=\"comparison-to-cve-2019-11481\" ><a class=\"heading-link\" href=\"#comparison-to-cve-2019-11481\">Comparison to CVE-2019-11481<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h3>\n<p>I found a very similar bug at <a href=\"https:\/\/git.launchpad.net\/ubuntu\/+source\/apport\/tree\/apport\/fileutils.py?h=applied\/ubuntu\/bionic-devel&amp;id=20c98691144e843bf1ab8428603beedd34e993ad#n335\">fileutils.py, line 335<\/a>:<\/p>\n<pre><code class=\"language-python\">def get_config(section, setting, default=None, path=None, bool=False):\n    '''Return a setting from user configuration.\n\n    This is read from ~\/.config\/apport\/settings or path. If bool is True, the\n    value is interpreted as a boolean.\n    '''\n    if not get_config.config:\n        get_config.config = ConfigParser()\n        if path:\n            get_config.config.read(path)\n        else:\n            get_config.config.read(os.path.expanduser(_config_file))\n<\/code><\/pre>\n<p>This code opens the file <code>~\/.config\/apport\/settings<\/code> with a root <code>EUID<\/code>. At first glance, since an <code>os.access<\/code> check doesn&rsquo;t exist here, it seems easier to exploit than the other bug. After further review, I found that it isn&rsquo;t, and the reason is due to a difference in<br>\nerror handling behavior. For example, if I want to use the bug to read the contents of <code>\/var\/shadow<\/code>,  it&rsquo;s not a valid XML file, and it also isn&rsquo;t formatted correctly to be parsed as an apport settings file. So, in either case, it will trigger a parse error in apport. In the case of <code>~\/.config\/apport\/settings<\/code>, this causes apport to abort immediately. But in the case of <code>~\/.apport-ignore.xml<\/code>, the incorrectly formatted file is ignored and apport continues running. Because of this, I found it easier to exploit <code>~\/.apport-ignore.xml<\/code>.<\/p>\n<p>I reported the <code>~\/.config\/apport\/settings<\/code> bug to Ubuntu: <a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+source\/apport\/+bug\/1830862\">bug 1830862<\/a>.<br>\nIt&rsquo;s since been fixed and assigned <a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2019-11481\">CVE-2019-11481<\/a>.<\/p>\n<h2 id=\"exploit-plan\" id=\"exploit-plan\" ><a class=\"heading-link\" href=\"#exploit-plan\">Exploit plan<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>The bug enables me to trick apport into loading any file on the system, by replacing <code>~\/.apport-ignore.xml<\/code> with a symlink. But any file that I&rsquo;m interested in is almost certainly not going to be a valid XML file, so it will cause a parse error and apport will ignore it. How could this help me access forbidden information?<\/p>\n<p>Here&rsquo;s my cunning plan:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2019\/12\/ubuntu_apport_exploit_plan_CVE-2019-7307.drawio.svg?w=761\" alt=\"Ubuntu Apport exploit Plan\" width=\"761\" height=\"303\" class=\"aligncenter size-large wp-image-80358 width-fit\" role=\"img\"><\/p>\n<p>The main idea is that, even though the forbidden file will trigger a parse error and get ignored, it&rsquo;s still loaded into apport&rsquo;s heap. This means that if I crash apport then the contents of the file will be included in the crash report. This is the sequence of events in the plan:<\/p>\n<ol>\n<li>I start <code>\/bin\/sleep<\/code> and crash it by sending it a <code>SIGSEGV<\/code>.<\/li>\n<li>Apport starts up to generate a crash report for <code>\/bin\/sleep<\/code>.<\/li>\n<li>I replace <code>~\/.apport-ignore.xml<\/code> with a symlink at exactly the right moment, so that apport loads a forbidden file into memory.<\/li>\n<li>I crash apport by sending it a <code>SIGSEGV<\/code>.<\/li>\n<li>A second apport starts up to generate a crash report for the first apport.<\/li>\n<li>The second apport writes out a crash report for the first, containing a copy of the forbidden file in the core dump.<\/li>\n<\/ol>\n<h3 id=\"obstacles\" id=\"obstacles\" ><a class=\"heading-link\" href=\"#obstacles\">Obstacles<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h3>\n<p>It wasn&rsquo;t quite that easy. I ran into several problems. The obvious one is that precise timing of the symlink switcheroo is crucial, so I anticipated that being difficult to get right. But there were also some unexpected problems, which I&rsquo;ll cover in the following sections.<\/p>\n<h4 id=\"anti-recursion-mitigations\" id=\"anti-recursion-mitigations\" ><a class=\"heading-link\" href=\"#anti-recursion-mitigations\">Anti-recursion mitigations<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h4>\n<p>Apport has a couple of mitigations to prevent it from running on itself. The comment at <a href=\"https:\/\/git.launchpad.net\/ubuntu\/+source\/apport\/tree\/data\/apport?h=applied\/ubuntu\/bionic-devel&amp;id=2fc8fb446c78e950d643bf49bb7d4a0dc3b05429#n30\">apport, line 30<\/a> explains that this is to avoid &ldquo;bringing down the system to its knees if there is a series of crashes&rdquo;.<\/p>\n<p>The first mitigation is a lock file named <code>\/var\/crash\/.lock<\/code>. When apport starts, it uses <a href=\"https:\/\/manpages.ubuntu.com\/manpages\/bionic\/man3\/lockf.3.html\"><code>lockf<\/code><\/a> to set a lock on this file to prevent another apport from running at the same time.<\/p>\n<p>The interesting thing is that <code>lockf<\/code> file locks are only <em>advisory<\/em>! In fact, as Victor Gaydov explains in <a href=\"https:\/\/gavv.github.io\/articles\/file-locks\/#posix-record-locks-fcntl%5D\">this excellent overview<\/a>, the lock is actually associated with an [i-node, pid] pair. This means that if I replace <code>\/var\/crash\/.lock<\/code> with a new file after the first apport has set its lock, then the second apport will see a different i-node, so both apports can hold locks on <code>\/var\/crash\/.lock<\/code> at the same time!<\/p>\n<p>The trick of replacing <code>\/var\/crash\/.lock<\/code> with a new file relies on me having permission to delete or move the file. Since the <code>\/var\/crash<\/code> directory has the sticky bit set (see the <a href=\"https:\/\/github.blog\/security\/vulnerability-research\/whoopsie-daisy-chaining-accidental-features-of-ubuntus-crash-reporter-to-get-local-privilege-escalation\">first post for more information<\/a>), this means that I must own the file. Luckily, <code>\/var\/crash<\/code> is world-writable, so I can create <code>\/var\/crash\/.lock<\/code> as long as it doesn&rsquo;t already exist. When I first submitted my <a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+source\/apport\/+bug\/1830858\">bug report<\/a> to Ubuntu on May 29, I thought that this would often make the vulnerability unexploitable. That&rsquo;s because on my work laptop, <code>\/var\/crash\/.lock<\/code> almost always exists and is owned by root. I have since discovered that <code>\/var\/crash\/.lock<\/code> is deleted by a daily cronjob: <code>\/etc\/cron.daily\/apport<\/code>. The lock file often exists on my work laptop because I deliberately crash applications on a fairly regular basis. But on a typical Ubuntu system, it is unlikely to exist at any given time, due to the daily cronjob.<\/p>\n<p>In my <a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+source\/apport\/+bug\/1830858\">bug report<\/a>, I recommended that <code>\/var\/crash\/.lock<\/code> should always<br>\nexist and be owned by root, as a mitigation against this type of exploit. While I did not regard it as a vulnerability by itself, Sander Bos has since submitted a separate <a href=\"https:\/\/bugs.launchpad.net\/apport\/+bug\/1839415\">bug report<\/a> about this issue. It&rsquo;s been assigned <a href=\"https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2019-11485\">CVE-2019-11485<\/a> and fixed by changing the directory that the lock file is stored in.<\/p>\n<p>The second mitigation is a slightly obscure bit of <a href=\"https:\/\/github.com\/torvalds\/linux\/blob\/37d4e84f765bb3038ddfeebdc5d1cfd7e1ef688f\/fs\/coredump.c#L637\">logic in the kernel<\/a>, based on <a href=\"https:\/\/manpages.ubuntu.com\/manpages\/bionic\/man2\/getrlimit.2.html\"><code>RLIMIT_CORE<\/code><\/a>. <code>RLIMIT_CORE<\/code> is a resource limit: the maximum size of the<br>\ncore file. The value <code>RLIMIT_CORE == 1<\/code> is used as a special value to indicate that the process is a crash reporter and should not generate a core dump if it crashes (to prevent recursion). I found an explanation of this mitigation in <a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+source\/linux\/+bug\/498525\/comments\/3\">this comment<\/a>.<\/p>\n<p>I got lucky with the <code>RLIMIT_CORE<\/code> mitigation. It turns out that you can use <a href=\"http:\/\/localhost:8000\/\"><code>prlimit<\/code><\/a> to modify the <code>RLIMIT_CORE<\/code> of another process! You need to have appropriate permissions to so do, of course, but I found that it works as soon as apport enters the &ldquo;totally drop privs&rdquo; state (refer to the table). Unfortunately, It isn&rsquo;t possible to <em>increase<\/em> the value of <code>RLIMIT_CORE<\/code> with <code>prlimit<\/code>, but I am able to drop it to zero, which is sufficient for this exploit.<\/p>\n<h4 id=\"signal-handling\" id=\"signal-handling\" ><a class=\"heading-link\" href=\"#signal-handling\">Signal handling<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h4>\n<p>Part of my cunning plan was to crash apport by sending it a <code>SIGSEGV<\/code>. That doesn&rsquo;t work because apport <a href=\"https:\/\/git.launchpad.net\/ubuntu\/+source\/apport\/tree\/data\/apport?h=applied\/ubuntu\/bionic-devel&amp;id=2fc8fb446c78e950d643bf49bb7d4a0dc3b05429#n148\">sets a signal handler<\/a> for <code>SIGSEGV<\/code>:<\/p>\n<pre><code class=\"language-python\">def setup_signals():\n    '''Install a signal handler for all crash-like signals, so that apport is\n    not called on itself when apport crashed.'''\n\n    signal.signal(signal.SIGILL, _log_signal_handler)\n    signal.signal(signal.SIGABRT, _log_signal_handler)\n    signal.signal(signal.SIGFPE, _log_signal_handler)\n    signal.signal(signal.SIGSEGV, _log_signal_handler)\n    signal.signal(signal.SIGPIPE, _log_signal_handler)\n    signal.signal(signal.SIGBUS, _log_signal_handler)\n<\/code><\/pre>\n<p>Again, it appears that the motivation for this is to prevent apport from running recursively on itself. Luckily for me, the list of signals that <code>setup_signals<\/code> sets handlers for isn&rsquo;t sufficiently thorough. The <a href=\"https:\/\/manpages.ubuntu.com\/manpages\/bionic\/man7\/signal.7.html\">section 7 man page for signal<\/a> has a table titled &ldquo;Standard signals&rdquo;. Here&rsquo;s a short excerpt:<\/p>\n<div data-target=\"content-table-wrap.container\" class=\"content-table-wrap\"><content-table-wrap><table>\n<thead>\n<tr>\n<th>Signal<\/th>\n<th>Value<\/th>\n<th>Action<\/th>\n<th>Comment<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>SIGINT<\/code><\/td>\n<td>2<\/td>\n<td>Term<\/td>\n<td>Interrupt from keyboard<\/td>\n<\/tr>\n<tr>\n<td><code>SIGQUIT<\/code><\/td>\n<td>3<\/td>\n<td>Core<\/td>\n<td>Quit from keyboard<\/td>\n<\/tr>\n<tr>\n<td><code>SIGILL<\/code><\/td>\n<td>4<\/td>\n<td>Core<\/td>\n<td>Illegal Instruction<\/td>\n<\/tr>\n<tr>\n<td>&hellip;<\/td>\n<td>&hellip;<\/td>\n<td>&hellip;<\/td>\n<td>&hellip;<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/content-table-wrap><\/div>\n<p>Any signal with &ldquo;Core&rdquo; in the &ldquo;Action&rdquo; column will trigger a core dump. Apport&rsquo;s list of signal handlers includes the most common core-generating signals, but it&rsquo;s far from comprehensive. There are several left to choose from. My exploit uses <code>SIGTRAP<\/code>.<\/p>\n<h2 id=\"exploit-implementation\" id=\"exploit-implementation\" ><a class=\"heading-link\" href=\"#exploit-implementation\">Exploit implementation<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>I&rsquo;ve posted the source code for my proof-of-concept exploit on <a href=\"https:\/\/github.com\/github\/securitylab\/blob\/8a4842917730357bf43d3148fb4fb0b3a7d5b9d6\/SecurityExploits\/Ubuntu\/Apport_TOCTOU_get_ignore_dom_CVE-2019-7307\/gencrashreport.cpp\">GitHub<\/a>. It works mostly according to the plan that I described above, but with a few tweaks to account for the obstacles discussed above. This is the sequence of events in the revised plan:<\/p>\n<ol>\n<li>I <a href=\"https:\/\/github.com\/github\/securitylab\/blob\/8a4842917730357bf43d3148fb4fb0b3a7d5b9d6\/SecurityExploits\/Ubuntu\/Apport_TOCTOU_get_ignore_dom_CVE-2019-7307\/gencrashreport.cpp#L214-L215\">start<\/a> a <code>\/bin\/sleep<\/code>.<\/li>\n<li>I <a href=\"https:\/\/github.com\/github\/securitylab\/blob\/8a4842917730357bf43d3148fb4fb0b3a7d5b9d6\/SecurityExploits\/Ubuntu\/Apport_TOCTOU_get_ignore_dom_CVE-2019-7307\/gencrashreport.cpp#L93-L99\">create<\/a> <code>\/var\/crash\/.lock<\/code>, so that I can delete it later.<\/li>\n<li>I <a href=\"https:\/\/github.com\/github\/securitylab\/blob\/8a4842917730357bf43d3148fb4fb0b3a7d5b9d6\/SecurityExploits\/Ubuntu\/Apport_TOCTOU_get_ignore_dom_CVE-2019-7307\/gencrashreport.cpp#L149-L150\">kill<\/a> <code>\/bin\/sleep<\/code> with a <code>SIGSEGV<\/code>.<\/li>\n<li>Apport starts up to generate a crash report for <code>\/bin\/sleep<\/code>.<\/li>\n<li>I <a href=\"https:\/\/github.com\/github\/securitylab\/blob\/8a4842917730357bf43d3148fb4fb0b3a7d5b9d6\/SecurityExploits\/Ubuntu\/Apport_TOCTOU_get_ignore_dom_CVE-2019-7307\/gencrashreport.cpp#L155-L159\">replace<\/a> <code>~\/.apport-ignore.xml<\/code> with a symlink at exactly the right moment, so that apport loads a forbidden file into memory.<\/li>\n<li>I <a href=\"https:\/\/github.com\/github\/securitylab\/blob\/8a4842917730357bf43d3148fb4fb0b3a7d5b9d6\/SecurityExploits\/Ubuntu\/Apport_TOCTOU_get_ignore_dom_CVE-2019-7307\/gencrashreport.cpp#L164-L169\">replace<\/a> <code>\/var\/crash\/.lock<\/code> with a new file, to bypass the file lock and enable a second apport to run at the same time as the first.<\/li>\n<li>I <a href=\"https:\/\/github.com\/github\/securitylab\/blob\/8a4842917730357bf43d3148fb4fb0b3a7d5b9d6\/SecurityExploits\/Ubuntu\/Apport_TOCTOU_get_ignore_dom_CVE-2019-7307\/gencrashreport.cpp#L279-L287\">use<\/a> <code>prlimit<\/code> to set apport&rsquo;s <code>RLIMIT_CORE<\/code> to zero.<\/li>\n<li>I <a href=\"https:\/\/github.com\/github\/securitylab\/blob\/8a4842917730357bf43d3148fb4fb0b3a7d5b9d6\/SecurityExploits\/Ubuntu\/Apport_TOCTOU_get_ignore_dom_CVE-2019-7307\/gencrashreport.cpp#L289-L293\">crash<\/a> apport by sending it a <code>SIGTRAP<\/code>.<\/li>\n<li>A second apport starts up to generate a crash report for the first apport.<\/li>\n<li>The second apport writes out a crash report for the first, containing a copy of the forbidden file in the core dump.<\/li>\n<\/ol>\n<p>All that&rsquo;s left to discuss is how I time the symlink switcheroo. I initially thought it would be very difficult to get the exploit working, because there is such a short time-interval between the call to <code>os.access<\/code> and when the file is opened. But it turns out that it is hilariously easy to win a race against Python when you are programming in C. The crucial moment in the PoC, when the switcheroo happens, is at <a href=\"https:\/\/github.com\/github\/securitylab\/blob\/8a4842917730357bf43d3148fb4fb0b3a7d5b9d6\/SecurityExploits\/Ubuntu\/Apport_TOCTOU_get_ignore_dom_CVE-2019-7307\/gencrashreport.cpp#L155\">line 155<\/a>. I use <a href=\"https:\/\/manpages.ubuntu.com\/manpages\/bionic\/man7\/inotify.7.html\">inotify<\/a> for the timing. By running <code>sudo strace -e file -tt -p &lt;apport PID&gt;<\/code>, I discovered that a file named <code>expatbuilder.cpython-36.pyc<\/code> is always opened immediately before <code>~\/.apport-ignore.xml<\/code> is parsed. By <a href=\"https:\/\/github.com\/github\/securitylab\/blob\/8a4842917730357bf43d3148fb4fb0b3a7d5b9d6\/SecurityExploits\/Ubuntu\/Apport_TOCTOU_get_ignore_dom_CVE-2019-7307\/gencrashreport.cpp#L147\">watching<\/a> for an <code>IN_OPEN<\/code> event on that file, I can time the switcheroo very precisely.<\/p>\n<h2 id=\"you-have-got-to-be-kidding-me\" id=\"you-have-got-to-be-kidding-me\" ><a class=\"heading-link\" href=\"#you-have-got-to-be-kidding-me\">You have got to be kidding me!<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>When I was finally able to get the exploit working, I excitedly went to look at the crash report in <code>\/var\/crash<\/code> and saw the following:<\/p>\n<pre><code class=\"language-bash\">kev@constellation:~$ ls -al \/var\/crash\/\ntotal 4492\ndrwxrwsrwt  2 root whoopsie   12288 Nov  5 12:26 .\ndrwxr-xr-x 17 root root        4096 Jul 17 19:31 ..\n-rw-r-----  1 root whoopsie 4583201 Nov  5 12:26 _usr_share_apport_apport.0.crash\n<\/code><\/pre>\n<p>That was definitely a facepalm moment. The file is owned by root. What happened? I was sure that it would be owned by me, because my PoC doesn&rsquo;t send the <code>SIGTRAP<\/code> until after the first apport has entered the &ldquo;totally drop privs&rdquo; state (refer to the table). The apport process is completely owned by me at the moment when it crashes, so surely I should be able to read the crash report? This problem is caused by a subtle detail in how apport determines the owner of the crashed process. This happens in <a href=\"https:\/\/git.launchpad.net\/ubuntu\/+source\/apport\/tree\/data\/apport?h=applied\/ubuntu\/bionic-devel&amp;id=2fc8fb446c78e950d643bf49bb7d4a0dc3b05429#n68\"><code>get_pid_info<\/code><\/a>, by running <code>os.stat<\/code> on <code>\/proc\/[pid]\/stat<\/code>. This is explained in a couple of comments scattered throughout the source code, such as <a href=\"https:\/\/git.launchpad.net\/ubuntu\/+source\/apport\/tree\/data\/apport?h=applied\/ubuntu\/bionic-devel&amp;id=2fc8fb446c78e950d643bf49bb7d4a0dc3b05429#n70\">here<\/a> and <a href=\"https:\/\/git.launchpad.net\/ubuntu\/+source\/apport\/tree\/data\/apport?h=applied\/ubuntu\/bionic-devel&amp;id=2fc8fb446c78e950d643bf49bb7d4a0dc3b05429#n171\">here<\/a>. It&rsquo;s a mitigation against accidentally leaking sensitive information when a setuid binary crashes (which is almost exactly what I&rsquo;m trying to do). In my case, apport was started as a root process, so <code>\/proc\/[pid]\/stat<\/code> is owned by root, even after the transition to the &ldquo;totally drop privs&rdquo; state. I haven&rsquo;t been able to find any way to defeat this protection.<\/p>\n<p>The consolation prize is that the exploit works. When I looked at the contents of the file, this is what I saw:<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2019\/12\/CoreDump_with_etc_shadow.png?w=1024&#038;resize=1024%2C507\" alt=\"Core dump\" width=\"1024\" height=\"507\" class=\"aligncenter size-large wp-image-80092 width-fit\" srcset=\"https:\/\/github.blog\/wp-content\/uploads\/2019\/12\/CoreDump_with_etc_shadow.png?w=2729 2729w, https:\/\/github.blog\/wp-content\/uploads\/2019\/12\/CoreDump_with_etc_shadow.png?w=300 300w, https:\/\/github.blog\/wp-content\/uploads\/2019\/12\/CoreDump_with_etc_shadow.png?w=768 768w, https:\/\/github.blog\/wp-content\/uploads\/2019\/12\/CoreDump_with_etc_shadow.png?w=1024 1024w, https:\/\/github.blog\/wp-content\/uploads\/2019\/12\/CoreDump_with_etc_shadow.png?w=1536 1536w, https:\/\/github.blog\/wp-content\/uploads\/2019\/12\/CoreDump_with_etc_shadow.png?w=2048 2048w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<p>The other good news is that the exploit is very quick and reliable. I thought that the timing of the symlink switcheroo might make it unreliable, but I found that it works perfectly every time.<\/p>\n<p>So all is not lost. Although the crash report is owned by root, it&rsquo;s also readable by whoopsie, which means that if I can find a vulnerability in the whoopsie daemon, I might also be able to read the contents of the crash report.<\/p>\n<h2 id=\"to-be-continued\" id=\"to-be-continued\" ><a class=\"heading-link\" href=\"#to-be-continued\">To be continued &hellip;<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>Stay tuned for the next two posts in this series:<\/p>\n<ul>\n<li>December 19, 2019: <a href=\"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-pid-recycling-security-vulnerability-cve-2019-15790\"><em>Ubuntu apport PID recycling vulnerability (CVE-2019-15790)<\/em><\/a><\/li>\n<li>December 23, 2019: <a href=\"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-whoopsie-integer-overflow-vulnerability-cve-2019-11484\"><em>Ubuntu whoopsie integer overflow vulnerability (CVE-2019-11484)<\/em><\/a><\/li>\n<\/ul>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>This is the second post in our series about Ubuntu&#8217;s crash reporting system. We&#8217;ll review CVE-2019-7307, a TOCTOU vulnerability that enables a local attacker to include the contents of any file on the system in a crash report.<\/p>\n","protected":false},"author":1905,"featured_media":80088,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_gh_post_show_toc":"yes","_gh_post_is_no_robots":"no","_gh_post_is_featured":"no","_gh_post_is_excluded":"no","_gh_post_is_unlisted":"no","_gh_post_related_link_1":"","_gh_post_related_link_2":"","_gh_post_related_link_3":"","_gh_post_sq_img":"","_gh_post_sq_img_id":"","_gh_post_cta_title":"","_gh_post_cta_text":"","_gh_post_cta_link":"","_gh_post_cta_button":"Click Here to Learn More","_gh_post_recirc_hide":"no","_gh_post_recirc_col_1":"78957","_gh_post_recirc_col_2":"78959","_gh_post_recirc_col_3":"78961","_gh_post_recirc_col_4":"77524","_featured_video":"","_gh_post_additional_query_params":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"_links_to":"","_links_to_target":""},"categories":[91,3336],"tags":[1915,2784,3290],"coauthors":[2148],"class_list":["post-80087","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security","category-vulnerability-research","tag-github-security-lab","tag-ubuntu","tag-vulnerability-research"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Ubuntu apport TOCTOU security vulnerability (CVE-2019-7307) - The GitHub Blog<\/title>\n<meta name=\"description\" content=\"This is the second post in our series about Ubuntu&#039;s crash reporting system. We&#039;ll review CVE-2019-7307, a TOCTOU vulnerability that enables a local attacker to include the contents of any file on the system in a crash report.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ubuntu apport TOCTOU security vulnerability (CVE-2019-7307)\" \/>\n<meta property=\"og:description\" content=\"This is the second post in our series about Ubuntu&#039;s crash reporting system. We&#039;ll review CVE-2019-7307, a TOCTOU vulnerability that enables a local attacker to include the contents of any file on the system in a crash report.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/\" \/>\n<meta property=\"og:site_name\" content=\"The GitHub Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-17T17:19:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-15T15:13:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/github.blog\/wp-content\/uploads\/2024\/09\/Security-LightMode-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Kevin Backhouse\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kevin Backhouse\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/github.blog\\\/security\\\/vulnerability-research\\\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/github.blog\\\/security\\\/vulnerability-research\\\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\\\/\"},\"author\":{\"name\":\"Kevin Backhouse\",\"@id\":\"https:\\\/\\\/github.blog\\\/#\\\/schema\\\/person\\\/92f78909ac8106949ccaf6878d3d33d8\"},\"headline\":\"Ubuntu apport TOCTOU security vulnerability (CVE-2019-7307)\",\"datePublished\":\"2019-12-17T17:19:46+00:00\",\"dateModified\":\"2024-10-15T15:13:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/github.blog\\\/security\\\/vulnerability-research\\\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\\\/\"},\"wordCount\":2181,\"image\":{\"@id\":\"https:\\\/\\\/github.blog\\\/security\\\/vulnerability-research\\\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/Security-LightMode-2.png?fit=1200%2C630\",\"keywords\":[\"GitHub Security Lab\",\"ubuntu\",\"vulnerability research\"],\"articleSection\":[\"Security\",\"Vulnerability research\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/github.blog\\\/security\\\/vulnerability-research\\\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\\\/\",\"url\":\"https:\\\/\\\/github.blog\\\/security\\\/vulnerability-research\\\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\\\/\",\"name\":\"Ubuntu apport TOCTOU security vulnerability (CVE-2019-7307) - The GitHub Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/github.blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/github.blog\\\/security\\\/vulnerability-research\\\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/github.blog\\\/security\\\/vulnerability-research\\\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/Security-LightMode-2.png?fit=1200%2C630\",\"datePublished\":\"2019-12-17T17:19:46+00:00\",\"dateModified\":\"2024-10-15T15:13:29+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/github.blog\\\/#\\\/schema\\\/person\\\/92f78909ac8106949ccaf6878d3d33d8\"},\"description\":\"This is the second post in our series about Ubuntu's crash reporting system. We'll review CVE-2019-7307, a TOCTOU vulnerability that enables a local attacker to include the contents of any file on the system in a crash report.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/github.blog\\\/security\\\/vulnerability-research\\\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/github.blog\\\/security\\\/vulnerability-research\\\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/github.blog\\\/security\\\/vulnerability-research\\\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\\\/#primaryimage\",\"url\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/Security-LightMode-2.png?fit=1200%2C630\",\"contentUrl\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/Security-LightMode-2.png?fit=1200%2C630\",\"width\":1200,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/github.blog\\\/security\\\/vulnerability-research\\\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/github.blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Security\",\"item\":\"https:\\\/\\\/github.blog\\\/security\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Vulnerability research\",\"item\":\"https:\\\/\\\/github.blog\\\/security\\\/vulnerability-research\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Ubuntu apport TOCTOU security vulnerability (CVE-2019-7307)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/github.blog\\\/#website\",\"url\":\"https:\\\/\\\/github.blog\\\/\",\"name\":\"The GitHub Blog\",\"description\":\"Updates, ideas, and inspiration from GitHub to help developers build and design software.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/github.blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/github.blog\\\/#\\\/schema\\\/person\\\/92f78909ac8106949ccaf6878d3d33d8\",\"name\":\"Kevin Backhouse\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/37eef09dcba369292c199dca0f43db83ef312cd5956f7f5e1932893acabe55f6?s=96&d=mm&r=g3867af48b7150cd8900167c0a2e02002\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/37eef09dcba369292c199dca0f43db83ef312cd5956f7f5e1932893acabe55f6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/37eef09dcba369292c199dca0f43db83ef312cd5956f7f5e1932893acabe55f6?s=96&d=mm&r=g\",\"caption\":\"Kevin Backhouse\"},\"description\":\"I'm a security researcher on the GitHub Security Lab team. I try to help make open source software more secure by searching for vulnerabilities and working with maintainers to get them fixed.\",\"url\":\"https:\\\/\\\/github.blog\\\/author\\\/kevinbackhouse\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Ubuntu apport TOCTOU security vulnerability (CVE-2019-7307) - The GitHub Blog","description":"This is the second post in our series about Ubuntu's crash reporting system. We'll review CVE-2019-7307, a TOCTOU vulnerability that enables a local attacker to include the contents of any file on the system in a crash report.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/","og_locale":"en_US","og_type":"article","og_title":"Ubuntu apport TOCTOU security vulnerability (CVE-2019-7307)","og_description":"This is the second post in our series about Ubuntu's crash reporting system. We'll review CVE-2019-7307, a TOCTOU vulnerability that enables a local attacker to include the contents of any file on the system in a crash report.","og_url":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/","og_site_name":"The GitHub Blog","article_published_time":"2019-12-17T17:19:46+00:00","article_modified_time":"2024-10-15T15:13:29+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/github.blog\/wp-content\/uploads\/2024\/09\/Security-LightMode-2.png","type":"image\/png"}],"author":"Kevin Backhouse","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kevin Backhouse","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/#article","isPartOf":{"@id":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/"},"author":{"name":"Kevin Backhouse","@id":"https:\/\/github.blog\/#\/schema\/person\/92f78909ac8106949ccaf6878d3d33d8"},"headline":"Ubuntu apport TOCTOU security vulnerability (CVE-2019-7307)","datePublished":"2019-12-17T17:19:46+00:00","dateModified":"2024-10-15T15:13:29+00:00","mainEntityOfPage":{"@id":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/"},"wordCount":2181,"image":{"@id":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/#primaryimage"},"thumbnailUrl":"https:\/\/github.blog\/wp-content\/uploads\/2024\/09\/Security-LightMode-2.png?fit=1200%2C630","keywords":["GitHub Security Lab","ubuntu","vulnerability research"],"articleSection":["Security","Vulnerability research"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/","url":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/","name":"Ubuntu apport TOCTOU security vulnerability (CVE-2019-7307) - The GitHub Blog","isPartOf":{"@id":"https:\/\/github.blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/#primaryimage"},"image":{"@id":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/#primaryimage"},"thumbnailUrl":"https:\/\/github.blog\/wp-content\/uploads\/2024\/09\/Security-LightMode-2.png?fit=1200%2C630","datePublished":"2019-12-17T17:19:46+00:00","dateModified":"2024-10-15T15:13:29+00:00","author":{"@id":"https:\/\/github.blog\/#\/schema\/person\/92f78909ac8106949ccaf6878d3d33d8"},"description":"This is the second post in our series about Ubuntu's crash reporting system. We'll review CVE-2019-7307, a TOCTOU vulnerability that enables a local attacker to include the contents of any file on the system in a crash report.","breadcrumb":{"@id":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/#primaryimage","url":"https:\/\/github.blog\/wp-content\/uploads\/2024\/09\/Security-LightMode-2.png?fit=1200%2C630","contentUrl":"https:\/\/github.blog\/wp-content\/uploads\/2024\/09\/Security-LightMode-2.png?fit=1200%2C630","width":1200,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/github.blog\/security\/vulnerability-research\/ubuntu-apport-toctou-security-vulnerability-cve-2019-7307\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/github.blog\/"},{"@type":"ListItem","position":2,"name":"Security","item":"https:\/\/github.blog\/security\/"},{"@type":"ListItem","position":3,"name":"Vulnerability research","item":"https:\/\/github.blog\/security\/vulnerability-research\/"},{"@type":"ListItem","position":4,"name":"Ubuntu apport TOCTOU security vulnerability (CVE-2019-7307)"}]},{"@type":"WebSite","@id":"https:\/\/github.blog\/#website","url":"https:\/\/github.blog\/","name":"The GitHub Blog","description":"Updates, ideas, and inspiration from GitHub to help developers build and design software.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/github.blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/github.blog\/#\/schema\/person\/92f78909ac8106949ccaf6878d3d33d8","name":"Kevin Backhouse","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/37eef09dcba369292c199dca0f43db83ef312cd5956f7f5e1932893acabe55f6?s=96&d=mm&r=g3867af48b7150cd8900167c0a2e02002","url":"https:\/\/secure.gravatar.com\/avatar\/37eef09dcba369292c199dca0f43db83ef312cd5956f7f5e1932893acabe55f6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/37eef09dcba369292c199dca0f43db83ef312cd5956f7f5e1932893acabe55f6?s=96&d=mm&r=g","caption":"Kevin Backhouse"},"description":"I'm a security researcher on the GitHub Security Lab team. I try to help make open source software more secure by searching for vulnerabilities and working with maintainers to get them fixed.","url":"https:\/\/github.blog\/author\/kevinbackhouse\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/github.blog\/wp-content\/uploads\/2024\/09\/Security-LightMode-2.png?fit=1200%2C630","jetpack_shortlink":"https:\/\/wp.me\/pamS32-kPJ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts\/80087","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/users\/1905"}],"replies":[{"embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/comments?post=80087"}],"version-history":[{"count":11,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts\/80087\/revisions"}],"predecessor-version":[{"id":80410,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts\/80087\/revisions\/80410"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/media\/80088"}],"wp:attachment":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/media?parent=80087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/categories?post=80087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/tags?post=80087"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/coauthors?post=80087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}