libuv/test
Ben Noordhuis b7466e31e4 idna: fix OOB read in punycode decoder
libuv was vulnerable to out-of-bounds reads in the uv__idna_toascii()
function which is used to convert strings to ASCII. This is called by
the DNS resolution function and can lead to information disclosures or
crashes.

Reported by Eric Sesterhenn in collaboration with Cure53 and ExpressVPN.

Reported-By: Eric Sesterhenn <eric.sesterhenn@x41-dsec.de>
Fixes: https://github.com/libuv/libuv/issues/3147
PR-URL: https://github.com/libuv/libuv-private/pull/1
Refs: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22918
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2021-07-02 14:07:07 -04:00
..
fixtures unix: make uv_fs_read() fill all buffers 2019-06-20 12:06:31 +02:00
benchmark-async-pummel.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
benchmark-async.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
benchmark-fs-stat.c unix,windows: allow NULL loop for sync fs requests 2015-08-18 15:39:21 +02:00
benchmark-getaddrinfo.c test: remove LOG and LOGF variadic macros 2015-04-12 18:44:34 +02:00
benchmark-list.h test: added udp ping benchmark (1,10,100 pingers) 2020-02-20 11:52:18 +01:00
benchmark-loop-count.c test: remove LOG and LOGF variadic macros 2015-04-12 18:44:34 +02:00
benchmark-million-async.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
benchmark-million-timers.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
benchmark-multi-accept.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
benchmark-ping-pongs.c test: remove LOG and LOGF variadic macros 2015-04-12 18:44:34 +02:00
benchmark-ping-udp.c test: added udp ping benchmark (1,10,100 pingers) 2020-02-20 11:52:18 +01:00
benchmark-pound.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
benchmark-pump.c test: fix pump and tcp_write_batch benchmarks 2020-10-31 16:42:49 +01:00
benchmark-sizes.c test: remove LOG and LOGF variadic macros 2015-04-12 18:44:34 +02:00
benchmark-spawn.c test: remove LOG and LOGF variadic macros 2015-04-12 18:44:34 +02:00
benchmark-tcp-write-batch.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
benchmark-thread.c Make the thread_create benchmark not time out 2012-03-09 17:53:48 +01:00
benchmark-udp-pummel.c test: remove string + int warning on udp-pummel 2021-04-04 17:16:44 +02:00
blackhole-server.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
dns-server.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
echo-server.c Re-merge "unix,stream: clear read/write states on close/eof" 2021-05-21 16:20:07 -04:00
run-benchmarks.c benchmark: remove unreachable code 2021-04-04 17:47:37 +02:00
run-tests.c chore: use for(;;) instead of while 2021-04-04 17:15:35 +02:00
runner-unix.c test: wrong pointer arithmetic multiplier 2021-06-30 23:24:35 -04:00
runner-unix.h Add copyright headers, license file. 2011-04-18 11:11:30 -07:00
runner-win.c test: simplify platform_init() 2020-03-27 23:51:32 +01:00
runner-win.h warnings: fix code that emits compiler warnings 2018-11-29 11:21:44 -05:00
runner.c test: log to stdout to conform TAP spec 2021-05-12 18:45:47 -04:00
runner.h test: simplify platform_init() 2020-03-27 23:51:32 +01:00
task.h test: fix test-udp-send-unreachable 2021-02-17 10:30:13 +01:00
test-active.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-async-null-cb.c sunos: fix cmpxchgi and cmpxchgl type error 2017-07-01 00:24:42 +02:00
test-async.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-barrier.c test: add uv_barrier_wait serial thread test 2018-10-08 11:14:41 +02:00
test-callback-order.c unix, windows: removed unused status parameter 2014-03-17 21:42:36 +01:00
test-callback-stack.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-close-fd.c stream: add uv_pipe and uv_socketpair to the API 2020-11-09 21:50:09 -05:00
test-close-order.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-condvar.c warnings: fix code that emits compiler warnings 2018-11-29 11:21:44 -05:00
test-connect-unspecified.c test: fix connect_unspecified 2018-03-08 11:37:00 +01:00
test-connection-fail.c build: test on more platforms via QEMU in CI 2020-05-17 10:03:20 -04:00
test-cwd-and-chdir.c test: canonicalize argv[0] in exepath test 2020-03-27 23:51:22 +01:00
test-default-loop-close.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-delayed-accept.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-dlerror.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-eintr-handling.c Revert "unix,fs: fix for potential partial reads/writes" 2018-01-19 17:51:08 +01:00
test-embed.c build: GNU/kFreeBSD support 2016-08-20 08:55:30 +02:00
test-emfile.c warnings: fix code that emits compiler warnings 2018-11-29 11:21:44 -05:00
test-env-vars.c win: support environment variables > 32767 chars 2020-04-28 20:11:12 +02:00
test-error.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-fail-always.c Benchmark runner 2011-04-19 04:47:21 +02:00
test-fork.c warnings: fix code that emits compiler warnings 2018-11-29 11:21:44 -05:00
test-fs-copyfile.c build: add asan checks 2020-10-21 14:52:58 +02:00
test-fs-event.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-fs-fd-hash.c win: add UV_FS_O_FILEMAP 2019-07-16 18:20:10 +02:00
test-fs-open-flags.c Revert "win,fs: correct error code in uv_fs_read and uv_fs_write" 2021-06-21 16:03:22 -04:00
test-fs-poll.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-fs-readdir.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-fs.c zos: don't use nanosecond timestamp fields 2021-02-15 17:18:09 +00:00
test-get-currentexe.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-get-loadavg.c test: fix -Wtautological-pointer-compare warnings 2015-11-18 22:37:16 +01:00
test-get-memory.c ibmi: set the amount of memory in use to zero 2020-03-10 11:00:03 +01:00
test-get-passwd.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-getaddrinfo.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-gethostname.c test: pass test when hostname is single character 2020-04-06 12:57:32 +02:00
test-getnameinfo.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-getsockname.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-getters-setters.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-gettimeofday.c unix,win: introduce uv_timeval64_t 2019-04-11 14:08:17 -04:00
test-handle-fileno.c stream: autodetect direction 2018-09-19 18:19:28 +02:00
test-homedir.c test: canonicalize argv[0] in exepath test 2020-03-27 23:51:22 +01:00
test-hrtime.c test: relax uv_hrtime() test assumptions 2019-02-21 13:02:44 +01:00
test-idle.c test: remove LOG and LOGF variadic macros 2015-04-12 18:44:34 +02:00
test-idna.c idna: fix OOB read in punycode decoder 2021-07-02 14:07:07 -04:00
test-ip4-addr.c unix: set sin_len and sin6_len 2019-10-04 23:58:18 +02:00
test-ip6-addr.c unix: set sin_len and sin6_len 2019-10-04 23:58:18 +02:00
test-ipc-heavy-traffic-deadlock-bug.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-ipc-send-recv.c unix: don't send handle twice on partial write 2018-12-30 20:13:48 +01:00
test-ipc.c win,tcp: make uv_close work more like unix 2021-06-10 13:12:07 -04:00
test-list.h idna: fix OOB read in punycode decoder 2021-07-02 14:07:07 -04:00
test-loop-alive.c unix, windows: removed unused status parameter 2014-03-17 21:42:36 +01:00
test-loop-close.c test: add threadpool init/teardown test 2017-12-06 23:47:38 +01:00
test-loop-configure.c linux: fix epoll_pwait() sigmask size calculation 2014-12-25 14:37:02 +01:00
test-loop-handles.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-loop-stop.c unix, windows: removed unused status parameter 2014-03-17 21:42:36 +01:00
test-loop-time.c windows: add uv_backend_timeout 2014-08-04 23:18:38 +02:00
test-metrics.c nfci: address some style nits 2020-08-21 17:25:42 -04:00
test-multiple-listen.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-mutexes.c unix,win: add uv_mutex_init_recursive() 2017-10-02 10:01:09 -04:00
test-not-readable-nor-writable-on-read-error.c Re-merge "unix,stream: clear read/write states on close/eof" 2021-05-21 16:20:07 -04:00
test-not-readable-on-eof.c Re-merge "unix,stream: clear read/write states on close/eof" 2021-05-21 16:20:07 -04:00
test-not-writable-after-shutdown.c Re-merge "unix,stream: clear read/write states on close/eof" 2021-05-21 16:20:07 -04:00
test-osx-select.c test: remove LOG and LOGF variadic macros 2015-04-12 18:44:34 +02:00
test-pass-always.c Benchmark runner 2011-04-19 04:47:21 +02:00
test-ping-pong.c stream: add uv_pipe and uv_socketpair to the API 2020-11-09 21:50:09 -05:00
test-pipe-bind-error.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-pipe-close-stdout-read-stdin.c warnings: fix code that emits compiler warnings 2018-11-29 11:21:44 -05:00
test-pipe-connect-error.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-pipe-connect-multiple.c test: skip self-connecting tests on cygwin 2017-05-21 16:12:30 +02:00
test-pipe-connect-prepare.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-pipe-getsockname.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-pipe-pending-instances.c win: fix setting pipe pending instances after bind 2015-08-24 23:20:35 +02:00
test-pipe-sendmsg.c cygwin: disable non-functional ipc handle send 2017-05-21 16:12:28 +02:00
test-pipe-server-close.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-pipe-set-fchmod.c src,test: fix idiosyncratic comment style 2018-05-29 11:56:49 -07:00
test-pipe-set-non-blocking.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-platform-output.c build: add asan checks 2020-10-21 14:52:58 +02:00
test-poll-close-doesnt-corrupt-stack.c test: fix -fno-common build errors 2020-01-10 11:09:04 -05:00
test-poll-close.c code style: strip trailing whitespace 2013-12-20 19:38:37 -08:00
test-poll-closesocket.c test: fix -fno-common build errors 2020-01-10 11:09:04 -05:00
test-poll-multiple-handles.c test: fix 'incompatible pointer types' warnings 2021-01-16 15:07:57 -05:00
test-poll-oob.c warnings: fix code that emits compiler warnings 2018-11-29 11:21:44 -05:00
test-poll.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-process-priority.c test: handle uv_os_setpriority() windows edge case 2018-09-25 20:56:37 -04:00
test-process-title-threadsafe.c test: fix thread race in process_title_threadsafe 2020-08-06 10:18:29 +02:00
test-process-title.c unix: fix size check in uv_get_process_title() 2020-02-08 12:28:34 +01:00
test-queue-foreach-delete.c test: fix gcc 8 warnings for tests 2019-08-06 12:01:15 -04:00
test-random.c unix,win: add uv_random() 2019-09-18 08:09:14 +02:00
test-ref.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-run-nowait.c unix, windows: removed unused status parameter 2014-03-17 21:42:36 +01:00
test-run-once.c unix, windows: removed unused status parameter 2014-03-17 21:42:36 +01:00
test-semaphore.c unix, windows: return error codes directly 2013-07-07 09:51:00 +02:00
test-shutdown-close.c unix, windows: make uv_is_*() always return 0 or 1 2013-09-12 13:30:06 +02:00
test-shutdown-eof.c unix,win: more uv_read_start() argument validation 2020-11-05 16:41:44 -05:00
test-shutdown-twice.c unix,test: deadstore fixes 2017-04-05 09:57:20 -04:00
test-signal-multiple-loops.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-signal-pending-on-close.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-signal.c win, process: uv_kill improvements 2017-12-07 14:00:05 +01:00
test-socket-buffer-size.c unix, windows: add uv_recv_buffer_size and uv_send_buffer_size 2014-08-09 11:36:35 +02:00
test-spawn.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-stdio-over-pipes.c win,pipe: ensure req->event_handle is defined 2020-02-27 09:12:52 +01:00
test-strscpy.c unix: harden string copying, introduce strscpy() 2018-12-04 17:08:09 +01:00
test-tcp-alloc-cb-fail.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-tcp-bind6-error.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-tcp-bind-error.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-tcp-close-accept.c warnings: fix code that emits compiler warnings 2018-11-29 11:21:44 -05:00
test-tcp-close-reset.c test: fix -Wsign-compare warning 2019-09-06 22:48:06 +02:00
test-tcp-close-while-connecting.c test: fix tcp_close_while_connecting CI failures 2016-10-14 01:57:15 +02:00
test-tcp-close.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-tcp-connect6-error.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-tcp-connect-error-after-write.c include: merge uv_tcp_connect and uv_tcp_connect6 2013-09-04 03:16:36 +02:00
test-tcp-connect-error.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-tcp-connect-timeout.c test: fix some warnings 2020-12-29 11:51:08 +01:00
test-tcp-create-socket-early.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-tcp-flags.c unix, windows: rename uv_run2 to uv_run 2013-01-16 23:35:29 +01:00
test-tcp-oob.c warnings: fix code that emits compiler warnings 2018-11-29 11:21:44 -05:00
test-tcp-open.c test: fix stack-use-after-scope 2021-04-04 17:29:54 +02:00
test-tcp-read-stop-start.c win,tcp: avoid reinserting a pending request (#2688) 2020-07-28 13:59:08 -04:00
test-tcp-read-stop.c unix, windows: removed unused status parameter 2014-03-17 21:42:36 +01:00
test-tcp-shutdown-after-write.c unix, windows: removed unused status parameter 2014-03-17 21:42:36 +01:00
test-tcp-try-write-error.c test: allow UV_ECONNRESET in tcp_try_write_error 2019-06-27 17:23:53 -04:00
test-tcp-try-write.c stream: support empty uv_try_write on unix 2015-10-04 18:06:08 -04:00
test-tcp-unexpected-read.c unix, windows: removed unused status parameter 2014-03-17 21:42:36 +01:00
test-tcp-write-after-connect.c build: test on more platforms via QEMU in CI 2020-05-17 10:03:20 -04:00
test-tcp-write-fail.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-tcp-write-queue-order.c test: increase connection timeout to 1 second 2018-03-31 17:05:26 -04:00
test-tcp-write-to-half-open-connection.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-tcp-writealot.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-test-macros.c test: avoid double evaluation in ASSERT_BASE macro 2020-08-12 13:13:02 -04:00
test-thread-equal.c unix, windows: add uv_thread_equal 2014-10-20 09:51:49 +02:00
test-thread.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-threadpool-cancel.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-threadpool.c unix, windows: return error codes directly 2013-07-07 09:51:00 +02:00
test-timer-again.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-timer-from-check.c unix, windows: removed unused status parameter 2014-03-17 21:42:36 +01:00
test-timer.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-tmpdir.c test: canonicalize argv[0] in exepath test 2020-03-27 23:51:22 +01:00
test-tty-duplicate-key.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-tty-escape-sequence-processing.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-tty.c build: add asan checks 2020-10-21 14:52:58 +02:00
test-udp-alloc-cb-fail.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-udp-bind.c unix, windows: do not set SO_REUSEADDR by default on udp 2014-04-02 01:21:35 +02:00
test-udp-connect.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-udp-create-socket-early.c cygwin: implement support for cygwin and msys2 2017-05-21 16:12:21 +02:00
test-udp-dgram-too-big.c include: merge uv_udp_send and uv_udp_send6 2013-09-04 03:17:29 +02:00
test-udp-ipv6.c test,udp6: fix udp_ipv6 test flakiness 2020-01-27 14:58:56 -05:00
test-udp-mmsg.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-udp-multicast-interface6.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-udp-multicast-interface.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-udp-multicast-join6.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-udp-multicast-join.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-udp-multicast-ttl.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-udp-open.c test: fix stack-use-after-scope 2021-04-04 17:29:54 +02:00
test-udp-options.c build: test on more platforms via QEMU in CI 2020-05-17 10:03:20 -04:00
test-udp-send-and-recv.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-udp-send-hang-loop.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-udp-send-immediate.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-udp-send-unreachable.c test: fix test-udp-send-unreachable 2021-02-17 10:30:13 +01:00
test-udp-sendmmsg-error.c udp: fix write_queue cleanup on sendmmsg error 2020-07-02 21:29:42 +02:00
test-udp-try-send.c test: move to ASSERT_NULL and ASSERT_NOT_NULL test macros 2021-02-14 10:05:46 +01:00
test-uname.c unix,win: add uv_os_uname() 2019-01-14 10:47:20 -05:00
test-walk-handles.c unix, windows: removed unused status parameter 2014-03-17 21:42:36 +01:00
test-watcher-cross-stop.c test: skip some UDP tests on IBMi 2020-02-28 11:51:36 +01:00