vul int64 | CWE ID string | path string | language string | description string | func_before string | artifacts_list list | supported_code string |
|---|---|---|---|---|---|---|---|
0 | CWE-79 | 314100-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_ADD_SLASHES);
$sanitized = filter_var($tainted, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$dataflow = $sanitized;
$pre = "<script>alert(Hello";
$post = ");</script>";
$context = ($pre . ($dataflow . $post));
printf("Print this: %d", $context);
?... | null | null |
1 | CWE-122 | 70028-v1.0.0/src/testcases/CWE122_Heap_Based_Buffer_Overflow/s05/CWE122_Heap_Based_Buffer_Overflow__cpp_dest_char_cpy_13.cpp | cplusplus | CWE: 122 Heap Based Buffer Overflow
BadSource: Allocate using new[] and set data pointer to a small buffer
GoodSource: Allocate using new[] and set data pointer to a large buffer
Sink: cpy
BadSink : Copy string to data using strcpy
Flow Variant: 13 Control flow: if(GLOBAL_CONST_FIVE==5) and if(GLOBAL_CONST_FIVE!=... | #include "std_testcase.h"
#include <wchar.h>
namespace CWE122_Heap_Based_Buffer_Overflow__cpp_dest_char_cpy_13
{
#ifndef OMITBAD
void bad()
{
char * data;
data = NULL;
if(GLOBAL_CONST_FIVE==5)
{
data = new char[50];
data[0] = '\0';
}
{
char source[100];
... | [
{
"hashes": {
"sha-256": "0fe1db5ab1f72448f547231f2860b33fa7c3b135bb88c23b53deed3089fef36a"
},
"length": 3976,
"location": {
"uri": "70028-v1.0.0/src/testcases/CWE122_Heap_Based_Buffer_Overflow/s05/CWE122_Heap_Based_Buffer_Overflow__cpp_dest_char_cpy_13.cpp"
},
"sourceLanguage": ... | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__cpp_dest_char_cpy_13.cpp
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__cpp_dest.label.xml
Template File: sources-sink-13.tmpl.cpp
*/
/*
* @description
* CWE: 122 Heap Based Buffer Overflow
* BadSource: Allocate using new[] ... |
1 | CWE-762 | 242650-v2.0.0/src/testcases/CWE762_Mismatched_Memory_Management_Routines/s03/CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_realloc_08.cpp | cplusplus | CWE: 762 Mismatched Memory Management Routines
BadSource: realloc Allocate data using realloc()
GoodSource: Allocate data using new
Sinks:
GoodSink: Deallocate data using free()
BadSink : Deallocate data using delete
Flow Variant: 08 Control flow: if(staticReturnsTrue()) and if(staticReturnsFalse()) | #include "std_testcase.h"
static int staticReturnsTrue()
{
return 1;
}
static int staticReturnsFalse()
{
return 0;
}
namespace CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_realloc_08
{
#ifndef OMITBAD
void bad()
{
int64_t * data;
data = NULL;
if(staticReturnsTrue())
{
... | [
{
"hashes": {
"sha-256": "e5059b5c709398073b6a7359b18d613a6071125f5d671f7f0a9dbd7aef1aa6e4"
},
"length": 5228,
"location": {
"uri": "242650-v2.0.0/src/testcases/CWE762_Mismatched_Memory_Management_Routines/s03/CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_realloc_08.cpp"
... | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_realloc_08.cpp
Label Definition File: CWE762_Mismatched_Memory_Management_Routines__delete.label.xml
Template File: sources-sinks-08.tmpl.cpp
*/
/*
* @description
* CWE: 762 Mismatched Memory Management Routines... |
0 | CWE-89 | 404859-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$pdo = new PDO("mysql:host=mysql;port=3306;dbname=myDB", "username", "password");
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_FULL_SPECIAL_CHARS]);
$tainted = $tainted["t"];
$sanitized = bindec($tainted);
$dataflow = $sanitized;
$context = (("SELECT * FROM users WHERE pin ="... | null | null |
0 | CWE-79 | 488957-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_URL]);
$tainted = $tainted["t"];
$sanitized = soundex($tainted);
$dataflow = $sanitized;
$context = (("<img src=\"" . $dataflow) . "\"/>");
exit($context);
?> | null | null |
0 | CWE-79 | 273499-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
$legal = ["safe1", "safe2"];
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_EMAIL]);
$tainted = $tainted["t"];
if(in_array($tainted, $legal, true))
{
$sanitized = $tainted;
$dataflow = $sanitized;
$context = (("Hello to \"" . $dataflow) . "\"");
vprintf("This%s", $conte... | null | null |
1 | CWE-415 | 240073-v2.0.0/src/testcases/CWE415_Double_Free/s01/CWE415_Double_Free__malloc_free_char_03.c | c | CWE: 415 Double Free
BadSource: Allocate data using malloc() and Deallocate data using free()
GoodSource: Allocate data using malloc()
Sinks:
GoodSink: do nothing
BadSink : Deallocate data using free()
Flow Variant: 03 Control flow: if(5==5) and if(5!=5) | #include "std_testcase.h"
#include <wchar.h>
#ifndef OMITBAD
void CWE415_Double_Free__malloc_free_char_03_bad()
{
char * data;
data = NULL;
if(5==5)
{
data = (char *)malloc(100*sizeof(char));
if (data == NULL) {exit(-1);}
free(data);
}
if(5==5)
{
... | [
{
"hashes": {
"sha-256": "e909b1b249c5ea1eb729a310d5f5f78e3d11de136395ad037f5cf625173333da"
},
"length": 4430,
"location": {
"uri": "240073-v2.0.0/src/testcases/CWE415_Double_Free/s01/CWE415_Double_Free__malloc_free_char_03.c"
},
"sourceLanguage": "c"
},
{
"hashes": {
... | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE415_Double_Free__malloc_free_char_03.c
Label Definition File: CWE415_Double_Free__malloc_free.label.xml
Template File: sources-sinks-03.tmpl.c
*/
/*
* @description
* CWE: 415 Double Free
* BadSource: Allocate data using malloc() and Deallocate data using free()
* Go... |
1 | CWE-89 | 413246-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$db = new SQLite3("/var/www/db/database.db");
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_ADD_SLASHES);
$sanitized = strstr($tainted, "1");
$dataflow = $sanitized;
$context = (("SELECT * FROM users WHERE pin =" . $dataflow) . ";");
$results = $db->query($context);
while(($row = $resu... | null | null |
0 | CWE-89 | 360342-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$servername = "mysql";
$username = "username";
$password = "password";
$dbName = "myDB";
$db = new mysqli($servername, $username, $password, $dbName);
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_NUMBER_FLOAT]);
$tainted = $tainted["t"];
$sanitized = urlencode($tainted);
$dat... | null | null |
0 | CWE-89 | 382444-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$info = ["Database" => "myDB", "UID" => "SA", "PWD" => "Msql12345678!"];
$db = sqlsrv_connect("mssql", $info);
if($db == false)
{
die(print_r(sqlsrv_errors(), true));
}
# Sample
$tainted = $_REQUEST;
$tainted = $tainted["t"];
if(is_bool($tainted))
{
$sanitized = $tainted;
$dataflow = $sanitized;
... | null | null |
0 | CWE-79 | 254392-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_SPECIAL_CHARS]);
$tainted = $tainted["t"];
$sanitized = metaphone($tainted, 9);
$dataflow = $sanitized;
$pre = "<script>alert(Hello";
$post = ");</script>";
$context = ($pre . ($dataflow . $post));
echo($context);
?> | null | null |
1 | CWE-89 | 437701-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$servername = "mysql";
$username = "username";
$password = "password";
$dbName = "myDB";
$db = new mysqli($servername, $username, $password, $dbName);
# Sample
$tainted = $_POST;
$tainted = $tainted["t"];
$sanitized = strtr($tainted, "'", " ");
$dataflow = $sanitized;
$context = (("SELECT * FROM users WH... | null | null |
0 | CWE-89 | 476390-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$pdo = new PDO("mysql:host=mysql;port=3306;dbname=myDB", "username", "password");
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_NUMBER_FLOAT);
$sanitized = str_replace("'", "", $tainted);
$dataflow = $sanitized;
$context = (("SELECT * FROM users WHERE pin =" . $dataflow) . ";");
$resul... | null | null |
1 | CWE-762 | 114472-v1.0.0/src/testcases/CWE762_Mismatched_Memory_Management_Routines/s03/CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_malloc_53a.cpp | cplusplus | CWE: 762 Mismatched Memory Management Routines
BadSource: malloc Allocate data using malloc()
GoodSource: Allocate data using new
Sinks:
GoodSink: Deallocate data using free()
BadSink : Deallocate data using delete
Flow Variant: 53 Data flow: data passed as an argument from one function through two others to a fo... | #include "std_testcase.h"
namespace CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_malloc_53
{
#ifndef OMITBAD
void badSink_b(int64_t * data);
void bad()
{
int64_t * data;
data = NULL;
data = (int64_t *)malloc(100*sizeof(int64_t));
badSink_b(data);
}
#endif
#ifndef OMITGO... | [
{
"hashes": {
"sha-256": "467e7fc17ed433fa5af924b629a0a5ff0a63da03c96e04411f8ba09a0f3a8138"
},
"length": 2791,
"location": {
"uri": "114472-v1.0.0/src/testcases/CWE762_Mismatched_Memory_Management_Routines/s03/CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_malloc_53a.cpp"
... | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_malloc_53a.cpp
Label Definition File: CWE762_Mismatched_Memory_Management_Routines__delete.label.xml
Template File: sources-sinks-53a.tmpl.cpp
*/
/*
* @description
* CWE: 762 Mismatched Memory Management Routine... |
0 | CWE-79 | 278277-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = $_COOKIE;
$tainted = $tainted["t"];
$sanitized = gzcompress($tainted);
$dataflow = $sanitized;
$context = (("<a href=\"" . $dataflow) . "\">link</a>");
vprintf("This%s", $context);
?> | null | null |
0 | CWE-79 | 393864-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_URL);
if(settype($tainted, "bool"))
{
$sanitized = $tainted;
$dataflow = $sanitized;
$context = (("Hello to '" . $dataflow) . "'");
trigger_error($context, E_USER_ERROR);
}
?> | null | null |
0 | CWE-79 | 427692-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_URL]);
$tainted = $tainted["t"];
$sanitized = htmlspecialchars($tainted, ENT_COMPAT);
$dataflow = $sanitized;
$pre = "<script>alert(\"Hello";
$post = "\");</script>";
$context = ($pre . ($dataflow . $post));
exit($context);
?> | null | null |
0 | CWE-79 | 334203-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_SPECIAL_CHARS);
if(is_integer($tainted))
{
$sanitized = $tainted;
$dataflow = $sanitized;
$context = (("<a href=\"" . $dataflow) . "\">link</a>");
printf("Print this: %d", $context);
}
?> | null | null |
1 | CWE-23 | 90083-v1.0.0/src/testcases/CWE23_Relative_Path_Traversal/s01/CWE23_Relative_Path_Traversal__char_environment_fopen_34.cpp | cplusplus | CWE: 23 Relative Path Traversal
BadSource: environment Read input from an environment variable
GoodSource: Use a fixed file name
Sinks: fopen
BadSink : Open the file named in data using fopen()
Flow Variant: 34 Data flow: use of a union containing two methods of accessing the same data (within the same function) | #include "std_testcase.h"
#ifdef _WIN32
#define BASEPATH "c:\\temp\\"
#else
#include <wchar.h>
#define BASEPATH "/tmp/"
#endif
#define ENV_VARIABLE "ADD"
#ifdef _WIN32
#define GETENV getenv
#else
#define GETENV getenv
#endif
#ifdef _WIN32
#define FOPEN fopen
#else
#define FOPEN fopen
#endif
namespace CWE23_Relativ... | [
{
"hashes": {
"sha-256": "b37341ce7748daaf78e56ae55a3951ee7de58a4e7a38cab40c62203c4fd31dba"
},
"length": 3628,
"location": {
"uri": "90083-v1.0.0/src/testcases/CWE23_Relative_Path_Traversal/s01/CWE23_Relative_Path_Traversal__char_environment_fopen_34.cpp"
},
"sourceLanguage": "cp... | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE23_Relative_Path_Traversal__char_environment_fopen_34.cpp
Label Definition File: CWE23_Relative_Path_Traversal.label.xml
Template File: sources-sink-34.tmpl.cpp
*/
/*
* @description
* CWE: 23 Relative Path Traversal
* BadSource: environment Read input from an environm... |
0 | CWE-79 | 486489-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_URL);
if(settype($tainted, "int"))
{
$sanitized = $tainted;
$dataflow = $sanitized;
$pre = "<script>alert(\"Hello";
$post = "\");</script>";
$context = ($pre . ($dataflow . $post));
printf("Print this: %d", $context);
}
?> | null | null |
0 | CWE-79 | 366300-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_NUMBER_INT);
$sanitized = htmlentities($tainted, ENT_NOQUOTES);
$dataflow = $sanitized;
$context = (("<a href=\"" . $dataflow) . "\">link</a>");
printf("Print this: %s", $context);
?> | null | null |
0 | CWE-79 | 388692-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = apache_request_headers();
$tainted = $tainted["t"];
$sanitized = strripos($tainted, "needle");
$dataflow = $sanitized;
$context = ("Hello" . $dataflow);
vprintf("This%d", $context);
?> | null | null |
0 | CWE-79 | 369575-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_NUMBER_FLOAT);
$sanitized = urlencode($tainted);
$dataflow = $sanitized;
$context = ("Hello" . $dataflow);
exit($context);
?> | null | null |
0 | CWE-79 | 403892-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_NUMBER_INT]);
$tainted = $tainted["t"];
$sanitized = $tainted+= 0;
$dataflow = $sanitized;
$context = (("Hello to '" . $dataflow) . "'");
user_error($context);
?> | null | null |
1 | CWE-78 | 246371-v2.0.0/src/testcases/CWE78_OS_Command_Injection/s05/CWE78_OS_Command_Injection__wchar_t_connect_socket_execl_09.c | c | CWE: 78 OS Command Injection
BadSource: connect_socket Read data using a connect socket (client side)
GoodSource: Fixed string
Sink: execl
BadSink : execute command with wexecl
Flow Variant: 09 Control flow: if(GLOBAL_CONST_TRUE) and if(GLOBAL_CONST_FALSE) | #include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#define COMMAND_INT_PATH L"%WINDIR%\\system32\\cmd.exe"
#define COMMAND_INT L"cmd.exe"
#define COMMAND_ARG1 L"/c"
#define COMMAND_ARG2 L"dir "
#define COMMAND_ARG3 data
#else
#include <unistd.h>
#define COMMAND_INT_PATH L"/bin/sh"
#define COMMAND_INT L"sh"
#... | [
{
"hashes": {
"sha-256": "8702f82e35676496835152f84b3d040fa65875c320f4bf5c4db54e11d5624b57"
},
"length": 6878,
"location": {
"uri": "246371-v2.0.0/src/testcases/CWE78_OS_Command_Injection/s05/CWE78_OS_Command_Injection__wchar_t_connect_socket_execl_09.c"
},
"sourceLanguage": "c"
... | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__wchar_t_connect_socket_execl_09.c
Label Definition File: CWE78_OS_Command_Injection.strings.label.xml
Template File: sources-sink-09.tmpl.c
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: connect_socket Read data using a conne... |
0 | CWE-89 | 405674-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$servername = "mysql";
$username = "username";
$password = "password";
$dbName = "myDB";
$db = new mysqli($servername, $username, $password, $dbName);
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_NUMBER_FLOAT]);
$tainted = $tainted["t"];
$sanitized = str_word_count($tainted, ... | null | null |
0 | CWE-89 | 435186-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$servername = "mysql";
$username = "username";
$password = "password";
$dbName = "myDB";
$db = new mysqli($servername, $username, $password, $dbName);
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_URL]);
$tainted = $tainted["t"];
$sanitized = filter_var($tainted, FILTER_SANITI... | null | null |
0 | CWE-79 | 451546-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_EMAIL);
if(fnmatch("*", $tainted, 0))
{
$sanitized = $tainted;
$dataflow = $sanitized;
$context = (("<img src=\"" . $dataflow) . "\"/>");
user_error($context);
}
?> | null | null |
1 | CWE-114 | 62489-v1.0.0/src/testcases/CWE114_Process_Control/CWE114_Process_Control__w32_wchar_t_relativePath_32.c | c | CWE: 114 Process Control
BadSource: relativePath Hard code the relative pathname to the library
GoodSource: Hard code the full pathname to the library
Sink:
BadSink : Load a dynamic link library
Flow Variant: 32 Data flow using two pointers to the same value within the same function | #include "std_testcase.h"
#include <wchar.h>
#include <windows.h>
#ifndef OMITBAD
void CWE114_Process_Control__w32_wchar_t_relativePath_32_bad()
{
wchar_t * data;
wchar_t * *dataPtr1 = &data;
wchar_t * *dataPtr2 = &data;
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
{
wchar_t * d... | [
{
"hashes": {
"sha-256": "ef3fa5bf67106c137a9b9b109370ab9c84811ca7d222d040911c9c57b3c7fcbc"
},
"length": 3636,
"location": {
"uri": "62489-v1.0.0/src/testcases/CWE114_Process_Control/CWE114_Process_Control__w32_wchar_t_relativePath_32.c"
},
"sourceLanguage": "c"
},
{
"has... | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE114_Process_Control__w32_wchar_t_relativePath_32.c
Label Definition File: CWE114_Process_Control__w32.label.xml
Template File: sources-sink-32.tmpl.c
*/
/*
* @description
* CWE: 114 Process Control
* BadSource: relativePath Hard code the relative pathname to the libra... |
0 | CWE-79 | 293160-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_URL);
if(is_int($tainted))
{
$sanitized = $tainted;
$dataflow = $sanitized;
$context = (("Hello to \"" . $dataflow) . "\"");
printf("Print this: %d", $context);
}
?> | null | null |
0 | CWE-79 | 432059-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_URL]);
$tainted = $tainted["t"];
if(gettype($tainted) == "integer")
{
$sanitized = $tainted;
$dataflow = $sanitized;
$context = (("<a href=\"" . $dataflow) . "\">link</a>");
vprintf("This%s", $context);
}
?> | null | null |
0 | CWE-79 | 285849-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_SPECIAL_CHARS]);
$tainted = $tainted["t"];
if(settype($tainted, "float"))
{
$sanitized = $tainted;
$dataflow = $sanitized;
$context = ("Hello" . $dataflow);
trigger_error($context, E_USER_ERROR);
}
?> | null | null |
0 | CWE-79 | 411804-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = $_REQUEST;
$tainted = $tainted["t"];
$sanitized = gzencode($tainted, 9);
$dataflow = $sanitized;
$pre = "<script>alert(\"Hello";
$post = "\");</script>";
$context = ($pre . ($dataflow . $post));
printf("Print this: %d", $context);
?> | null | null |
0 | CWE-79 | 301384-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_NUMBER_INT);
$sanitized = htmlentities($tainted);
$dataflow = $sanitized;
$pre = "<script>alert(\"Hello";
$post = "\");</script>";
$context = ($pre . ($dataflow . $post));
printf("Print this: %d", $context);
?> | null | null |
0 | CWE-89 | 349111-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$pdo = new PDO("mysql:host=mysql;port=3306;dbname=myDB", "username", "password");
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_NUMBER_FLOAT);
if(ctype_digit($tainted))
{
$sanitized = $tainted;
$dataflow = $sanitized;
$context = (("SELECT * FROM users WHERE password ='" . $datafl... | null | null |
0 | CWE-89 | 309873-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$info = ["Database" => "myDB", "UID" => "SA", "PWD" => "Msql12345678!"];
$db = sqlsrv_connect("mssql", $info);
if($db == false)
{
die(print_r(sqlsrv_errors(), true));
}
# Sample
$tainted = $_POST;
$tainted = $tainted["t"];
$sanitized = base64_encode($tainted);
$dataflow = $sanitized;
$context = (("SELE... | null | null |
1 | CWE-89 | 492501-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$db = pg_pconnect("host=postgres-server port=5432 user=postgres password=postgres123 dbname=myDB");
# Sample
$tainted = $_REQUEST;
$tainted = $tainted["t"];
$sanitized = html_entity_decode($tainted);
$dataflow = $sanitized;
$context = (("SELECT * FROM users WHERE pin =" . $dataflow) . ";");
$result = pg_... | null | null |
1 | CWE-89 | 480962-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$info = ["Database" => "myDB", "UID" => "SA", "PWD" => "Msql12345678!"];
$db = sqlsrv_connect("mssql", $info);
if($db == false)
{
die(print_r(sqlsrv_errors(), true));
}
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$sanitized = sscanf($tainted, "foo %s");
$saniti... | null | null |
1 | CWE-79 | 275074-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_FULL_SPECIAL_CHARS]);
$tainted = $tainted["t"];
$sanitized = str_ireplace("'", "", $tainted);
$dataflow = $sanitized;
$context = (("<a href=\"" . $dataflow) . "\">link</a>");
printf("Print this: %s", $context);
?> | null | null |
0 | CWE-89 | 362842-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$dsn = "DATABASE=myDB;HOSTNAME=ibm_db2;PORT=50000;PROTOCOL=TCPIP;UID=db2inst1;PWD=ibm_db2_pw;";
$db = db2_connect($dsn, "", "");
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_NUMBER_INT]);
$tainted = $tainted["t"];
if(is_bool($tainted))
{
$sanitized = $tainted;
$dataflow =... | null | null |
0 | CWE-79 | 300373-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_ADD_SLASHES);
if(is_integer($tainted))
{
$sanitized = $tainted;
$dataflow = $sanitized;
$pre = "<script>alert(\"Hello";
$post = "\");</script>";
$context = ($pre . ($dataflow . $post));
trigger_error($context, E_USER_ERROR);
}
?... | null | null |
0 | CWE-79 | 308777-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_EMAIL]);
$tainted = $tainted["t"];
$sanitized = strtr($tainted, "'", " ");
$dataflow = $sanitized;
$context = (("<img src=\"" . $dataflow) . "\"/>");
vprintf("This%d", $context);
?> | null | null |
1 | CWE-773 | 116674-v1.0.0/src/testcases/CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle/CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle__fopen_16.c | c | CWE: 773 Missing Reference to Active File Descriptor or Handle
BadSource: Create a file handle using fopen()
Sinks:
GoodSink: Close the file handle before reusing it
BadSink : Reassign the file handle before closing it
Flow Variant: 16 Control flow: while(1) | #include "std_testcase.h"
#ifndef OMITBAD
void CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle__fopen_16_bad()
{
FILE * data;
data = NULL;
data = fopen("BadSource_fopen.txt", "w+");
while(1)
{
data = fopen("BadSink_fopen.txt", "w+");
if (data != ... | [
{
"hashes": {
"sha-256": "4708bd4a74a7eba0df39539c1a6326273a2815a4165e4c65226d5ecf1d4bc99f"
},
"length": 2961,
"location": {
"uri": "116674-v1.0.0/src/testcases/CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle/CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle__fope... | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle__fopen_16.c
Label Definition File: CWE773_Missing_Reference_to_Active_File_Descriptor_or_Handle__fopen.label.xml
Template File: source-sinks-16.tmpl.c
*/
/*
* @description
* CWE: 773 Missing Reference to Active ... |
0 | CWE-79 | 313644-v1.0.0/src/sample.php | php | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). | <?php
# Init
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_NUMBER_FLOAT);
$sanitized = bindec($tainted);
$dataflow = $sanitized;
$context = (("Hello to '" . $dataflow) . "'");
vprintf("This%d", $context);
?> | null | null |
0 | CWE-89 | 388868-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$db = new SQLite3("/var/www/db/database.db");
# Sample
$tainted = filter_input(INPUT_GET, "t", FILTER_SANITIZE_SPECIAL_CHARS);
$sanitized = str_ireplace(["\"", "'", "<", ">"], "", $tainted);
$dataflow = $sanitized;
$context = (("SELECT * FROM users WHERE password =\"" . $dataflow) . "\";");
$results = $d... | null | null |
0 | CWE-89 | 462905-v1.0.0/src/sample.php | php | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). | <?php
# Init
$dsn = "DATABASE=myDB;HOSTNAME=ibm_db2;PORT=50000;PROTOCOL=TCPIP;UID=db2inst1;PWD=ibm_db2_pw;";
$db = db2_connect($dsn, "", "");
# Sample
$tainted = filter_input_array(INPUT_GET, ["t" => FILTER_SANITIZE_URL]);
$tainted = $tainted["t"];
$sanitized = ($tainted + 0.0);
$dataflow = $sanitized;
$context = (("... | null | null |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 20