Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null pointer dereference issue in function ub_ctx_set_fwd of file libunbound/libunbound.c #1072

Closed
xiaoxiaoafeifei opened this issue May 21, 2024 · 0 comments · Fixed by #1073

Comments

@xiaoxiaoafeifei
Copy link
Contributor

xiaoxiaoafeifei commented May 21, 2024

Describe the bug
Hi, I found a null pointer dereference issue in function ub_ctx_set_fwd of file libunbound/libunbound.c

To reproduce
Steps to reproduce the behavior:

  1. export CFLAGS="-g -O0 -fsanitize=address,undefined"
    export CC=afl-clang-fast
    ./configure
    make && make install
  2. /usr/local/sbin/unbound-host -C poc_file -r test
    poc_file:
    poc_file.zip

Evidence
==1980801==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x55d39d62f8c0 bp 0x7ffeefa39db0 sp 0x7ffeefa39550 T0)
==1980801==The signal is caused by a READ memory access.
==1980801==Hint: address points to the zero page.
#0 0x55d39d62f8c0 in __interceptor_strcmp (/usr/local/sbin/unbound-host+0x718c0) (BuildId: dfa431122871d2dc572574bc91716352a41072a7)
#1 0x7f1406a5d379 in ub_ctx_set_fwd /root/fuzz/fuzz_unbound/unbound_1/libunbound/libunbound.c:1004:3
#2 0x7f1406a65010 in ub_ctx_resolvconf /root/fuzz/fuzz_unbound/unbound_1/libunbound/libunbound.c:1205:12
#3 0x55d39d6ed5a6 in main /root/fuzz/fuzz_unbound/unbound/smallapp/unbound-host.c:465:17
#4 0x7f1405ea1d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#5 0x7f1405ea1e3f in __libc_start_main csu/../csu/libc-start.c:392:3
#6 0x55d39d6186e4 in _start (/usr/local/sbin/unbound-host+0x5a6e4) (BuildId: dfa431122871d2dc572574bc91716352a41072a7)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/usr/local/sbin/unbound-host+0x718c0) (BuildId: dfa431122871d2dc572574bc91716352a41072a7) in __interceptor_strcmp
==1980801==ABORTING

System:
Unbound version: 1.20.0
OS: Ubuntu 22.04.3 LTS

@xiaoxiaoafeifei xiaoxiaoafeifei changed the title a null pointer dereference issue in function ub_ctx_set_fwd of file libunbound/libunbound.c Null pointer dereference issue in function ub_ctx_set_fwd of file libunbound/libunbound.c May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant