Skip to content

Commit

Permalink
Fuzzing bozohttpd: found a non-ascii bug input
Browse files Browse the repository at this point in the history
  • Loading branch information
plusun committed Aug 4, 2018
1 parent 2d883e0 commit 492f1d7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/fuzz/bozohttpd/bozohttpd/bug/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# $NetBSD: Makefile,v 1.15 2007/05/28 12:06:25 tls Exp $
# @(#)Makefile 8.2 (Berkeley) 4/2/94

.include <bsd.own.mk>

PROG= main
.PATH: ../
SRCS= fuzz_bozohttpd.c mock-ssl-bozo.c
.PATH: ../../../
SRCS+= main.c
.PATH: ${NETBSDSRCDIR}/libexec/httpd
SRCS+= bozohttpd.c daemon-bozo.c dir-index-bozo.c content-bozo.c tilde-luzah-bozo.c cgi-bozo.c lua-bozo.c

CFLAGS= -fsanitize=address,undefined -Wall -Werror -I${NETBSDSRCDIR}/libexec/httpd -g #-Dbozowarn=mock_bozowarn
LDFLAGS= -fsanitize=address,undefined -Wall -Werror -lssl -llua -g

.include <bsd.prog.mk>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
got request ``POST - HTtP/1 ) -. '' from host <local> to port <stdin>
/public/src/libexec/httpd/bozohttpd.c:708:11: runtime error: load of null pointer of type 'char'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /public/src/libexec/httpd/bozohttpd.c:708:11 in
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2137==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000002544e4 bp 0x7f7fffffe2b0 sp 0x7f7fffffcea0 T0)
==2137==The signal is caused by a READ memory access.
==2137==Hint: address points to the zero page.
#0 0x2544e3 in bozo_read_request /public/src/libexec/httpd/bozohttpd.c:708:11
#1 0x24d3aa in LLVMFuzzerTestOneInput /public/src/tests/fuzz/bozohttpd/bozohttpd/bug/../fuzz_bozohttpd.c:18:24
#2 0x24dba6 in main /public/src/tests/fuzz/bozohttpd/bozohttpd/bug/../../../main.c:24:12
#3 0x24d070 in ___start (/public/src/tests/fuzz/bozohttpd/bozohttpd/bug/./main+0x4d070)
#4 0x7f7ff7c01c7f (/libexec/ld.elf_so+0x1c7f)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /public/src/libexec/httpd/bozohttpd.c:708:11 in bozo_read_request
==2137==ABORTING

0 comments on commit 492f1d7

Please sign in to comment.