-
Notifications
You must be signed in to change notification settings - Fork 0
/
101.json
25 lines (25 loc) · 1.19 KB
/
101.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
"file_path": "security_data/gpt3_security_vulnerability_scanner-main/PHP Object Injection/chall1.php",
"vulnerability": "Vulnerabilities Detected:\n1. Unvalidated user input: The user data is being unserialized without any validation, which could lead to remote code execution.\n2. Insecure file operations: The file is being deleted without any validation, which could lead to arbitrary file deletion.",
"source code": "class Example1\n{\n public $cache_file;\n\n function __construct()\n {\n // some PHP code...\n }\n\n function __destruct()\n {\n $file = \"/var/www/cache/tmp/{$this->cache_file}\";\n if (file_exists($file)) @unlink($file);\n }\n}\n\n// some PHP code...\n\n$user_data = unserialize($_GET['data']);\n\n// some PHP code...\n",
"language": "php",
"cwe_identifier": [
"CWE-502"
],
"pattern_desc": [
"Deserialization of Untrusted Data"
],
"line_number": [
19
],
"line_text": [
"$user_data = unserialize($_GET['data']);"
],
"pattern_id": [
"PHP-R-010"
],
"rule": [
"\\b(serialize|unserialize)\\s*\\(\\s*\\$_(GET|POST|REQUEST|COOKIE|SERVER)"
],
"label": 1
}