<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Use After Free Vulnerability lldb_private::Debugger"
   href="https://llvm.org/bugs/show_bug.cgi?id=25742">25742</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Use After Free Vulnerability lldb_private::Debugger
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ichaithu@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=15398" name="attach_15398" title="Proof-of-Concept for the crash">attachment 15398</a> <a href="attachment.cgi?id=15398&action=edit" title="Proof-of-Concept for the crash">[details]</a></span>
Proof-of-Concept for the crash

A use after free vulnerability exists in com.apple.LLDB.framework on Apple Mac
OS X 10.11.1 in LLDB version 340.4.110.1, that on exploitation, would allow an
attacker to execute arbitrary code with the privileges of the user. 

Steps to reproduce:

~/D/A/t/lldbPython ❯❯❯ lldb
(lldb)script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
<span class="quote">>>> import lldb
>>> s=lldb.SBDebugger.Create()
>>> s.__swig_destroy__(s)
>>> print s</span >


Backtrace of the crash:

0   com.apple.LLDB.framework          0x0000000105c0ae0a
lldb::SBDebugger::GetDescription(lldb::SBStream&) + 28
1   com.apple.LLDB.framework          0x0000000105c5be4c
_wrap_SBDebugger___str__(_object*, _object*) + 128
2   org.python.python                 0x0000000108ea0a0b PyEval_EvalFrameEx +
13400
3   org.python.python                 0x0000000108e9d3c1 PyEval_EvalCodeEx +
1583
4   org.python.python                 0x0000000108e422e5 0x108e1a000 + 164581
5   org.python.python                 0x0000000108e24202 PyObject_Call + 99
6   org.python.python                 0x0000000108e2eff5 0x108e1a000 + 86005
7   org.python.python                 0x0000000108e24202 PyObject_Call + 99
8   org.python.python                 0x0000000108ea2e83
PyEval_CallObjectWithKeywords + 165
9   org.python.python                 0x0000000108e6aa8f 0x108e1a000 + 330383
10  org.python.python                 0x0000000108e53e17 _PyObject_Str + 127
11  org.python.python                 0x0000000108e53eb0 PyObject_Str + 12
12  org.python.python                 0x0000000108e53b70 0x108e1a000 + 236400
13  org.python.python                 0x0000000108e3afb3 PyFile_WriteObject +
338
14  org.python.python                 0x0000000108e9fb01 PyEval_EvalFrameEx +
9550
15  org.python.python                 0x0000000108e9d3c1 PyEval_EvalCodeEx +
1583
16  org.python.python                 0x0000000108ea143e PyEval_EvalFrameEx +
16011
17  org.python.python                 0x0000000108e9d3c1 PyEval_EvalCodeEx +
1583
18  org.python.python                 0x0000000108ea34ae 0x108e1a000 + 562350
19  org.python.python                 0x0000000108ea030c PyEval_EvalFrameEx +
11609
20  org.python.python                 0x0000000108e9d3c1 PyEval_EvalCodeEx +
1583
21  org.python.python                 0x0000000108ea34ae 0x108e1a000 + 562350
22  org.python.python                 0x0000000108ea030c PyEval_EvalFrameEx +
11609
23  org.python.python                 0x0000000108ea3541 0x108e1a000 + 562497
24  org.python.python                 0x0000000108ea030c PyEval_EvalFrameEx +
11609
25  org.python.python                 0x0000000108e9d3c1 PyEval_EvalCodeEx +
1583
26  org.python.python                 0x0000000108ea34ae 0x108e1a000 + 562350
27  org.python.python                 0x0000000108ea030c PyEval_EvalFrameEx +
11609
28  org.python.python                 0x0000000108e9d3c1 PyEval_EvalCodeEx +
1583
29  org.python.python                 0x0000000108ea34ae 0x108e1a000 + 562350
30  org.python.python                 0x0000000108ea030c PyEval_EvalFrameEx +
11609
31  org.python.python                 0x0000000108ea3541 0x108e1a000 + 562497
32  org.python.python                 0x0000000108ea030c PyEval_EvalFrameEx +
11609
33  org.python.python                 0x0000000108e9d3c1 PyEval_EvalCodeEx +
1583
34  org.python.python                 0x0000000108e9cd8c PyEval_EvalCode + 54
35  org.python.python                 0x0000000108ebca42 0x108e1a000 + 666178
36  org.python.python                 0x0000000108ebcbff PyRun_StringFlags +
109
37  org.python.python                 0x0000000108ebcb53
PyRun_SimpleStringFlags + 69
38  com.apple.LLDB.framework          0x00000001079e1cef
IOHandlerPythonInterpreter::Run() + 245
39  com.apple.LLDB.framework          0x00000001078e7b43
lldb_private::Debugger::ExecuteIOHandlers() + 63
40  com.apple.LLDB.framework          0x00000001079c89cc
lldb_private::CommandInterpreter::RunCommandInterpreter(bool, bool,
lldb_private::CommandInterpreterRunOptions&) + 126
41  com.apple.LLDB.framework          0x0000000105c0ca80
lldb::SBDebugger::RunCommandInterpreter(bool, bool) + 68
42  lldb                              0x0000000105bdc05f Driver::MainLoop() +
2347
43  lldb                              0x0000000105bdc594 main + 268
44  libdyld.dylib                     0x00007fff9654e5ad start + 1

Please find the Proof-of-Concept attached as a python file.
Usage:
     ~/D/A/t/lldbPython ❯❯❯ python poc.py</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>