Dig crashes with SIGABRT when parsing invalid DoH endpoint location
Summary
Dig crashes with SIGABRT when providing an invalid DoH endpoint location.
BIND version used
DiG 9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu (Bind9-Dev Branch) Tested on Ubuntu 20 & Fedora 34.
Steps to reproduce
Call dig with a DoH URI and manually specify the DoH Endpoint location without a leading "/":
dig +https=doh/family-filter @doh.cleanbrowsing.org rub.de
The correct command would be: dig +https=/doh/family-filter @doh.cleanbrowsing.org rub.de
What is the current bug behavior?
Dig crashed with SIGABRT in isc_assertion_failed()
What is the expected correct behavior?
Dig outputs an error message to tell the user that the endpoint location is invalid.
Relevant logs and/or screenshots
dig +https=doh/family-filter @doh.cleanbrowsing.org google.de#
netmgr/http.c:3098: REQUIRE(isc_nm_http_path_isvalid(abs_path)) failed, back trace
/lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so(+0x31d93)[0x7f3798d69d93]
/lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so(isc_assertion_failed+0x10)[0x7f3798d69cd0]
/lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so(isc_nm_http_makeuri+0x2aa)[0x7f3798da924a]
dig(+0x13ff7)[0x558504aa0ff7]
dig(+0x1721a)[0x558504aa421a]
/lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so(isc_task_run+0x162)[0x7f3798d99572]
/lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so(+0x19ead)[0x7f3798d51ead]
/lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so(+0x204f1)[0x7f3798d584f1]
/lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so(+0x20c15)[0x7f3798d58c15]
/lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so(+0x213e7)[0x7f3798d593e7]
/lib/x86_64-linux-gnu/libuv.so.1(+0xfea8)[0x7f379885eea8]
/lib/x86_64-linux-gnu/libuv.so.1(uv__io_poll+0x360)[0x7f379886fb80]
/lib/x86_64-linux-gnu/libuv.so.1(uv_run+0x11c)[0x7f379885f84c]
/lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so(+0x20ca7)[0x7f3798d58ca7]
/lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so(isc__trampoline_run+0x1a)[0x7f3798da08ba]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x9609)[0x7f3798a7b609]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43)[0x7f37989a2293]
Aborted (core dumped)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `dig +https doh/family-filter @doh.cleanbrowsing.org rub.de'.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7f2629900700 (LWP 52138))]
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f262c3de859 in __GI_abort () at abort.c:79
#2 0x00007f262c8a2cd5 in isc_assertion_failed () from /lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so
#3 0x00007f262c8e224a in isc_nm_http_makeuri () from /lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so
#4 0x0000564d70879ff7 in ?? ()
#5 0x0000564d7087d21a in ?? ()
#6 0x00007f262c8d2572 in isc_task_run () from /lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so
#7 0x00007f262c88aead in ?? () from /lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so
#8 0x00007f262c8914f1 in ?? () from /lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so
#9 0x00007f262c891c15 in ?? () from /lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so
#10 0x00007f262c8923e7 in ?? () from /lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so
#11 0x00007f262c397ea8 in ?? () from /lib/x86_64-linux-gnu/libuv.so.1
#12 0x00007f262c3a8b80 in uv.io_poll () from /lib/x86_64-linux-gnu/libuv.so.1
#13 0x00007f262c39884c in uv_run () from /lib/x86_64-linux-gnu/libuv.so.1
#14 0x00007f262c891ca7 in ?? () from /lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so
#15 0x00007f262c8d98ba in isc.trampoline_run () from /lib/x86_64-linux-gnu/libisc-9.17.18-1+ubuntu20.04.1+isc+1-Ubuntu.so
#16 0x00007f262c5b4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#17 0x00007f262c4db293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95