Skip to content

Commit 8886d7b

Browse files
author
grajagandev
committed
Document input file for each vuln
1 parent c421581 commit 8886d7b

File tree

4 files changed

+1028
-13
lines changed

4 files changed

+1028
-13
lines changed

build-command-line

-1
This file was deleted.

fuzzgoat.c

+16-12
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,10 @@ static int new_value (json_state * state,
128128
the length of a JSON array is 0. The program attempts to use that memory
129129
block later in the program.
130130
131-
Diff - Added: free(*top);
132-
Payload - An empty JSON array: []
133-
Triggers - Use after free in json_value_free()
131+
Diff - Added: free(*top);
132+
Payload - An empty JSON array: []
133+
Input File - emptyArray
134+
Triggers - Use after free in json_value_free()
134135
******************************************************************************/
135136

136137
free(*top);
@@ -1009,9 +1010,10 @@ void json_value_free_ex (json_settings * settings, json_value * value)
10091010
value->u.object.length, causing an invalid read when attempting to free the
10101011
memory space in the if-statement above.
10111012
1012-
Diff - [--value->u.object.length] --> [value->u.object.length--]
1013-
Payload - Any valid JSON object : {"":0}
1014-
Triggers - Invalid free in the above if-statement
1013+
Diff - [--value->u.object.length] --> [value->u.object.length--]
1014+
Payload - Any valid JSON object : {"":0}
1015+
Input File - validObject
1016+
Triggers - Invalid free in the above if-statement
10151017
******************************************************************************/
10161018

10171019
value = value->u.object.values [value->u.object.length--].value;
@@ -1028,9 +1030,10 @@ void json_value_free_ex (json_settings * settings, json_value * value)
10281030
is empty. After decrementing, the program tries to call mem_free on the
10291031
pointer, which no longer references the JSON string.
10301032
1031-
Diff - Added: if (!value->u.string.length) value->u.string.ptr--;
1032-
Payload - An empty JSON string : ""
1033-
Triggers - Invalid free on decremented value->u.string.ptr
1033+
Diff - Added: if (!value->u.string.length) value->u.string.ptr--;
1034+
Payload - An empty JSON string : ""
1035+
Input File - emptyString
1036+
Triggers - Invalid free on decremented value->u.string.ptr
10341037
******************************************************************************/
10351038

10361039
if (!value->u.string.length){
@@ -1045,9 +1048,10 @@ void json_value_free_ex (json_settings * settings, json_value * value)
10451048
The code below creates and dereferences a NULL pointer if the string
10461049
is of length one.
10471050
1048-
Diff - Check for one byte string - create and dereference a NULL pointer
1049-
Payload - An JSON string of length one : "A"
1050-
Triggers - NULL pointer dereference
1051+
Diff - Check for one byte string - create and dereference a NULL pointer
1052+
Payload - A JSON string of length one : "A"
1053+
Input File - oneByteString
1054+
Triggers - NULL pointer dereference
10511055
******************************************************************************/
10521056

10531057
if (value->u.string.length == 1) {

0 commit comments

Comments
 (0)