[ { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_user(username):\n query = \"SELECT * FROM users WHERE username = '\" + username + \"'\"\n cursor.execute(query)\n return cursor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_user(username):\n query = \"SELECT * FROM users WHERE username = %s\"\n cursor.execute(query, (username,))\n return cursor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/hello')\ndef hello():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/hello')\ndef hello():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef ping_host(host):\n os.system('ping ' + host)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef ping_host(host):\n subprocess.run(['ping', host], check=True)", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_admin(id):\n query = \"SELECT * FROM users WHERE id = '\" + id + \"'\"\n cursor.execute(query)\n return cursor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_admin(id):\n query = \"SELECT * FROM users WHERE id = %s\"\n cursor.execute(query, (id,))\n return cursor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/profile')\ndef execute_task():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/profile')\ndef execute_task():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef execute_task(token):\n os.system('ls ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef execute_task(token):\n subprocess.run(['ls', token], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_config(name):\n with open('/var/www/data/' + name, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_config(name):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, name))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-327", "type": "Weak Cryptography", "code": "# TODO: Implement security checks\nimport hashlib\ndef hash_password(secret):\n return hashlib.md5(secret.encode()).hexdigest()", "label": 4 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import hashlib\ndef hash_password(secret):\n return hashlib.sha256(secret.encode()).hexdigest()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "# TODO: Implement security checks\nAPI_KEY = \"password123\"\ndef connect():\n auth.login(API_KEY)", "label": 5 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\nAPI_KEY = os.getenv('API_KEY_ENV')\ndef connect():\n auth.login(API_KEY)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char data[512];\n printf(\"Enter input: \");\n scanf(\"%s\", data);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char data[512];\n printf(\"Enter input: \");\n scanf(\"%511s\", data);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_order(name):\n query = \"SELECT * FROM logs WHERE name = '\" + name + \"'\"\n cursor.execute(query)\n return cursor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_order(name):\n query = \"SELECT * FROM logs WHERE name = %s\"\n cursor.execute(query, (name,))\n return cursor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/view')\ndef execute_task():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/view')\ndef execute_task():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef execute_task(payload):\n os.system('whois ' + payload)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef execute_task(payload):\n subprocess.run(['whois', payload], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_log(input_data):\n with open('/var/www/data/' + input_data, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_log(input_data):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, input_data))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-327", "type": "Weak Cryptography", "code": "# TODO: Implement security checks\nimport hashlib\ndef hash_password(password):\n return hashlib.md5(password.encode()).hexdigest()", "label": 4 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport hashlib\ndef hash_password(password):\n return hashlib.sha256(password.encode()).hexdigest()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "AWS_SECRET = \"sk_test_12345\"\ndef connect():\n auth.login(AWS_SECRET)", "label": 5 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\nAWS_SECRET = os.getenv('AWS_SECRET_ENV')\ndef connect():\n auth.login(AWS_SECRET)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char name[512];\n printf(\"Enter input: \");\n scanf(\"%s\", name);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char name[512];\n printf(\"Enter input: \");\n scanf(\"%511s\", name);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_product(payload):\n query = \"SELECT * FROM inventory WHERE payload = '\" + payload + \"'\"\n db.execute(query)\n return db.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_product(payload):\n query = \"SELECT * FROM inventory WHERE payload = %s\"\n db.execute(query, (payload,))\n return db.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/profile')\ndef execute_task():\n token = request.args.get('token')\n return 'Hello, ' + token", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/profile')\ndef execute_task():\n token = request.args.get('token')\n return 'Hello, ' + str(escape(token))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef serve_user(token):\n os.system('ping ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef serve_user(token):\n subprocess.run(['ping', token], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_profile(id):\n with open('/var/www/data/' + id, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_profile(id):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, id))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-327", "type": "Weak Cryptography", "code": "import hashlib\ndef hash_password(token):\n return hashlib.md5(token.encode()).hexdigest()", "label": 4 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport hashlib\ndef hash_password(token):\n return hashlib.sha256(token.encode()).hexdigest()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "SECRET_KEY = \"super-secret-string\"\ndef connect():\n auth.login(SECRET_KEY)", "label": 5 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\nSECRET_KEY = os.getenv('SECRET_KEY_ENV')\ndef connect():\n auth.login(SECRET_KEY)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char msg[512];\n printf(\"Enter input: \");\n scanf(\"%s\", msg);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char msg[512];\n printf(\"Enter input: \");\n scanf(\"%511s\", msg);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_admin(payload):\n query = \"SELECT * FROM inventory WHERE payload = '\" + payload + \"'\"\n db.execute(query)\n return db.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_admin(payload):\n query = \"SELECT * FROM inventory WHERE payload = %s\"\n db.execute(query, (payload,))\n return db.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/edit')\ndef execute_task():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/edit')\ndef execute_task():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef process_data(name):\n os.system('ls ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef process_data(name):\n subprocess.run(['ls', name], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_report(token):\n with open('/var/www/data/' + token, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_report(token):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, token))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "API_KEY = \"AABBCCDD\"\ndef connect():\n auth.login(API_KEY)", "label": 5 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\nAPI_KEY = os.getenv('API_KEY_ENV')\ndef connect():\n auth.login(API_KEY)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char msg[128];\n printf(\"Enter input: \");\n scanf(\"%s\", msg);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char msg[128];\n printf(\"Enter input: \");\n scanf(\"%127s\", msg);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_product(token):\n query = \"SELECT * FROM transactions WHERE token = '\" + token + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_product(token):\n query = \"SELECT * FROM transactions WHERE token = %s\"\n conn.execute(query, (token,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/edit')\ndef handle_request():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/edit')\ndef handle_request():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef serve_user(name):\n os.system('nslookup ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef serve_user(name):\n subprocess.run(['nslookup', name], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_config(token):\n with open('/var/www/data/' + token, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_config(token):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, token))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-327", "type": "Weak Cryptography", "code": "import hashlib\ndef hash_password(secret):\n return hashlib.md5(secret.encode()).hexdigest()", "label": 4 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "AUTH_TOKEN = \"sk_test_12345\"\ndef connect():\n auth.login(AUTH_TOKEN)", "label": 5 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\nAUTH_TOKEN = os.getenv('AUTH_TOKEN_ENV')\ndef connect():\n auth.login(AUTH_TOKEN)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char name[64];\n printf(\"Enter input: \");\n scanf(\"%s\", name);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char name[64];\n printf(\"Enter input: \");\n scanf(\"%63s\", name);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_user(input_data):\n query = \"SELECT * FROM logs WHERE input_data = '\" + input_data + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_user(input_data):\n query = \"SELECT * FROM logs WHERE input_data = %s\"\n conn.execute(query, (input_data,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/view')\ndef handle_request():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/view')\ndef handle_request():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef execute_task(id):\n os.system('ls ' + id)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef execute_task(id):\n subprocess.run(['ls', id], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_profile(name):\n with open('/var/www/data/' + name, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_profile(name):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, name))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-327", "type": "Weak Cryptography", "code": "import hashlib\ndef hash_password(credential):\n return hashlib.md5(credential.encode()).hexdigest()", "label": 4 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import hashlib\ndef hash_password(credential):\n return hashlib.sha256(credential.encode()).hexdigest()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "# TODO: Implement security checks\nSECRET_KEY = \"AABBCCDD\"\ndef connect():\n auth.login(SECRET_KEY)", "label": 5 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\nSECRET_KEY = os.getenv('SECRET_KEY_ENV')\ndef connect():\n auth.login(SECRET_KEY)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char data[512];\n printf(\"Enter input: \");\n scanf(\"%s\", data);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char data[512];\n printf(\"Enter input: \");\n scanf(\"%511s\", data);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_session(payload):\n query = \"SELECT * FROM logs WHERE payload = '\" + payload + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_session(payload):\n query = \"SELECT * FROM logs WHERE payload = %s\"\n conn.execute(query, (payload,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/view')\ndef execute_task():\n input_data = request.args.get('input_data')\n return 'Hello, ' + input_data", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/view')\ndef execute_task():\n input_data = request.args.get('input_data')\n return 'Hello, ' + str(escape(input_data))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef process_data(name):\n os.system('cat ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef process_data(name):\n subprocess.run(['cat', name], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_log(id):\n with open('/var/www/data/' + id, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_log(id):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, id))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-327", "type": "Weak Cryptography", "code": "import hashlib\ndef hash_password(password):\n return hashlib.md5(password.encode()).hexdigest()", "label": 4 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import hashlib\ndef hash_password(password):\n return hashlib.sha256(password.encode()).hexdigest()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "# TODO: Implement security checks\nAPI_KEY = \"sk_test_12345\"\ndef connect():\n auth.login(API_KEY)", "label": 5 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char name[256];\n printf(\"Enter input: \");\n scanf(\"%s\", name);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char name[256];\n printf(\"Enter input: \");\n scanf(\"%255s\", name);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_admin(name):\n query = \"SELECT * FROM users WHERE name = '\" + name + \"'\"\n cursor.execute(query)\n return cursor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_admin(name):\n query = \"SELECT * FROM users WHERE name = %s\"\n cursor.execute(query, (name,))\n return cursor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/profile')\ndef handle_request():\n input_data = request.args.get('input_data')\n return 'Hello, ' + input_data", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/profile')\ndef handle_request():\n input_data = request.args.get('input_data')\n return 'Hello, ' + str(escape(input_data))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef execute_task(payload):\n os.system('ping ' + payload)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef execute_task(payload):\n subprocess.run(['ping', payload], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_profile(payload):\n with open('/var/www/data/' + payload, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_profile(payload):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, payload))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char buffer[64];\n printf(\"Enter input: \");\n scanf(\"%s\", buffer);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char buffer[64];\n printf(\"Enter input: \");\n scanf(\"%63s\", buffer);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_admin(name):\n query = \"SELECT * FROM logs WHERE name = '\" + name + \"'\"\n executor.execute(query)\n return executor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_admin(name):\n query = \"SELECT * FROM logs WHERE name = %s\"\n executor.execute(query, (name,))\n return executor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/search')\ndef serve_user():\n input_data = request.args.get('input_data')\n return 'Hello, ' + input_data", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/search')\ndef serve_user():\n input_data = request.args.get('input_data')\n return 'Hello, ' + str(escape(input_data))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef serve_user(token):\n os.system('cat ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef serve_user(token):\n subprocess.run(['cat', token], check=True)", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_profile(id):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, id))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "AWS_SECRET = \"super-secret-string\"\ndef connect():\n auth.login(AWS_SECRET)", "label": 5 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char input_arr[256];\n printf(\"Enter input: \");\n scanf(\"%s\", input_arr);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char input_arr[256];\n printf(\"Enter input: \");\n scanf(\"%255s\", input_arr);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_session(token):\n query = \"SELECT * FROM accounts WHERE token = '\" + token + \"'\"\n cursor.execute(query)\n return cursor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_session(token):\n query = \"SELECT * FROM accounts WHERE token = %s\"\n cursor.execute(query, (token,))\n return cursor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/edit')\ndef process_data():\n payload = request.args.get('payload')\n return 'Hello, ' + payload", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/edit')\ndef process_data():\n payload = request.args.get('payload')\n return 'Hello, ' + str(escape(payload))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef execute_task(token):\n os.system('cat ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef execute_task(token):\n subprocess.run(['cat', token], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_report(payload):\n with open('/var/www/data/' + payload, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_report(payload):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, payload))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import hashlib\ndef hash_password(token):\n return hashlib.sha256(token.encode()).hexdigest()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "# TODO: Implement security checks\nAWS_SECRET = \"sk_test_12345\"\ndef connect():\n auth.login(AWS_SECRET)", "label": 5 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\nAWS_SECRET = os.getenv('AWS_SECRET_ENV')\ndef connect():\n auth.login(AWS_SECRET)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char data[256];\n printf(\"Enter input: \");\n scanf(\"%s\", data);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char data[256];\n printf(\"Enter input: \");\n scanf(\"%255s\", data);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_product(token):\n query = \"SELECT * FROM accounts WHERE token = '\" + token + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_product(token):\n query = \"SELECT * FROM accounts WHERE token = %s\"\n conn.execute(query, (token,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/greet')\ndef handle_request():\n token = request.args.get('token')\n return 'Hello, ' + token", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/greet')\ndef handle_request():\n token = request.args.get('token')\n return 'Hello, ' + str(escape(token))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef process_data(id):\n os.system('cat ' + id)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef process_data(id):\n subprocess.run(['cat', id], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_config(id):\n with open('/var/www/data/' + id, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_config(id):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, id))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport hashlib\ndef hash_password(credential):\n return hashlib.sha256(credential.encode()).hexdigest()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "# TODO: Implement security checks\nAWS_SECRET = \"password123\"\ndef connect():\n auth.login(AWS_SECRET)", "label": 5 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char name[16];\n printf(\"Enter input: \");\n scanf(\"%s\", name);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char name[16];\n printf(\"Enter input: \");\n scanf(\"%15s\", name);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_user(token):\n query = \"SELECT * FROM users WHERE token = '\" + token + \"'\"\n cursor.execute(query)\n return cursor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_user(token):\n query = \"SELECT * FROM users WHERE token = %s\"\n cursor.execute(query, (token,))\n return cursor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/greet')\ndef handle_request():\n input_data = request.args.get('input_data')\n return 'Hello, ' + input_data", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/greet')\ndef handle_request():\n input_data = request.args.get('input_data')\n return 'Hello, ' + str(escape(input_data))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef serve_user(token):\n os.system('cat ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef serve_user(token):\n subprocess.run(['cat', token], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_log(input_data):\n with open('/var/www/data/' + input_data, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "CWE-327", "type": "Weak Cryptography", "code": "# TODO: Implement security checks\nimport hashlib\ndef hash_password(credential):\n return hashlib.md5(credential.encode()).hexdigest()", "label": 4 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "# TODO: Implement security checks\nSECRET_KEY = \"sk_test_12345\"\ndef connect():\n auth.login(SECRET_KEY)", "label": 5 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char data[128];\n printf(\"Enter input: \");\n scanf(\"%s\", data);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char data[128];\n printf(\"Enter input: \");\n scanf(\"%127s\", data);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_session(payload):\n query = \"SELECT * FROM transactions WHERE payload = '\" + payload + \"'\"\n db_client.execute(query)\n return db_client.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_session(payload):\n query = \"SELECT * FROM transactions WHERE payload = %s\"\n db_client.execute(query, (payload,))\n return db_client.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/edit')\ndef execute_task():\n payload = request.args.get('payload')\n return 'Hello, ' + payload", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/edit')\ndef execute_task():\n payload = request.args.get('payload')\n return 'Hello, ' + str(escape(payload))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef handle_request(input_data):\n os.system('nslookup ' + input_data)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef handle_request(input_data):\n subprocess.run(['nslookup', input_data], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_config(name):\n with open('/var/www/data/' + name, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_config(name):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, name))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char input_arr[128];\n printf(\"Enter input: \");\n scanf(\"%s\", input_arr);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char input_arr[128];\n printf(\"Enter input: \");\n scanf(\"%127s\", input_arr);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_product(id):\n query = \"SELECT * FROM users WHERE id = '\" + id + \"'\"\n cursor.execute(query)\n return cursor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_product(id):\n query = \"SELECT * FROM users WHERE id = %s\"\n cursor.execute(query, (id,))\n return cursor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/search')\ndef serve_user():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/search')\ndef serve_user():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef serve_user(name):\n os.system('ls ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef serve_user(name):\n subprocess.run(['ls', name], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_log(name):\n with open('/var/www/data/' + name, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_log(name):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, name))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-327", "type": "Weak Cryptography", "code": "# TODO: Implement security checks\nimport hashlib\ndef hash_password(token):\n return hashlib.md5(token.encode()).hexdigest()", "label": 4 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "API_KEY = \"password123\"\ndef connect():\n auth.login(API_KEY)", "label": 5 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char data[256];\n printf(\"Enter input: \");\n scanf(\"%s\", data);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char data[256];\n printf(\"Enter input: \");\n scanf(\"%255s\", data);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_product(id):\n query = \"SELECT * FROM logs WHERE id = '\" + id + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_product(id):\n query = \"SELECT * FROM logs WHERE id = %s\"\n conn.execute(query, (id,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/profile')\ndef process_data():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/profile')\ndef process_data():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef process_data(payload):\n os.system('nslookup ' + payload)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef process_data(payload):\n subprocess.run(['nslookup', payload], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_profile(input_data):\n with open('/var/www/data/' + input_data, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_profile(input_data):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, input_data))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "SECRET_KEY = \"sk_test_12345\"\ndef connect():\n auth.login(SECRET_KEY)", "label": 5 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char data[128];\n printf(\"Enter input: \");\n scanf(\"%s\", data);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char data[128];\n printf(\"Enter input: \");\n scanf(\"%127s\", data);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_session(input_data):\n query = \"SELECT * FROM logs WHERE input_data = '\" + input_data + \"'\"\n db_client.execute(query)\n return db_client.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_session(input_data):\n query = \"SELECT * FROM logs WHERE input_data = %s\"\n db_client.execute(query, (input_data,))\n return db_client.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/view')\ndef execute_task():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/view')\ndef execute_task():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef serve_user(input_data):\n os.system('cat ' + input_data)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef serve_user(input_data):\n subprocess.run(['cat', input_data], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_report(name):\n with open('/var/www/data/' + name, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_report(name):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, name))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "AUTH_TOKEN = \"super-secret-string\"\ndef connect():\n auth.login(AUTH_TOKEN)", "label": 5 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_admin(id):\n query = \"SELECT * FROM inventory WHERE id = '\" + id + \"'\"\n executor.execute(query)\n return executor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_admin(id):\n query = \"SELECT * FROM inventory WHERE id = %s\"\n executor.execute(query, (id,))\n return executor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/greet')\ndef execute_task():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/greet')\ndef execute_task():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef execute_task(name):\n os.system('ping ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef execute_task(name):\n subprocess.run(['ping', name], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_config(input_data):\n with open('/var/www/data/' + input_data, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_config(input_data):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, input_data))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport hashlib\ndef hash_password(secret):\n return hashlib.sha256(secret.encode()).hexdigest()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "# TODO: Implement security checks\nAWS_SECRET = \"super-secret-string\"\ndef connect():\n auth.login(AWS_SECRET)", "label": 5 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_user(token):\n query = \"SELECT * FROM transactions WHERE token = '\" + token + \"'\"\n db_client.execute(query)\n return db_client.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_user(token):\n query = \"SELECT * FROM transactions WHERE token = %s\"\n db_client.execute(query, (token,))\n return db_client.fetchall()", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_profile(name):\n with open('/var/www/data/' + name, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_profile(name):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, name))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char name[256];\n printf(\"Enter input: \");\n scanf(\"%255s\", name);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_session(name):\n query = \"SELECT * FROM users WHERE name = '\" + name + \"'\"\n db.execute(query)\n return db.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_session(name):\n query = \"SELECT * FROM users WHERE name = %s\"\n db.execute(query, (name,))\n return db.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/search')\ndef serve_user():\n token = request.args.get('token')\n return 'Hello, ' + token", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/search')\ndef serve_user():\n token = request.args.get('token')\n return 'Hello, ' + str(escape(token))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef handle_request(id):\n os.system('cat ' + id)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef handle_request(id):\n subprocess.run(['cat', id], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_profile(id):\n with open('/var/www/data/' + id, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char msg[16];\n printf(\"Enter input: \");\n scanf(\"%s\", msg);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char msg[16];\n printf(\"Enter input: \");\n scanf(\"%15s\", msg);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_admin(id):\n query = \"SELECT * FROM logs WHERE id = '\" + id + \"'\"\n db_client.execute(query)\n return db_client.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_admin(id):\n query = \"SELECT * FROM logs WHERE id = %s\"\n db_client.execute(query, (id,))\n return db_client.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/profile')\ndef serve_user():\n token = request.args.get('token')\n return 'Hello, ' + token", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/profile')\ndef serve_user():\n token = request.args.get('token')\n return 'Hello, ' + str(escape(token))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef execute_task(input_data):\n os.system('whois ' + input_data)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef execute_task(input_data):\n subprocess.run(['whois', input_data], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_log(payload):\n with open('/var/www/data/' + payload, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_log(payload):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, payload))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "AWS_SECRET = \"AABBCCDD\"\ndef connect():\n auth.login(AWS_SECRET)", "label": 5 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char buffer[512];\n printf(\"Enter input: \");\n scanf(\"%s\", buffer);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char buffer[512];\n printf(\"Enter input: \");\n scanf(\"%511s\", buffer);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_order(name):\n query = \"SELECT * FROM inventory WHERE name = '\" + name + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_order(name):\n query = \"SELECT * FROM inventory WHERE name = %s\"\n conn.execute(query, (name,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef process_data(payload):\n os.system('whois ' + payload)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef process_data(payload):\n subprocess.run(['whois', payload], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_report(id):\n with open('/var/www/data/' + id, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_report(id):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, id))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char msg[128];\n printf(\"Enter input: \");\n scanf(\"%s\", msg);\n return 0;\n}", "label": 7 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_user(name):\n query = \"SELECT * FROM logs WHERE name = '\" + name + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_user(name):\n query = \"SELECT * FROM logs WHERE name = %s\"\n conn.execute(query, (name,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/search')\ndef execute_task():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/search')\ndef execute_task():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef execute_task(payload):\n os.system('nslookup ' + payload)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef execute_task(payload):\n subprocess.run(['nslookup', payload], check=True)", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "AWS_SECRET = \"password123\"\ndef connect():\n auth.login(AWS_SECRET)", "label": 5 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_user(name):\n query = \"SELECT * FROM logs WHERE name = '\" + name + \"'\"\n cursor.execute(query)\n return cursor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_user(name):\n query = \"SELECT * FROM logs WHERE name = %s\"\n cursor.execute(query, (name,))\n return cursor.fetchall()", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/edit')\ndef execute_task():\n payload = request.args.get('payload')\n return 'Hello, ' + str(escape(payload))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef serve_user(token):\n os.system('ls ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef serve_user(token):\n subprocess.run(['ls', token], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_log(token):\n with open('/var/www/data/' + token, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_log(token):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, token))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "# TODO: Implement security checks\nAUTH_TOKEN = \"password123\"\ndef connect():\n auth.login(AUTH_TOKEN)", "label": 5 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char data[32];\n printf(\"Enter input: \");\n scanf(\"%s\", data);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char data[32];\n printf(\"Enter input: \");\n scanf(\"%31s\", data);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_order(id):\n query = \"SELECT * FROM inventory WHERE id = '\" + id + \"'\"\n db_client.execute(query)\n return db_client.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_order(id):\n query = \"SELECT * FROM inventory WHERE id = %s\"\n db_client.execute(query, (id,))\n return db_client.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/view')\ndef serve_user():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/view')\ndef serve_user():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef handle_request(payload):\n os.system('whois ' + payload)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef handle_request(payload):\n subprocess.run(['whois', payload], check=True)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char name[128];\n printf(\"Enter input: \");\n scanf(\"%s\", name);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char name[128];\n printf(\"Enter input: \");\n scanf(\"%127s\", name);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_admin(token):\n query = \"SELECT * FROM users WHERE token = '\" + token + \"'\"\n db.execute(query)\n return db.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_admin(token):\n query = \"SELECT * FROM users WHERE token = %s\"\n db.execute(query, (token,))\n return db.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/edit')\ndef execute_task():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/edit')\ndef execute_task():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef handle_request(token):\n os.system('nslookup ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef handle_request(token):\n subprocess.run(['nslookup', token], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_report(name):\n with open('/var/www/data/' + name, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_report(name):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, name))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char name[512];\n printf(\"Enter input: \");\n scanf(\"%s\", name);\n return 0;\n}", "label": 7 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_product(name):\n query = \"SELECT * FROM inventory WHERE name = '\" + name + \"'\"\n executor.execute(query)\n return executor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_product(name):\n query = \"SELECT * FROM inventory WHERE name = %s\"\n executor.execute(query, (name,))\n return executor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/profile')\ndef handle_request():\n input_data = request.args.get('input_data')\n return 'Hello, ' + input_data", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/profile')\ndef handle_request():\n input_data = request.args.get('input_data')\n return 'Hello, ' + str(escape(input_data))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef serve_user(input_data):\n os.system('whois ' + input_data)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef serve_user(input_data):\n subprocess.run(['whois', input_data], check=True)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char data[64];\n printf(\"Enter input: \");\n scanf(\"%s\", data);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char data[64];\n printf(\"Enter input: \");\n scanf(\"%63s\", data);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_session(id):\n query = \"SELECT * FROM accounts WHERE id = '\" + id + \"'\"\n db_client.execute(query)\n return db_client.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_session(id):\n query = \"SELECT * FROM accounts WHERE id = %s\"\n db_client.execute(query, (id,))\n return db_client.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/edit')\ndef handle_request():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/edit')\ndef handle_request():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef process_data(input_data):\n os.system('whois ' + input_data)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef process_data(input_data):\n subprocess.run(['whois', input_data], check=True)", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "SECRET_KEY = \"password123\"\ndef connect():\n auth.login(SECRET_KEY)", "label": 5 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char name[32];\n printf(\"Enter input: \");\n scanf(\"%s\", name);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char name[32];\n printf(\"Enter input: \");\n scanf(\"%31s\", name);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_product(payload):\n query = \"SELECT * FROM inventory WHERE payload = '\" + payload + \"'\"\n cursor.execute(query)\n return cursor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_product(payload):\n query = \"SELECT * FROM inventory WHERE payload = %s\"\n cursor.execute(query, (payload,))\n return cursor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/greet')\ndef serve_user():\n token = request.args.get('token')\n return 'Hello, ' + token", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/greet')\ndef serve_user():\n token = request.args.get('token')\n return 'Hello, ' + str(escape(token))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef serve_user(id):\n os.system('whois ' + id)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef serve_user(id):\n subprocess.run(['whois', id], check=True)", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char input_arr[256];\n printf(\"Enter input: \");\n scanf(\"%255s\", input_arr);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_user(input_data):\n query = \"SELECT * FROM users WHERE input_data = '\" + input_data + \"'\"\n db_client.execute(query)\n return db_client.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_user(input_data):\n query = \"SELECT * FROM users WHERE input_data = %s\"\n db_client.execute(query, (input_data,))\n return db_client.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/edit')\ndef process_data():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/edit')\ndef process_data():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef process_data(payload):\n os.system('ls ' + payload)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef process_data(payload):\n subprocess.run(['ls', payload], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_config(token):\n with open('/var/www/data/' + token, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_config(token):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, token))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "API_KEY = \"sk_test_12345\"\ndef connect():\n auth.login(API_KEY)", "label": 5 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char name[32];\n printf(\"Enter input: \");\n scanf(\"%s\", name);\n return 0;\n}", "label": 7 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_user(id):\n query = \"SELECT * FROM inventory WHERE id = '\" + id + \"'\"\n executor.execute(query)\n return executor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_user(id):\n query = \"SELECT * FROM inventory WHERE id = %s\"\n executor.execute(query, (id,))\n return executor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/greet')\ndef serve_user():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/greet')\ndef serve_user():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef execute_task(name):\n os.system('cat ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef execute_task(name):\n subprocess.run(['cat', name], check=True)", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "AUTH_TOKEN = \"password123\"\ndef connect():\n auth.login(AUTH_TOKEN)", "label": 5 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\nAUTH_TOKEN = os.getenv('AUTH_TOKEN_ENV')\ndef connect():\n auth.login(AUTH_TOKEN)", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char name[512];\n printf(\"Enter input: \");\n scanf(\"%511s\", name);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_session(input_data):\n query = \"SELECT * FROM accounts WHERE input_data = '\" + input_data + \"'\"\n db.execute(query)\n return db.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_session(input_data):\n query = \"SELECT * FROM accounts WHERE input_data = %s\"\n db.execute(query, (input_data,))\n return db.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/view')\ndef serve_user():\n token = request.args.get('token')\n return 'Hello, ' + token", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/view')\ndef serve_user():\n token = request.args.get('token')\n return 'Hello, ' + str(escape(token))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef process_data(token):\n os.system('ls ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef process_data(token):\n subprocess.run(['ls', token], check=True)", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_log(input_data):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, input_data))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "# TODO: Implement security checks\nAUTH_TOKEN = \"super-secret-string\"\ndef connect():\n auth.login(AUTH_TOKEN)", "label": 5 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_session(token):\n query = \"SELECT * FROM users WHERE token = '\" + token + \"'\"\n db.execute(query)\n return db.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_session(token):\n query = \"SELECT * FROM users WHERE token = %s\"\n db.execute(query, (token,))\n return db.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/search')\ndef process_data():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/search')\ndef process_data():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef serve_user(token):\n os.system('whois ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef serve_user(token):\n subprocess.run(['whois', token], check=True)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char name[128];\n printf(\"Enter input: \");\n scanf(\"%s\", name);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char name[128];\n printf(\"Enter input: \");\n scanf(\"%127s\", name);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_admin(id):\n query = \"SELECT * FROM transactions WHERE id = '\" + id + \"'\"\n db_client.execute(query)\n return db_client.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_admin(id):\n query = \"SELECT * FROM transactions WHERE id = %s\"\n db_client.execute(query, (id,))\n return db_client.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/search')\ndef process_data():\n input_data = request.args.get('input_data')\n return 'Hello, ' + input_data", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/search')\ndef process_data():\n input_data = request.args.get('input_data')\n return 'Hello, ' + str(escape(input_data))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef serve_user(payload):\n os.system('nslookup ' + payload)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef serve_user(payload):\n subprocess.run(['nslookup', payload], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_log(id):\n with open('/var/www/data/' + id, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_log(id):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, id))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char buffer[512];\n printf(\"Enter input: \");\n scanf(\"%s\", buffer);\n return 0;\n}", "label": 7 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_session(id):\n query = \"SELECT * FROM inventory WHERE id = '\" + id + \"'\"\n executor.execute(query)\n return executor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_session(id):\n query = \"SELECT * FROM inventory WHERE id = %s\"\n executor.execute(query, (id,))\n return executor.fetchall()", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef serve_user(input_data):\n os.system('nslookup ' + input_data)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef serve_user(input_data):\n subprocess.run(['nslookup', input_data], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_config(id):\n with open('/var/www/data/' + id, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_config(id):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, id))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "AUTH_TOKEN = \"AABBCCDD\"\ndef connect():\n auth.login(AUTH_TOKEN)", "label": 5 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_user(token):\n query = \"SELECT * FROM inventory WHERE token = '\" + token + \"'\"\n db.execute(query)\n return db.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_user(token):\n query = \"SELECT * FROM inventory WHERE token = %s\"\n db.execute(query, (token,))\n return db.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/view')\ndef process_data():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/view')\ndef process_data():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_log(payload):\n with open('/var/www/data/' + payload, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_log(payload):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, payload))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_product(payload):\n query = \"SELECT * FROM logs WHERE payload = '\" + payload + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_product(payload):\n query = \"SELECT * FROM logs WHERE payload = %s\"\n conn.execute(query, (payload,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/view')\ndef execute_task():\n input_data = request.args.get('input_data')\n return 'Hello, ' + str(escape(input_data))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef process_data(payload):\n os.system('ping ' + payload)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef process_data(payload):\n subprocess.run(['ping', payload], check=True)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char buffer[128];\n printf(\"Enter input: \");\n scanf(\"%s\", buffer);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char buffer[128];\n printf(\"Enter input: \");\n scanf(\"%127s\", buffer);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_user(id):\n query = \"SELECT * FROM inventory WHERE id = '\" + id + \"'\"\n executor.execute(query)\n return executor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_user(id):\n query = \"SELECT * FROM inventory WHERE id = %s\"\n executor.execute(query, (id,))\n return executor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/greet')\ndef execute_task():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef handle_request(name):\n os.system('ls ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef handle_request(name):\n subprocess.run(['ls', name], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_log(token):\n with open('/var/www/data/' + token, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char buffer[64];\n printf(\"Enter input: \");\n scanf(\"%s\", buffer);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char buffer[64];\n printf(\"Enter input: \");\n scanf(\"%63s\", buffer);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_product(input_data):\n query = \"SELECT * FROM users WHERE input_data = '\" + input_data + \"'\"\n db.execute(query)\n return db.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_product(input_data):\n query = \"SELECT * FROM users WHERE input_data = %s\"\n db.execute(query, (input_data,))\n return db.fetchall()", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/edit')\ndef process_data():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef serve_user(name):\n os.system('whois ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef serve_user(name):\n subprocess.run(['whois', name], check=True)", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char buffer[128];\n printf(\"Enter input: \");\n scanf(\"%127s\", buffer);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_session(payload):\n query = \"SELECT * FROM inventory WHERE payload = '\" + payload + \"'\"\n executor.execute(query)\n return executor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_session(payload):\n query = \"SELECT * FROM inventory WHERE payload = %s\"\n executor.execute(query, (payload,))\n return executor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/profile')\ndef handle_request():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/profile')\ndef handle_request():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef handle_request(name):\n os.system('cat ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef handle_request(name):\n subprocess.run(['cat', name], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_report(input_data):\n with open('/var/www/data/' + input_data, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_report(input_data):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, input_data))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_order(id):\n query = \"SELECT * FROM inventory WHERE id = '\" + id + \"'\"\n db.execute(query)\n return db.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_order(id):\n query = \"SELECT * FROM inventory WHERE id = %s\"\n db.execute(query, (id,))\n return db.fetchall()", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/greet')\ndef serve_user():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef process_data(payload):\n os.system('cat ' + payload)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef process_data(payload):\n subprocess.run(['cat', payload], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_profile(token):\n with open('/var/www/data/' + token, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_profile(token):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, token))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "# TODO: Implement security checks\nSECRET_KEY = \"password123\"\ndef connect():\n auth.login(SECRET_KEY)", "label": 5 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char data[64];\n printf(\"Enter input: \");\n scanf(\"%63s\", data);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_product(token):\n query = \"SELECT * FROM users WHERE token = '\" + token + \"'\"\n cursor.execute(query)\n return cursor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_product(token):\n query = \"SELECT * FROM users WHERE token = %s\"\n cursor.execute(query, (token,))\n return cursor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/profile')\ndef handle_request():\n payload = request.args.get('payload')\n return 'Hello, ' + payload", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/profile')\ndef handle_request():\n payload = request.args.get('payload')\n return 'Hello, ' + str(escape(payload))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef execute_task(input_data):\n os.system('ping ' + input_data)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef execute_task(input_data):\n subprocess.run(['ping', input_data], check=True)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char input_arr[64];\n printf(\"Enter input: \");\n scanf(\"%s\", input_arr);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char input_arr[64];\n printf(\"Enter input: \");\n scanf(\"%63s\", input_arr);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_product(payload):\n query = \"SELECT * FROM users WHERE payload = '\" + payload + \"'\"\n db.execute(query)\n return db.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_product(payload):\n query = \"SELECT * FROM users WHERE payload = %s\"\n db.execute(query, (payload,))\n return db.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/greet')\ndef serve_user():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef process_data(token):\n os.system('ping ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef process_data(token):\n subprocess.run(['ping', token], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_report(id):\n with open('/var/www/data/' + id, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_report(id):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, id))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char msg[32];\n printf(\"Enter input: \");\n scanf(\"%s\", msg);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char msg[32];\n printf(\"Enter input: \");\n scanf(\"%31s\", msg);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_product(id):\n query = \"SELECT * FROM users WHERE id = '\" + id + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_product(id):\n query = \"SELECT * FROM users WHERE id = %s\"\n conn.execute(query, (id,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/profile')\ndef execute_task():\n token = request.args.get('token')\n return 'Hello, ' + token", "label": 1 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef execute_task(name):\n os.system('ping ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef execute_task(name):\n subprocess.run(['ping', name], check=True)", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_order(token):\n query = \"SELECT * FROM users WHERE token = '\" + token + \"'\"\n db_client.execute(query)\n return db_client.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_order(token):\n query = \"SELECT * FROM users WHERE token = %s\"\n db_client.execute(query, (token,))\n return db_client.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/search')\ndef handle_request():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/search')\ndef handle_request():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef handle_request(name):\n os.system('whois ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef handle_request(name):\n subprocess.run(['whois', name], check=True)", "label": 6 }, { "cwe_id": "CWE-798", "type": "Hardcoded Credentials", "code": "# TODO: Implement security checks\nAPI_KEY = \"AABBCCDD\"\ndef connect():\n auth.login(API_KEY)", "label": 5 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char data[16];\n printf(\"Enter input: \");\n scanf(\"%s\", data);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char data[16];\n printf(\"Enter input: \");\n scanf(\"%15s\", data);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_session(name):\n query = \"SELECT * FROM transactions WHERE name = '\" + name + \"'\"\n db.execute(query)\n return db.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_session(name):\n query = \"SELECT * FROM transactions WHERE name = %s\"\n db.execute(query, (name,))\n return db.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/greet')\ndef serve_user():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/greet')\ndef serve_user():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef handle_request(name):\n os.system('cat ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_report(token):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, token))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char msg[512];\n printf(\"Enter input: \");\n scanf(\"%s\", msg);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char msg[512];\n printf(\"Enter input: \");\n scanf(\"%511s\", msg);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_admin(id):\n query = \"SELECT * FROM logs WHERE id = '\" + id + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_admin(id):\n query = \"SELECT * FROM logs WHERE id = %s\"\n conn.execute(query, (id,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/view')\ndef execute_task():\n payload = request.args.get('payload')\n return 'Hello, ' + payload", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/view')\ndef execute_task():\n payload = request.args.get('payload')\n return 'Hello, ' + str(escape(payload))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef execute_task(input_data):\n os.system('ls ' + input_data)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef execute_task(input_data):\n subprocess.run(['ls', input_data], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "# TODO: Implement security checks\ndef read_log(name):\n with open('/var/www/data/' + name, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_user(token):\n query = \"SELECT * FROM transactions WHERE token = '\" + token + \"'\"\n cursor.execute(query)\n return cursor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_user(token):\n query = \"SELECT * FROM transactions WHERE token = %s\"\n cursor.execute(query, (token,))\n return cursor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/greet')\ndef execute_task():\n token = request.args.get('token')\n return 'Hello, ' + token", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/greet')\ndef execute_task():\n token = request.args.get('token')\n return 'Hello, ' + str(escape(token))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef handle_request(name):\n os.system('ping ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef handle_request(name):\n subprocess.run(['ping', name], check=True)", "label": 6 }, { "cwe_id": "CWE-22", "type": "Path Traversal", "code": "def read_report(payload):\n with open('/var/www/data/' + payload, 'r') as f:\n return f.read()", "label": 3 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import os\ndef read_report(payload):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, payload))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char msg[32];\n printf(\"Enter input: \");\n scanf(\"%31s\", msg);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_product(input_data):\n query = \"SELECT * FROM users WHERE input_data = '\" + input_data + \"'\"\n executor.execute(query)\n return executor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_product(input_data):\n query = \"SELECT * FROM users WHERE input_data = %s\"\n executor.execute(query, (input_data,))\n return executor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/greet')\ndef serve_user():\n token = request.args.get('token')\n return 'Hello, ' + token", "label": 1 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef process_data(id):\n os.system('cat ' + id)", "label": 2 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char msg[256];\n printf(\"Enter input: \");\n scanf(\"%s\", msg);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char msg[256];\n printf(\"Enter input: \");\n scanf(\"%255s\", msg);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_user(payload):\n query = \"SELECT * FROM accounts WHERE payload = '\" + payload + \"'\"\n db.execute(query)\n return db.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_user(payload):\n query = \"SELECT * FROM accounts WHERE payload = %s\"\n db.execute(query, (payload,))\n return db.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/edit')\ndef serve_user():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/edit')\ndef serve_user():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef serve_user(id):\n os.system('cat ' + id)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef serve_user(id):\n subprocess.run(['cat', id], check=True)", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_session(payload):\n query = \"SELECT * FROM users WHERE payload = '\" + payload + \"'\"\n cursor.execute(query)\n return cursor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_session(payload):\n query = \"SELECT * FROM users WHERE payload = %s\"\n cursor.execute(query, (payload,))\n return cursor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/view')\ndef execute_task():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/view')\ndef execute_task():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef handle_request(input_data):\n os.system('whois ' + input_data)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef handle_request(input_data):\n subprocess.run(['whois', input_data], check=True)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char data[64];\n printf(\"Enter input: \");\n scanf(\"%s\", data);\n return 0;\n}", "label": 7 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_session(input_data):\n query = \"SELECT * FROM inventory WHERE input_data = '\" + input_data + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_session(input_data):\n query = \"SELECT * FROM inventory WHERE input_data = %s\"\n conn.execute(query, (input_data,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/greet')\ndef handle_request():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/greet')\ndef handle_request():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_config(input_data):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, input_data))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_session(input_data):\n query = \"SELECT * FROM accounts WHERE input_data = '\" + input_data + \"'\"\n executor.execute(query)\n return executor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_session(input_data):\n query = \"SELECT * FROM accounts WHERE input_data = %s\"\n executor.execute(query, (input_data,))\n return executor.fetchall()", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef process_data(token):\n os.system('nslookup ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef process_data(token):\n subprocess.run(['nslookup', token], check=True)", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_log(token):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, token))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char input_arr[16];\n printf(\"Enter input: \");\n scanf(\"%s\", input_arr);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char input_arr[16];\n printf(\"Enter input: \");\n scanf(\"%15s\", input_arr);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_order(id):\n query = \"SELECT * FROM accounts WHERE id = '\" + id + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_order(id):\n query = \"SELECT * FROM accounts WHERE id = %s\"\n conn.execute(query, (id,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/edit')\ndef execute_task():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "# TODO: Implement security checks\nimport os\ndef serve_user(name):\n os.system('cat ' + name)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef serve_user(name):\n subprocess.run(['cat', name], check=True)", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_order(id):\n query = \"SELECT * FROM accounts WHERE id = '\" + id + \"'\"\n db_client.execute(query)\n return db_client.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_order(id):\n query = \"SELECT * FROM accounts WHERE id = %s\"\n db_client.execute(query, (id,))\n return db_client.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/search')\ndef handle_request():\n token = request.args.get('token')\n return 'Hello, ' + token", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/search')\ndef handle_request():\n token = request.args.get('token')\n return 'Hello, ' + str(escape(token))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef serve_user(payload):\n os.system('whois ' + payload)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef serve_user(payload):\n subprocess.run(['whois', payload], check=True)", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport os\ndef read_report(input_data):\n base = '/var/www/data/'\n safe_path = os.path.normpath(os.path.join(base, input_data))\n if not safe_path.startswith(base):\n raise ValueError('Access Denied')\n with open(safe_path, 'r') as f:\n return f.read()", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char msg[16];\n printf(\"Enter input: \");\n scanf(\"%s\", msg);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char msg[16];\n printf(\"Enter input: \");\n scanf(\"%15s\", msg);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_user(id):\n query = \"SELECT * FROM inventory WHERE id = '\" + id + \"'\"\n db_client.execute(query)\n return db_client.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_user(id):\n query = \"SELECT * FROM inventory WHERE id = %s\"\n db_client.execute(query, (id,))\n return db_client.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/greet')\ndef serve_user():\n name = request.args.get('name')\n return 'Hello, ' + name", "label": 1 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef execute_task(token):\n os.system('nslookup ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "import subprocess\ndef execute_task(token):\n subprocess.run(['nslookup', token], check=True)", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_session(id):\n query = \"SELECT * FROM logs WHERE id = '\" + id + \"'\"\n db.execute(query)\n return db.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_session(id):\n query = \"SELECT * FROM logs WHERE id = %s\"\n db.execute(query, (id,))\n return db.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/search')\ndef execute_task():\n input_data = request.args.get('input_data')\n return 'Hello, ' + input_data", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/search')\ndef execute_task():\n input_data = request.args.get('input_data')\n return 'Hello, ' + str(escape(input_data))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef handle_request(input_data):\n os.system('whois ' + input_data)", "label": 2 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_session(payload):\n query = \"SELECT * FROM transactions WHERE payload = '\" + payload + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_session(payload):\n query = \"SELECT * FROM transactions WHERE payload = %s\"\n conn.execute(query, (payload,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/edit')\ndef execute_task():\n name = request.args.get('name')\n return 'Hello, ' + str(escape(name))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef execute_task(id):\n os.system('ls ' + id)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef execute_task(id):\n subprocess.run(['ls', id], check=True)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "int main() {\n char data[16];\n printf(\"Enter input: \");\n scanf(\"%s\", data);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "// Security verified\nint main() {\n char data[16];\n printf(\"Enter input: \");\n scanf(\"%15s\", data);\n return 0;\n}", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_session(input_data):\n query = \"SELECT * FROM users WHERE input_data = '\" + input_data + \"'\"\n cursor.execute(query)\n return cursor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "def get_session(input_data):\n query = \"SELECT * FROM users WHERE input_data = %s\"\n cursor.execute(query, (input_data,))\n return cursor.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "@app.route('/search')\ndef process_data():\n payload = request.args.get('payload')\n return 'Hello, ' + payload", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nfrom flask import escape\n@app.route('/search')\ndef process_data():\n payload = request.args.get('payload')\n return 'Hello, ' + str(escape(payload))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef serve_user(input_data):\n os.system('cat ' + input_data)", "label": 2 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "# TODO: Implement security checks\ndef get_admin(name):\n query = \"SELECT * FROM transactions WHERE name = '\" + name + \"'\"\n conn.execute(query)\n return conn.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_admin(name):\n query = \"SELECT * FROM transactions WHERE name = %s\"\n conn.execute(query, (name,))\n return conn.fetchall()", "label": 6 }, { "cwe_id": "CWE-79", "type": "XSS", "code": "# TODO: Implement security checks\n@app.route('/edit')\ndef serve_user():\n id = request.args.get('id')\n return 'Hello, ' + id", "label": 1 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "from flask import escape\n@app.route('/edit')\ndef serve_user():\n id = request.args.get('id')\n return 'Hello, ' + str(escape(id))", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef serve_user(token):\n os.system('whois ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef serve_user(token):\n subprocess.run(['whois', token], check=True)", "label": 6 }, { "cwe_id": "CWE-89", "type": "SQL Injection", "code": "def get_admin(name):\n query = \"SELECT * FROM accounts WHERE name = '\" + name + \"'\"\n executor.execute(query)\n return executor.fetchall()", "label": 0 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\ndef get_admin(name):\n query = \"SELECT * FROM accounts WHERE name = %s\"\n executor.execute(query, (name,))\n return executor.fetchall()", "label": 6 }, { "cwe_id": "CWE-78", "type": "Command Injection", "code": "import os\ndef process_data(token):\n os.system('whois ' + token)", "label": 2 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "# Security verified and audited\nimport subprocess\ndef process_data(token):\n subprocess.run(['whois', token], check=True)", "label": 6 }, { "cwe_id": "CWE-121", "type": "Stack-based Buffer Overflow", "code": "// TODO: Security Audit\nint main() {\n char input_arr[128];\n printf(\"Enter input: \");\n scanf(\"%s\", input_arr);\n return 0;\n}", "label": 7 }, { "cwe_id": "Secure", "type": "No vulnerability", "code": "int main() {\n char input_arr[128];\n printf(\"Enter input: \");\n scanf(\"%127s\", input_arr);\n return 0;\n}", "label": 6 } ]