diff --git a/.whitesource b/.whitesource new file mode 100644 index 000000000..55b922e8c --- /dev/null +++ b/.whitesource @@ -0,0 +1,12 @@ +{ + "scanSettings": { + "baseBranches": [] + }, + "checkRunSettings": { + "vulnerableCheckRunConclusionLevel": "failure", + "displayMode": "diff" + }, + "issueSettings": { + "minSeverityLevel": "LOW" + } +} \ No newline at end of file diff --git a/src/targets/php/curl/fixtures/application-form-encoded.php b/src/targets/php/curl/fixtures/application-form-encoded.php index 07d461e8e..49275c22d 100644 --- a/src/targets/php/curl/fixtures/application-form-encoded.php +++ b/src/targets/php/curl/fixtures/application-form-encoded.php @@ -1,5 +1,10 @@ 'bar', + 'hello' => 'world' +]); + $curl = curl_init(); curl_setopt_array($curl, [ @@ -10,7 +15,7 @@ CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", - CURLOPT_POSTFIELDS => "foo=bar&hello=world", + CURLOPT_POSTFIELDS => $postData, CURLOPT_HTTPHEADER => [ "content-type: application/x-www-form-urlencoded" ], diff --git a/src/targets/php/curl/fixtures/application-json.php b/src/targets/php/curl/fixtures/application-json.php index f6c5cffbf..9a4bacc6b 100644 --- a/src/targets/php/curl/fixtures/application-json.php +++ b/src/targets/php/curl/fixtures/application-json.php @@ -1,5 +1,7 @@ 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", - CURLOPT_POSTFIELDS => json_encode([ - 'number' => 1, - 'string' => 'f"oo', - 'arr' => [ - 1, - 2, - 3 - ], - 'nested' => [ - 'a' => 'b' - ], - 'arr_mix' => [ - 1, - 'a', - [ - 'arr_mix_nested' => [ - - ] - ] - ], - 'boolean' => null - ]), + CURLOPT_POSTFIELDS => $postData, CURLOPT_HTTPHEADER => [ "content-type: application/json" ], @@ -46,4 +27,4 @@ echo "cURL Error #:" . $err; } else { echo $response; -} \ No newline at end of file +} diff --git a/src/targets/php/curl/fixtures/full.php b/src/targets/php/curl/fixtures/full.php index fef4d120c..08be4c4d9 100644 --- a/src/targets/php/curl/fixtures/full.php +++ b/src/targets/php/curl/fixtures/full.php @@ -1,5 +1,9 @@ 'bar' +]); + $curl = curl_init(); curl_setopt_array($curl, [ @@ -10,7 +14,7 @@ CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", - CURLOPT_POSTFIELDS => "foo=bar", + CURLOPT_POSTFIELDS => $postData, CURLOPT_COOKIE => "foo=bar; bar=baz", CURLOPT_HTTPHEADER => [ "accept: application/json", diff --git a/src/targets/php/curl/fixtures/jsonObj-multiline.php b/src/targets/php/curl/fixtures/jsonObj-multiline.php index e4eb1c954..8995007ba 100644 --- a/src/targets/php/curl/fixtures/jsonObj-multiline.php +++ b/src/targets/php/curl/fixtures/jsonObj-multiline.php @@ -1,5 +1,7 @@ 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", - CURLOPT_POSTFIELDS => json_encode([ - 'foo' => 'bar' - ]), + CURLOPT_POSTFIELDS => $postData, CURLOPT_HTTPHEADER => [ "content-type: application/json" ], @@ -27,4 +27,4 @@ echo "cURL Error #:" . $err; } else { echo $response; -} \ No newline at end of file +} diff --git a/src/targets/php/curl/fixtures/jsonObj-null-value.php b/src/targets/php/curl/fixtures/jsonObj-null-value.php index 2d49abddc..8620b3b76 100644 --- a/src/targets/php/curl/fixtures/jsonObj-null-value.php +++ b/src/targets/php/curl/fixtures/jsonObj-null-value.php @@ -1,5 +1,7 @@ 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", - CURLOPT_POSTFIELDS => json_encode([ - 'foo' => null - ]), + CURLOPT_POSTFIELDS => $postData, CURLOPT_HTTPHEADER => [ "content-type: application/json" ], @@ -27,4 +27,4 @@ echo "cURL Error #:" . $err; } else { echo $response; -} \ No newline at end of file +} diff --git a/src/targets/php/curl/fixtures/multipart-data.php b/src/targets/php/curl/fixtures/multipart-data.php index 661b8671e..020b4e3d8 100644 --- a/src/targets/php/curl/fixtures/multipart-data.php +++ b/src/targets/php/curl/fixtures/multipart-data.php @@ -1,5 +1,8 @@ 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", - CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\nHello World\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"bar\"\r\n\r\nBonjour le monde\r\n-----011000010111000001101001--\r\n", + CURLOPT_POSTFIELDS => $postData, CURLOPT_HTTPHEADER => [ "content-type: multipart/form-data; boundary=---011000010111000001101001" ], @@ -25,4 +28,4 @@ echo "cURL Error #:" . $err; } else { echo $response; -} \ No newline at end of file +} diff --git a/src/targets/php/curl/fixtures/multipart-file.php b/src/targets/php/curl/fixtures/multipart-file.php index a6f02e657..8f7c359fc 100644 --- a/src/targets/php/curl/fixtures/multipart-file.php +++ b/src/targets/php/curl/fixtures/multipart-file.php @@ -1,5 +1,7 @@ 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", - CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n-----011000010111000001101001--\r\n", + CURLOPT_POSTFIELDS => $postData, CURLOPT_HTTPHEADER => [ "content-type: multipart/form-data; boundary=---011000010111000001101001" ], diff --git a/src/targets/php/curl/fixtures/multipart-form-data.php b/src/targets/php/curl/fixtures/multipart-form-data.php index 0f159fcd6..db9cc1802 100644 --- a/src/targets/php/curl/fixtures/multipart-form-data.php +++ b/src/targets/php/curl/fixtures/multipart-form-data.php @@ -1,5 +1,7 @@ 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", - CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"\r\n\r\nbar\r\n-----011000010111000001101001--\r\n", + CURLOPT_POSTFIELDS => $postData, CURLOPT_HTTPHEADER => [ "Content-Type: multipart/form-data; boundary=---011000010111000001101001" ], diff --git a/src/targets/php/curl/fixtures/text-plain.php b/src/targets/php/curl/fixtures/text-plain.php index df1487033..8fad7cbbb 100644 --- a/src/targets/php/curl/fixtures/text-plain.php +++ b/src/targets/php/curl/fixtures/text-plain.php @@ -1,5 +1,7 @@ 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", - CURLOPT_POSTFIELDS => "Hello World", + CURLOPT_POSTFIELDS => $postData, CURLOPT_HTTPHEADER => [ "content-type: text/plain" ],