After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 795740 - (CVE-2018-11396) Crashes at libephymain.so (0x7fff8ea7f700)
(CVE-2018-11396)
Crashes at libephymain.so (0x7fff8ea7f700)
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
3.28.x
Other Linux
: High critical
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-05-02 07:57 UTC by Dhiraj
Modified: 2018-06-08 14:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proof of concept (239 bytes, text/html)
2018-05-02 08:15 UTC, Dhiraj
  Details
Stack trace (15.64 KB, text/plain)
2018-05-02 09:21 UTC, Dhiraj
  Details
session: Fix crash when JS opens an invalid URI (1.07 KB, patch)
2018-05-23 02:10 UTC, Michael Catanzaro
committed Details | Review

Description Dhiraj 2018-05-02 07:57:22 UTC
Hi Team, 

While running bulk testcases(fuzzing) on epiphany Web 3.28.1 on Linux 4.15.0-20-generic.

The browser crashes, however running the testcase and browser on debug mode generate this error, below are the stack-trace for your reference.

Thread 15 "pool" received signal SIGSEGV, Segmentation fault.

Thread 140735586760448 (LWP 3827)

  • #0 ??
    from /usr/lib/x86_64-linux-gnu/epiphany-browser/libephymain.so
  • #1 ??
    from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
  • #2 ??
    from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #3 ??
    from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #4 start_thread
    at pthread_create.c line 463
  • #5 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 95

Request team to please look into this.


PS: @magicmac2000 // This testcase is written by him.
Comment 1 Dhiraj 2018-05-02 08:15:31 UTC
Created attachment 371595 [details]
Proof of concept
Comment 2 André Klapper 2018-05-02 08:32:11 UTC
Thanks for taking the time to report this.
Unfortunately, that stack trace misses some elements that will help a lot to solve the problem, so it will be hard for the developers to fix that crash. Can you get us a full stack trace that includes debugging symbols? Please see https://wiki.gnome.org/Community/GettingInTouch/Bugzilla/GettingTraces for more information on how to do so and reopen this bug report. Thanks in advance!

And how to run the "Proof of concept"? It refers to files like "sleep_one_second.php" that we do not have. This task welcomes steps to reproduce.
Comment 3 Dhiraj 2018-05-02 09:21:01 UTC
Thank you for looking into this. I was performing a blind fuzz so didn't look at the PoC which creates this crash. However,  I had a look on testcase for now where and have minimize it as well.

Steps to reproduce:
1. Open crash.html in Epiphany
2. It crashes

crash.html

<script>
win = window.open("blah", "WIN");
</script>

Below is the stack trace for your reference.


Thread 15 "pool" received signal SIGSEGV, Segmentation fault.

Thread 140735184115456 (LWP 2714)

  • #0 ??
    from /usr/lib/x86_64-linux-gnu/epiphany-browser/libephymain.so
  • #1 ??
    from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
  • #2 ??
    from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #3 ??
    from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #4 start_thread
    at pthread_create.c line 463
  • #5 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 95


However, if the stack is still not visible, I have attached an txt file for same, hope this helps.
Request you to please have a look again.


Cheers!
Comment 4 Dhiraj 2018-05-02 09:21:50 UTC
Created attachment 371602 [details]
Stack trace

ftw@ftw-box:~$ gdb epiphany
(gdb) run
Starting program: /usr/bin/epiphany 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe08bc700 (LWP 2279)]
[New Thread 0x7fffdee51700 (LWP 2280)]
[New Thread 0x7fffde650700 (LWP 2281)]
[New Thread 0x7fffdcdd5700 (LWP 2282)]
[New Thread 0x7fffd7fff700 (LWP 2283)]
[New Thread 0x7fffd77fe700 (LWP 2284)]
[New Thread 0x7fffd6ffd700 (LWP 2285)]
[New Thread 0x7fffd67fc700 (LWP 2286)]
[New Thread 0x7fffd5b8c700 (LWP 2287)]
[New Thread 0x7fffd538b700 (LWP 2288)]
[New Thread 0x7fff8f486700 (LWP 2294)]
[New Thread 0x7fff8da1e700 (LWP 2304)]
[New Thread 0x7fff8d21d700 (LWP 2305)]
[New Thread 0x7fff8ea7f700 (LWP 2315)]
[Thread 0x7fffd5b8c700 (LWP 2287) exited]
[Thread 0x7fffd67fc700 (LWP 2286) exited]

Thread 15 "pool" received signal SIGSEGV, Segmentation fault.

Thread 140735586760448 (LWP 2315)

  • #0 ??
    from /usr/lib/x86_64-linux-gnu/epiphany-browser/libephymain.so
  • #1 ??
    from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
  • #2 ??
    from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #3 ??
    from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #4 start_thread
    at pthread_create.c line 463
  • #5 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 95

Comment 5 André Klapper 2018-05-02 09:55:12 UTC
Thanks! That stacktrace still misses any symbols but the steps to reproduce were helpful. :)

$:\> gdb epiphany
GNU gdb (GDB) Fedora 8.1-11.fc28
Reading symbols from epiphany...Reading symbols from /usr/lib/debug/usr/bin/epiphany-3.28.1.1-1.fc28.x86_64.debug...done.
done.
(gdb) run ./crash.html 
Starting program: /usr/bin/epiphany ./crash.html
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffdf364700 (LWP 30708)]
[New Thread 0x7fffd2184700 (LWP 30709)]
[New Thread 0x7fffd1983700 (LWP 30710)]
[New Thread 0x7fffd1182700 (LWP 30711)]
[New Thread 0x7fff7ecff700 (LWP 30712)]
[New Thread 0x7fff7e4fe700 (LWP 30713)]
[New Thread 0x7fff7dcfd700 (LWP 30714)]
[New Thread 0x7fff7d4fc700 (LWP 30715)]

(epiphany:30698): GLib-CRITICAL **: 11:53:37.349: g_strdelimit: assertion 'string != NULL' failed

(epiphany:30698): GLib-CRITICAL **: 11:53:37.349: g_strdelimit: assertion 'string != NULL' failed
Detaching after fork from child process 30716.
Detaching after fork from child process 30718.
[New Thread 0x7fff6ffff700 (LWP 30720)]
[New Thread 0x7fff6f5c3700 (LWP 30727)]
[New Thread 0x7fff6edc2700 (LWP 30728)]
[New Thread 0x7fff6de48700 (LWP 30740)]
[New Thread 0x7fff5bfff700 (LWP 30743)]
[New Thread 0x7fff537fe700 (LWP 30744)]
[Thread 0x7fff537fe700 (LWP 30744) exited]

Thread 13 "pool" received signal SIGSEGV, Segmentation fault.

Thread 140735037081344 (LWP 30740)

  • #0 session_seems_sane
    at ../src/ephy-session.c line 833
  • #1 save_session_sync
    at ../src/ephy-session.c line 876
  • #2 g_task_thread_pool_thread
    at gtask.c line 1331
  • #3 g_thread_pool_thread_proxy
    at gthreadpool.c line 307
  • #4 g_thread_proxy
    at gthread.c line 784
  • #5 start_thread
    at pthread_create.c line 463
  • #6 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 95

Thread 13 (Thread 0x7fff6de48700 (LWP 30740))

  • #0 session_seems_sane
    at ../src/ephy-session.c line 833
  • #1 save_session_sync
    at ../src/ephy-session.c line 876
  • #2 g_task_thread_pool_thread
    at gtask.c line 1331
  • #3 g_thread_pool_thread_proxy
    at gthreadpool.c line 307
  • #4 g_thread_proxy
    at gthread.c line 784
  • #5 start_thread
    at pthread_create.c line 463
  • #6 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 95

Thread 9 (Thread 0x7fff7d4fc700 (LWP 30715))

  • #0 syscall
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S line 38
  • #1 g_cond_wait
    at gthread-posix.c line 1402
  • #2 g_async_queue_pop_intern_unlocked
    at gasyncqueue.c line 419
  • #3 g_async_queue_pop
    at gasyncqueue.c line 453
  • #4 run_history_service_thread
    at ../lib/history/ephy-history-service.c line 479
  • #5 g_thread_proxy
    at gthread.c line 784
  • #6 start_thread
    at pthread_create.c line 463
  • #7 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 95

Thread 8 (Thread 0x7fff7dcfd700 (LWP 30714)):
../../gdb/dictionary.c:690: internal-error: void insert_symbol_hashed(dictionary*, symbol*): Assertion `SYMBOL_LANGUAGE (sym) == DICT_LANGUAGE (dict)->la_language' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

This is a bug, please report it.  For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.

../../gdb/dictionary.c:690: internal-error: void insert_symbol_hashed(dictionary*, symbol*): Assertion `SYMBOL_LANGUAGE (sym) == DICT_LANGUAGE (dict)->la_language' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
Comment 6 Michael Catanzaro 2018-05-23 02:10:26 UTC
OK, this was easy. Thanks a bunch for reporting it, and for fuzzing Epiphany!

The following fix has been pushed:
4f4eb2c session: Fix crash when JS opens an invalid URI
Comment 7 Michael Catanzaro 2018-05-23 02:10:39 UTC
Created attachment 372352 [details] [review]
session: Fix crash when JS opens an invalid URI
Comment 8 Dhiraj 2018-05-23 14:27:46 UTC
Thank you Michael, CVE-2018-11396 is been assign to this.

Cheers!
Comment 9 Michael Catanzaro 2018-05-24 02:06:35 UTC
(In reply to Dhiraj from comment #1)
> Created attachment 371595 [details]
> Proof of concept

Jeremy from Ubuntu noticed this is still crashing even with the fix applied. Problem is I fixed the PoC you posted in comment #3, but this PoC in attachment #371595 [details] is a completely different crash, in WebKitFaviconDatabase:

  • #0 WTF::StringImpl::hash() const
    at DerivedSources/ForwardingHeaders/wtf/text/StringImpl.h line 306
  • #1 WTF::StringHash::hash(WTF::String const&)
    at DerivedSources/ForwardingHeaders/wtf/text/StringHash.h line 73
  • #2 WTF::IdentityHashTranslator<WTF::HashMap<WTF::String, WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::KeyValuePairTraits, WTF::StringHash>::hash<WTF::String>(WTF::String const&)
    at DerivedSources/ForwardingHeaders/wtf/HashTable.h line 283
  • #3 WTF::HashMapTranslatorAdapter<WTF::HashMap<WTF::String, WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::KeyValuePairTraits, WTF::IdentityHashTranslator<WTF::HashMap<WTF::String, WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::KeyValuePairTraits, WTF::StringHash> >::hash<WTF::String>(WTF::String const&)
    at DerivedSources/ForwardingHeaders/wtf/HashMap.h line 212
  • #4 WTF::HashTable<WTF::String, WTF::KeyValuePair<WTF::String, WTF::String>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WTF::String, WTF::String> >, WTF::StringHash, WTF::HashMap<WTF::String, WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::KeyValuePairTraits, WTF::HashTraits<WTF::String> >::inlineLookup<WTF::HashMapTranslatorAdapter<WTF::HashMap<WTF::String, WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::KeyValuePairTraits, WTF::IdentityHashTranslator<WTF::HashMap<WTF::String, WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::KeyValuePairTraits, WTF::StringHash> >, WTF::String>(WTF::String const&)
    at DerivedSources/ForwardingHeaders/wtf/HashTable.h line 613
  • #5 WTF::HashTable<WTF::String, WTF::KeyValuePair<WTF::String, WTF::String>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WTF::String, WTF::String> >, WTF::StringHash, WTF::HashMap<WTF::String, WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::KeyValuePairTraits, WTF::HashTraits<WTF::String> >::lookup<WTF::HashMapTranslatorAdapter<WTF::HashMap<WTF::String, WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::KeyValuePairTraits, WTF::IdentityHashTranslator<WTF::HashMap<WTF::String, WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::KeyValuePairTraits, WTF::StringHash> >, WTF::String>(WTF::String const&)
    at DerivedSources/ForwardingHeaders/wtf/HashTable.h line 601
  • #6 WTF::HashMap<WTF::String, WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::get<WTF::IdentityHashTranslator<WTF::HashMap<WTF::String, WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::KeyValuePairTraits, WTF::StringHash>, WTF::String>(WTF::String const&) const
    at DerivedSources/ForwardingHeaders/wtf/HashMap.h line 307
  • #7 WTF::HashMap<WTF::String, WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::get(WTF::String const&) const
    at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/API/glib/WebKitFaviconDatabase.cpp line 195
  • #8 webkitFaviconDatabaseSetIconURLForPageURL(WebKitFaviconDatabase*, WTF::String const&, WTF::String const&)
    at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/API/glib/WebKitFaviconDatabase.cpp line 195
  • #9 webkitFaviconDatabaseSetIconForPageURL(_WebKitFaviconDatabase*, WebCore::LinkIcon const&, API::Data&, WTF::String const&)
    at /home/mcatanzaro/Projects/WebKit/Source/WebCore/platform/URL.h line 102
  • #10 webkitWebViewSetIcon(_WebKitWebView*, WebCore::LinkIcon const&, API::Data&)
    at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/WebPageProxy.h line 1017
  • #11 WTF::Function<void

Unfortunately the gdb crash makes it impossible to get a full trace, so it's hard to know for sure if this is an Epiphany bug or a WebKit bug. I'll need to investigate.
Comment 10 Jan Kratochvil 2018-05-24 06:22:25 UTC
(In reply to Michael Catanzaro from comment #9)
> Unfortunately the gdb crash makes it impossible to get a full trace,

You can try "lldb", either stock one on other distros or on Fedora:
  dnf copr enable jankratochvil/lldb; dnf install lldb-experimental

$ lldb-experimental -o run -- epiphany epiphany-crash.html 
(lldb) bt all
(lldb) thread select 8
(lldb) up/down
(lldb) frame variable
Comment 11 Michael Catanzaro 2018-05-31 20:56:28 UTC
Got a backtrace using Fedora 27:

  • #0 WTF::StringImpl::rawHash
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WTF/wtf/text/StringImpl.h line 508
  • #1 WTF::StringImpl::hasHash
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WTF/wtf/text/StringImpl.h line 514
  • #2 WTF::StringImpl::hash
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WTF/wtf/text/StringImpl.h line 525
  • #3 WTF::StringHash::hash
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WTF/wtf/text/StringHash.h line 73
  • #9 WTF::HashMap<WTF::String, WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::get
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WTF/wtf/HashMap.h line 406
  • #10 webkitFaviconDatabaseSetIconURLForPageURL
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WebKit/UIProcess/API/glib/WebKitFaviconDatabase.cpp line 193
  • #11 webkitFaviconDatabaseSetIconForPageURL
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WebKit/UIProcess/API/glib/WebKitFaviconDatabase.cpp line 318
  • #12 webkitWebViewSetIcon
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp line 1964
  • #13 WTF::Function<void
  • #14 WebKit::GenericCallback<API::Data*>::performCallbackWithReturnValue
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WebKit/UIProcess/GenericCallback.h line 108
  • #15 WebKit::WebPageProxy::dataCallback
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WebKit/UIProcess/WebPageProxy.cpp line 5083
  • #16 WebKit::WebPageProxy::finishedLoadingIcon
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WebKit/UIProcess/WebPageProxy.cpp line 6848
  • #17 IPC::callMemberFunctionImpl<WebKit::WebPageProxy, void
  • #20 WebKit::WebPageProxy::didReceiveMessage
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/x86_64-redhat-linux-gnu/DerivedSources/WebKit2/WebPageProxyMessageReceiver.cpp line 1448
  • #21 IPC::MessageReceiverMap::dispatchMessage
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WebKit/Platform/IPC/MessageReceiverMap.cpp line 123
  • #22 WebKit::ChildProcessProxy::dispatchMessage
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WebKit/UIProcess/ChildProcessProxy.cpp line 154
  • #23 WebKit::WebProcessProxy::didReceiveMessage
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WebKit/UIProcess/WebProcessProxy.cpp line 590
  • #24 IPC::Connection::dispatchMessage
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WebKit/Platform/IPC/Connection.cpp line 928
  • #25 IPC::Connection::dispatchOneMessage
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WebKit/Platform/IPC/Connection.cpp line 959
  • #26 WTF::Function<void
  • #27 WTF::RunLoop::performWork
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WTF/wtf/RunLoop.cpp line 106
  • #28 WTF::RunLoop::<lambda(gpointer)>::operator()
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WTF/wtf/glib/RunLoopGLib.cpp line 68
  • #29 WTF::RunLoop::<lambda(gpointer)>::_FUN(gpointer)
    at /usr/src/debug/webkitgtk4-2.18.0-2.fc27.x86_64/Source/WTF/wtf/glib/RunLoopGLib.cpp line 70
  • #30 g_main_dispatch
    at gmain.c line 3148
  • #31 g_main_context_dispatch
    at gmain.c line 3813
  • #32 g_main_context_iterate
    at gmain.c line 3886
  • #33 g_main_context_iteration
    at gmain.c line 3947
  • #34 g_application_run
    at gapplication.c line 2401
  • #35 main
    at ../src/ephy-main.c line 432

Comment 12 Michael Catanzaro 2018-05-31 22:03:56 UTC
(In reply to Michael Catanzaro from comment #9)
> Jeremy from Ubuntu noticed this is still crashing even with the fix applied.
> Problem is I fixed the PoC you posted in comment #3, but this PoC in
> attachment #371595 [details] is a completely different crash, in
> WebKitFaviconDatabase:

https://bugs.webkit.org/show_bug.cgi?id=186164

Weird that two similar reproducers triggered two different crashes. I guess that's a reminder for us to verify that the crash is still the same when reducing crashers.
Comment 13 Michael Catanzaro 2018-06-08 01:32:23 UTC
Note someone else filed a duplicate CVE request for this, CVE-2018-12016.
Comment 14 Dhiraj 2018-06-08 05:38:47 UTC
Yes, I have informed the requester who took DUP CVE for this,

Reference URL:
https://github.com/ldpreload/Disclosure/issues/1
Comment 15 Michael Catanzaro 2018-06-08 14:42:12 UTC
I should have mentioned that I already informed MITRE, so now we have a duplicate duplicate notification... ah well, that doesn't matter. :D

This is fixed in 3.28.3. Thanks again for fuzzing Epiphany!