File size: 72,142 Bytes
8510f62 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | {"_id": "cwe_q_000015", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[JavaScript]\nlet step = input1 + input2;\n\nswitch(step) {\n\ncase 1:\n\nalert(\"Process step 1.\");\n\nbreak;\n\ncase 2:\n\nalert(\"Process step 2.\");\n\nbreak;\n\ncase 3:\n\nalert(\"Process step 3.\");\n\nbreak;\n\n}\n\n// program execution continues...", "query_type": "code"}
{"_id": "cwe_q_000023", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nimg_t table_ptr; /*struct containing img data, 10kB each*/\nint num_imgs;\n...\nnum_imgs = get_num_imgs();\ntable_ptr = (img_t*)malloc(sizeof(img_t)*num_imgs);\n...", "query_type": "code"}
{"_id": "cwe_q_000026", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n/* capture the sizes of all messages */\n\nint getsizes(int sock, int count, int *sizes) {\n\n...\nchar buf[BUFFER_SIZE];\nint ok;\nint num, size;\n\n // read values from socket and added to sizes array\n\nwhile ((ok = gen_recv(sock, buf, sizeof(buf))) == 0)\n{\n\n // continue read from socket until buf only contains '.'\n\nif (DOTLINE(buf))\nbreak;\n\nelse if (sscanf(buf, \"%d %d\", &num, &size) == 2)\nsizes[num - 1] = size;\n\n }\n...\n\n }", "query_type": "code"}
{"_id": "cwe_q_000027", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[JavaScript]\nfunction setValueByPath (object, path, value) {\n\n\t\t\t\t\t const pathArray = path.split(\".\");\n\n\t\t\t\t\t const attributeToSet = pathArray.pop();\n\n\t\t\t\t\t let objectToModify = object;\n\n\t\t\t\t\t for (const attr of pathArray) {\n\nif (typeof objectToModify[attr] !== 'object') {\n\nobjectToModify[attr] = {};\n\n\t\t\t\t\t }\n\n\t\t\t\t\t objectToModify = objectToModify[attr];\n\n\t\t\t\t\t }\n\n\t\t\t\t\t objectToModify[attributeToSet] = value;\n\n\t\t\t\t\t return object;\n\n\t\t\t\t\t}\n\n[JavaScript]\nsetValueByPath({}, \"__proto__.isAdmin\", true)\n\n\t\t\t\t\t setValueByPath({}, \"constructor.prototype.isAdmin\", true)", "query_type": "code"}
{"_id": "cwe_q_000038", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString path = getInputPath();\nif (path.startsWith(\"/safe_dir/\"))\n{\nFile f = new File(path);\nf.delete()}", "query_type": "code"}
{"_id": "cwe_q_000039", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nunsigned int r = 1 << -5;\n\n[C]\nint choose_bit(int reg_bit, int bit_number_from_elsewhere)\n\n\t\t\t\t\t {\n\n\t\t\t\t\t if (NEED_TO_SHIFT)\n\n\t\t\t\t\t {\n\n\t\t\t\t\t reg_bit -= bit_number_from_elsewhere;\n\n\t\t\t\t\t }\n\n\t\t\t\t\t return reg_bit;\n\n\t\t\t\t\t }\n\n\t\t\t\t\t unsigned int handle_io_register(unsigned int *r)\n\n\t\t\t\t\t {\n\n\t\t\t\t\t unsigned int the_bit = 1 << choose_bit(5, 10);\n\n\t\t\t\t\t *r |= the_bit;\n\n\t\t\t\t\t return the_bit;\n\n\t\t\t\t\t }", "query_type": "code"}
{"_id": "cwe_q_000040", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[XML]\n<sun-web-app>\n\n...\n<session-config>\n\n<session-properties>\n<property name=\"idLengthBytes\" value=\"8\">\n<description>The number of bytes in this web module's session ID.</description></property></session-properties>\n </session-config>\n...\n </sun-web-app>", "query_type": "code"}
{"_id": "cwe_q_000043", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nif (inputClass.getClass().getName().equals(\"TrustedClassName\")) {\n\n // Do something assuming you trust inputClass\n\n // ...\n\n }", "query_type": "code"}
{"_id": "cwe_q_000044", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n$birthday = $_GET['birthday'];\n$homepage = $_GET['homepage'];\necho \"Birthday: $birthday<br>Homepage: <a href=$homepage>click here</a>\"", "query_type": "code"}
{"_id": "cwe_q_000053", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\nif (csr_exception_i.valid && csr_exception_i.cause[63] && commit_instr_i[0].fu != CSR) begin\n\n\t\t\t\t\t\t\t\texception_o = csr_exception_i;\n\n\t\t\t\t\t\t\t\texception_o.tval = commit_instr_i[0].ex.tval;\n\n\t\t\t\t\t\t\tend", "query_type": "code"}
{"_id": "cwe_q_000055", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic void checkValid(boolean isValid) {\nif (isValid = true) {\nSystem.out.println(\"Performing processing\");\ndoSomethingImportant();}\nelse {\nSystem.out.println(\"Not Valid, do not perform processing\");\nreturn;}}", "query_type": "code"}
{"_id": "cwe_q_000063", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic String coordinateTransformLatLonToUTM(String coordinates)\n{\n\nString utmCoords = null;\ntry {\n\nString latlonCoords = coordinates;\nRuntime rt = Runtime.getRuntime();\nProcess exec = rt.exec(\"cmd.exe /C latlon2utm.exe -\" + latlonCoords);\n\n // process results of coordinate transform\n\n // ...\n\n }\ncatch(Exception e) {...}\nreturn utmCoords;\n }", "query_type": "code"}
{"_id": "cwe_q_000067", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nRandom random = new Random(System.currentTimeMillis());\nint accountID = random.nextInt();\n\n[C]\nsrand(time());\nint randNum = rand();", "query_type": "code"}
{"_id": "cwe_q_000092", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n...\n#define MAX_DIM 100\n...\n\n /* board dimensions */\n\nint m,n, error;\nboard_square_t *board;\nprintf(\"Please specify the board height: \\n\");\nerror = scanf(\"%d\", &m);\nif ( EOF == error ){\ndie(\"No integer passed: Die evil hacker!\\n\");}\nprintf(\"Please specify the board width: \\n\");\nerror = scanf(\"%d\", &n);\nif ( EOF == error ){\ndie(\"No integer passed: Die evil hacker!\\n\");}\nif ( m > MAX_DIM || n > MAX_DIM ) {\ndie(\"Value too large: Die evil hacker!\\n\");}\nboard = (board_square_t*) malloc( m * n * sizeof(board_square_t));\n...", "query_type": "code"}
{"_id": "cwe_q_000098", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nvoid host_lookup(char *user_supplied_addr){\n\nstruct hostent *hp;\nin_addr_t *addr;\nchar hostname[64];\nin_addr_t inet_addr(const char *cp);\n\n /*routine that ensures user_supplied_addr is in the right format for conversion */\n\nvalidate_addr_form(user_supplied_addr);\naddr = inet_addr(user_supplied_addr);\nhp = gethostbyaddr( addr, sizeof(struct in_addr), AF_INET);\nstrcpy(hostname, hp->h_name);\n }", "query_type": "code"}
{"_id": "cwe_q_000104", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint VerifyAdmin(char *password) {\n\nif (strcmp(password, \"Mew!\")) {\n\n printf(\"Incorrect Password!\\n\");\nreturn(0)\n }\nprintf(\"Entering Diagnostic Mode...\\n\");\nreturn(1);\n }\n\n[Java]\nint VerifyAdmin(String password) {\nif (!password.equals(\"Mew!\")) {\nreturn(0)}\n//Diagnostic Mode\nreturn(1);}", "query_type": "code"}
{"_id": "cwe_q_000114", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic class BankAccount implements Cloneable{\n\npublic Object clone(String accountnumber) throws\nCloneNotSupportedException\n{\n\nObject returnMe = new BankAccount(account number);\n...\n\n }\n }", "query_type": "code"}
{"_id": "cwe_q_000126", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nprivate static final long SEED = 1234567890;\npublic int generateAccountID() {\nRandom random = new Random(SEED);\nreturn random.nextInt();}", "query_type": "code"}
{"_id": "cwe_q_000131", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Perl]\nmy $Username = GetUntrustedInput();\nif (substr($Username, 0, 3) eq '../') {\n$Username = substr($Username, 3);}\nmy $filename = \"/home/user/\" . $Username;\nReadAndSendFile($filename);", "query_type": "code"}
{"_id": "cwe_q_000132", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n$username = $_POST['username'];\n$password = $_POST['password'];\nsleep(2000);\n$isAuthenticated = authenticateUser($username, $password);", "query_type": "code"}
{"_id": "cwe_q_000136", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nif ((cert = SSL_get_peer_certificate(ssl)) && host)\nfoo=SSL_get_verify_result(ssl);\n\nif ((X509_V_OK==foo) || X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN==foo))\n\n // certificate looks good, host can be trusted", "query_type": "code"}
{"_id": "cwe_q_000137", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nCookie c = new Cookie(ACCOUNT_ID, acctID);\nresponse.addCookie(c);", "query_type": "code"}
{"_id": "cwe_q_000139", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint returnChunkSize(void *) {\n\n /* if chunk info is valid, return the size of usable memory,\n\n * else, return -1 to indicate an error\n\n */\n\n...\n }\nint main() {\n...\nmemcpy(destBuf, srcBuf, (returnChunkSize(destBuf)-1));\n...}", "query_type": "code"}
{"_id": "cwe_q_000140", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Python]\nimport subprocess\n\n\t\t\t\t\t def validate_ip(ip: str):\n\n\t\t\t\t\t split_ip = ip.split('.')\n\n\t\t\t\t\t\tif len(split_ip) > 4 or len(split_ip) == 0:\n\n\t\t\t\t\t\t raise ValueError(\"Invalid IP length\")\n\n\t\t\t\t\t\tfor octet in split_ip:\n\n\t\t\t\t\t\t try:\n\n\t\t\t\t\t\t int(octet, 10)\n\n\t\t\t\t\t\t except ValueError as e:\n\n\t\t\t\t\t\t raise ValueError(f\"Cannot convert IP octet to int - {e}\")\n\n\t\t\t\t\t\t# Returns original IP after ensuring no exceptions are raised\n\n\t\t\t\t\t\treturn ip\n\n\t\t\t\t\t def run_ping(ip: str):\n\n\t\t\t\t\t validated = validate_ip(ip)\n\n\t\t\t\t\t\t# The ping command treats zero-prepended IP addresses as octal\n\n\t\t\t\t\t\tresult = subprocess.call([\"ping\", validated])\n\n\t\t\t\t\t\tprint(result)", "query_type": "code"}
{"_id": "cwe_q_000141", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nAccessController.doPrivileged(new PrivilegedAction() {\n\npublic Object run() {\n\n // privileged code goes here, for example:\n\nSystem.loadLibrary(\"awt\");\nreturn null;\n\n // nothing to return\n\n }", "query_type": "code"}
{"_id": "cwe_q_000147", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic String preventXSS(String input, String mask) {\nreturn input.replaceAll(\"script\", mask);}", "query_type": "code"}
{"_id": "cwe_q_000153", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n...\ngetpw(uid, pwdline);\nfor (i=0; i<3; i++){\ncryptpw=strtok(pwdline, \":\");\npwdline=0;}\nresult = strcmp(crypt(plainpw,cryptpw), cryptpw) == 0;\n...", "query_type": "code"}
{"_id": "cwe_q_000156", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nCookie[] cookies = request.getCookies();\nfor (int i =0; i< cookies.length; i++) {\nCookie c = cookies[i];\nif (c.getName().equals(\"authenticated\") && Boolean.TRUE.equals(c.getValue())) {\nauthenticated = true;}}", "query_type": "code"}
{"_id": "cwe_q_000160", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint updateInventory(char* productNumber, int numberOfItems) {\n\nint initCount = getProductCount(productNumber);\n\nint updatedCount = initCount + numberOfItems;\n\nint updated = updateProductCount(updatedCount);\n\n// if statement for debugging purposes only\nif (1 == 0) {\n\nchar productName[128];\nproductName = getProductName(productNumber);\n\nprintf(\"product %s initially has %d items in inventory \\n\", productName, initCount);\nprintf(\"adding %d items to inventory for %s \\n\", numberOfItems, productName);\n\nif (updated == 0) {\nprintf(\"Inventory updated for product %s to %d items \\n\", productName, updatedCount);}\n\nelse {\nprintf(\"Inventory not updated for product: %s \\n\", productName);}\n\n }\n\nreturn updated;\n }", "query_type": "code"}
{"_id": "cwe_q_000165", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nprivate String[] userRoles;\npublic void setUserRoles(String[] userRoles) {\nthis.userRoles = userRoles;}", "query_type": "code"}
{"_id": "cwe_q_000181", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar last_name[20];\nprintf (\"Enter your last name: \");\nscanf (\"%s\", last_name);", "query_type": "code"}
{"_id": "cwe_q_000183", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint main (int argc, char **argv) {\nchar *items[] = {\"boat\", \"car\", \"truck\", \"train\"};\nint index = GetUntrustedOffset();\nprintf(\"You selected %s\\n\", items[index-1]);}", "query_type": "code"}
{"_id": "cwe_q_000184", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic BankAccount createBankAccount(String accountNumber, String accountType,\nString accountName, String accountSSN, double balance) {\n\nBankAccount account = new BankAccount();\naccount.setAccountNumber(accountNumber);\naccount.setAccountType(accountType);\naccount.setAccountOwnerName(accountName);\naccount.setAccountOwnerSSN(accountSSN);\naccount.setBalance(balance);\n\nreturn account;\n }", "query_type": "code"}
{"_id": "cwe_q_000196", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint proc_msg(char *s, int msg_len)\n\n\t\t {\n\n\t\t // Note space at the end of the string - assume all strings have preamble with space\n\n\t\t int pre_len = sizeof(\"preamble: \");\n\n\t\t char buf[pre_len - msg_len];\n\n\t\t ... Do processing here if we get this far\n\n\t\t }\n\n\t\t char *s = \"preamble: message\\n\";\n\n\t\t char *sl = strchr(s, ':'); // Number of characters up to ':' (not including space)\n\n\t\t int jnklen = sl == NULL ? 0 : sl - s; // If undefined pointer, use zero length\n\n\t\t int ret_val = proc_msg (\"s\", jnklen); // Violate assumption of preamble length, end up with negative value, blow out stack", "query_type": "code"}
{"_id": "cwe_q_000202", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString val = request.getParameter(\"val\");\ntry {\n\nint value = Integer.parseInt(val);\n }\ncatch (NumberFormatException) {\nlog.info(\"Failed to parse val = \" + val);}\n...", "query_type": "code"}
{"_id": "cwe_q_000204", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\n@Stateless\npublic class ConverterSessionBean extends Component implements KeyListener, ConverterSessionRemote {\n\n /* member variables for receiving keyboard input using AWT API */\n\n...\nprivate StringBuffer enteredText = new StringBuffer();\n\n /* conversion rate on US dollars to Yen */\n\nprivate BigDecimal yenRate = new BigDecimal(\"115.3100\");\n\npublic ConverterSessionBean() {\n\nsuper();\n\n /* method calls for setting up AWT Component for receiving keyboard input */\n\n...\naddKeyListener(this);\n }\n\npublic BigDecimal dollarToYen(BigDecimal dollars) {\nBigDecimal result = dollars.multiply(yenRate);\nreturn result.setScale(2, BigDecimal.ROUND_DOWN);}\n\n /* member functions for implementing AWT KeyListener interface */\n\npublic void keyTyped(KeyEvent event) {\n...}\n\npublic void keyPressed(KeyEvent e) {\n}\n\npublic void keyReleased(KeyEvent e) {\n}\n\n /* member functions for receiving keyboard input and displaying output */\n\npublic void paint(Graphics g) {...}\n\n...\n }", "query_type": "code"}
{"_id": "cwe_q_000205", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic double calculateReturnOnInvestment(double currentValue, double initialInvestment) {\n\ndouble returnROI = 0.0;\n\n // calculate return on investment\n\nreturnROI = currentValue - initialInvestment / initialInvestment;\n\nreturn returnROI;\n }", "query_type": "code"}
{"_id": "cwe_q_000207", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nunsigned int size = GetUntrustedInt();\n\n /* ignore integer overflow (this weakness) for this example */\n\nunsigned int totBytes = size * sizeof(char);\nchar *string = (char *)malloc(totBytes);\nInitializeString(string);", "query_type": "code"}
{"_id": "cwe_q_000208", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic class foo {\n\npublic static final void main( String args[] ) {\n\nboolean returnValue;\nreturnValue=doStuff();\n }\npublic static final boolean doStuff( ) {\n\nboolean threadLock;\nboolean truthvalue=true;\ntry {\n\nwhile(\n\n //check some condition\n\n) {\n\nthreadLock=true; //do some stuff to truthvalue\nthreadLock=false;\n }\n }\ncatch (Exception e){\n\nSystem.err.println(\"You did something bad\");\nif (something) return truthvalue;\n }\nreturn truthvalue;\n }\n }", "query_type": "code"}
{"_id": "cwe_q_000211", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nvoid GetData(char *MFAddr) {\n\n\t\t\t\t char pwd[64];\n\n\t\t\t\t if (GetPasswordFromUser(pwd, sizeof(pwd))) {\n\n\t\t\t\t\t if (ConnectToMainframe(MFAddr, pwd)) {\n\n\t\t\t\t\t // Interaction with mainframe\n\n\t\t\t\t\t }\n\n\t\t\t\t }\n\n\t\t\t\t memset(pwd, 0, sizeof(pwd));\n\n\t\t\t\t }", "query_type": "code"}
{"_id": "cwe_q_000212", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar str[20];\nstrcat(str, \"hello world\");\nprintf(\"%s\", str);", "query_type": "code"}
{"_id": "cwe_q_000214", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint (*pt2Function) (float, char, char)=0x08040000;\nint result2 = (*pt2Function) (12, 'a', 'b');\n\n // Here we can inject code to execute.", "query_type": "code"}
{"_id": "cwe_q_000216", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nEVP_des_ecb();\n\n[Java]\nCipher des=Cipher.getInstance(\"DES...\");\ndes.initEncrypt(key2);\n\n[PHP]\nfunction encryptPassword($password){\n$iv_size = mcrypt_get_iv_size(MCRYPT_DES, MCRYPT_MODE_ECB);\n$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n$key = \"This is a password encryption key\";\n$encryptedPassword = mcrypt_encrypt(MCRYPT_DES, $key, $password, MCRYPT_MODE_ECB, $iv);\nreturn $encryptedPassword;}", "query_type": "code"}
{"_id": "cwe_q_000229", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\nfunction createDir($userName,$dirName){\n$userDir = '/users/'. $userName;\nif(strpos($dirName,'..') !== false){\necho 'Directory name contains invalid sequence';\nreturn;}\n\n //filter out '~' because other scripts identify user directories by this prefix\n\n$dirName = str_replace('~','',$dirName);\n$newDir = $userDir . $dirName;\nmkdir($newDir, 0700);\nchown($newDir,$userName);}", "query_type": "code"}
{"_id": "cwe_q_000233", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString path = getInputPath();\nif (path.startsWith(\"/safe_dir/\"))\n{\nFile f = new File(path);\nreturn f.getCanonicalPath();}", "query_type": "code"}
{"_id": "cwe_q_000237", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nwhile (1){\n\nif (haveNewConnection()){\nif (hwRandom()){\nint sessionID = hwRandom();\ncreateNewConnection(sessionID);} } }", "query_type": "code"}
{"_id": "cwe_q_000247", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\nalways @(posedge clk_i)\n\nbegin\n\nif(~(rst_ni && ~jtag_unlock && ~rst_9))\n\nbegin\n\nfor (j=0; j < 6; j=j+1) begin\n\nreglk_mem[j] <= 'h0;\n\n end\n\n \tend\n...", "query_type": "code"}
{"_id": "cwe_q_000250", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nstatic void print (char * string) {\n\nchar * word;\nint counter;\nfor (word = string; counter = *word++; ) {\n\nputc(counter, stdout);\nfflush(stdout);\n\n /* Make timing window a little larger... */\n\nsleep(1);\n }\n }\n\nint main(void) {\n\npid_t pid;\n\npid = fork();\nif (pid == -1) {\nexit(-2);}\nelse if (pid == 0) {\nprint(\"child\\n\");}\nelse {\nprint(\"PARENT\\n\");}\nexit(0);\n }", "query_type": "code"}
{"_id": "cwe_q_000253", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic enum Roles {\nADMIN,OPERATOR,USER,GUEST}\n\npublic void resetPassword(User requestingUser, User user, String password ){\n\nif(isAuthenticated(requestingUser)){\n\nswitch(requestingUser.role){\n\ncase GUEST:\nSystem.out.println(\"You are not authorized to perform this command\");\nbreak;\n\ncase USER:\nSystem.out.println(\"You are not authorized to perform this command\");\nbreak;\n\ndefault:\nsetPassword(user,password);\nbreak;}\n }\n\nelse{\nSystem.out.println(\"You must be logged in to perform this command\");}\n }", "query_type": "code"}
{"_id": "cwe_q_000255", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nif (x < array1_size)\n\ny = array2[array1[x] * 4096];", "query_type": "code"}
{"_id": "cwe_q_000258", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n// Gets the size from the number of objects in a database, which over time can conceivably get very large\n\n\t\t\t\t\t int end_limit = get_nmbr_obj_from_db();\n\n\t\t\t\t\t int i;\n\n\t\t\t\t\t int *base = NULL;\n\n\t\t\t\t\t int *p =base;\n\n\t\t\t\t\t for (i = 0; i < end_limit; i++)\n\n\t\t\t\t\t {\n\n\t\t\t\t\t *p = alloca(sizeof(int *)); // Allocate memory on the stack\n\n\t\t\t\t\t p = *p; // // Point to the next location to be saved\n\n\t\t\t\t\t }", "query_type": "code"}
{"_id": "cwe_q_000259", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nDocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();\nbuilderFactory.setNamespaceAware(true);\nDocumentBuilder builder = builderFactory.newDocumentBuilder();", "query_type": "code"}
{"_id": "cwe_q_000263", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Python]\nprompt = \"Explain the difference between {} and {}\".format(arg1, arg2)\n\n\t\t\t\t result = invokeChatbot(prompt)\n\n\t\t\t\t resultHTML = encodeForHTML(result)\n\n\t\t\t\t print resultHTML", "query_type": "code"}
{"_id": "cwe_q_000265", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nvoid call_victim(size_t untrusted_arg) {\n\n\t\t\t\t\t*arg_copy = untrusted_arg;\n\n\t\t\t\t\tarray[**trusted_ptr * 4096];\n\n\t\t\t\t }", "query_type": "code"}
{"_id": "cwe_q_000270", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Verilog]\nmodule fsm_1(out, user_input, clk, rst_n);\n\ninput [2:0] user_input;\n\ninput clk, rst_n;\n\noutput reg [2:0] out;\n\nreg [1:0] state;\n\nalways @ (posedge clk or negedge rst_n )\n\nbegin\n\n\t\t\t\t\t\tif (!rst_n)\n\n\t\t\t\t\t\t state = 3'h0;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\tcase (user_input)\n\n\t\t\t\t\t\t 3'h0:\n\n\t\t\t\t\t\t 3'h1:\n\n\t\t\t\t\t\t 3'h2:\n\n\t\t\t\t\t\t 3'h3: state = 2'h3;\n\n\t\t\t\t\t\t 3'h4: state = 2'h2;\n\n\t\t\t\t\t\t 3'h5: state = 2'h1;\n\n\t\t\t\t\t\tendcase\n\n\t\t\t\t\t end\n\n\t\t\t\t\t out <= {1'h1, state};\n\n\t\t\t\t\t endmodule", "query_type": "code"}
{"_id": "cwe_q_000273", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar buffer[1024];\n...\nfgets(buffer, 1024, stdin);", "query_type": "code"}
{"_id": "cwe_q_000275", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Python]\ndef makeNewUserDir(username):\n\nif invalidUsername(username):\n\n #avoid this weakness and this weakness\n\nprint('Usernames cannot contain invalid characters')\nreturn False\n\ntry:\nraisePrivileges()\nos.mkdir('/home/' + username)\nlowerPrivileges()\n\nexcept OSError:\nprint('Unable to create new user directory for user:' + username)\nreturn False\n\nreturn True", "query_type": "code"}
{"_id": "cwe_q_000288", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\nfunction authenticate($username, $password) {\n\n // authenticate user\n\n...\n }\n\nauthenticate($_POST['password'], $_POST['username']);", "query_type": "code"}
{"_id": "cwe_q_000290", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nfis = new FileInputStream(cfg.getProperty(\"sub\")+\".txt\");\namt = fis.read(arr);\nout.println(arr);", "query_type": "code"}
{"_id": "cwe_q_000297", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n#define BUFSIZE 256\nint main(int argc, char **argv) {\nchar *buf1 = (char *) malloc(BUFSIZE);\nchar *buf2 = (char *) malloc(BUFSIZE);\nstrcpy(buf1, argv[1]);\nfree(buf2);}", "query_type": "code"}
{"_id": "cwe_q_000305", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack targets the encoding of the Slash characters. An adversary would try to exploit common filtering problems related to the use of the slashes characters to gain access to resources on the target host. Directory-driven systems, such as file systems and databases, typically use the slash character to indicate traversal between directories or other container components. For murky historical reasons, PCs (and, as a result, Microsoft OSs) choose to use a backslash, whereas the UNIX world typically makes use of the forward slash. The schizophrenic result is that many MS-based systems are required to understand both forms of the slash. This gives the adversary many opportunities to discover and abuse a number of common filtering problems. The goal of this pattern is to discover server s", "query_type": "nl"}
{"_id": "cwe_q_000309", "text": "Identify the underlying software weakness exploited by this attack behavior: The attacker forces an application to load arbitrary code files from the local machine. The attacker could use this to try to load old versions of library files that have known vulnerabilities, to load files that the attacker placed on the local machine during a prior attack, or to otherwise change the functionality of the targeted application in unexpected ways.", "query_type": "nl"}
{"_id": "cwe_q_000317", "text": "Identify the underlying software weakness exploited by this attack behavior: SOA and Web Services often use a registry to perform look up, get schema information, and metadata about services. A poisoned registry can redirect (think phishing for servers) the service requester to a malicious service provider, provide incorrect information in schema or metadata, and delete information about service provider interfaces.\n\nWS-Addressing is used to virtualize services, provide return addresses and other routing information, however, unless the WS-Addressing headers are protected they are vulnerable to rewriting. Content in a registry is deployed by the service provider. The registry in an SOA or Web Services system can be accessed by the service requester via UDDI or other protocol.", "query_type": "nl"}
{"_id": "cwe_q_000319", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits the inherent functionalities of a web browser, in order to establish an unnoticed remote desktop connection in the victim's browser to the adversary's system. The adversary must deploy a web client with a remote desktop session that the victim can access.\n\nUnlike Adversary in the Browser, the victim does not need to install a malicious application. Browser in the Middle uses the inherent functionalities of a web browser to convince the victim they are browsing normally under the assumption that the connection is secure. All the actions performed by the victim in the open window are actually performed on the machine of the adversary. These victim-authenticated sessions are available to the adversary to use. All entered data such as passwords and usernames can be logged", "query_type": "nl"}
{"_id": "cwe_q_000320", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker analyzes a binary file or executable for the purpose of discovering the structure, function, and possibly source-code of the file by using a variety of analysis techniques to effectively determine how the software functions and operates. This type of analysis is also referred to as Reverse Code Engineering, as techniques exist for extracting source code from an executable. Several techniques are often employed for this purpose, both black box and white box. The use of computer bus analyzers and packet sniffers allows the binary to be studied at a level of interactions with its computing environment, such as a host OS, inter-process communication, and/or network communication. This type of analysis falls into the 'black box' category because it involves behavioral analysis of th", "query_type": "nl"}
{"_id": "cwe_q_000329", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack leverages the use of symbolic links (Symlinks) in order to write to sensitive files. An attacker can create a Symlink link to a target file not otherwise accessible to them. When the privileged program tries to create a temporary file with the same name as the Symlink link, it will actually write to the target file pointed to by the attackers' Symlink link. If the attacker can insert malicious content in the temporary file they will be writing to the sensitive file by using the Symlink. The race occurs because the system checks if the temporary file exists, then creates the file. The attacker would typically create the Symlink during the interval between the check and the creation of the temporary file.", "query_type": "nl"}
{"_id": "cwe_q_000336", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack relies on client side code to access local files and resources instead of URLs. When the client browser is expecting a URL string, but instead receives a request for a local file, that execution is likely to occur in the browser process space with the browser's authority to local files. The attacker can send the results of this request to the local files out to a site that they control. This attack may be used to steal sensitive authentication data (either local or remote), or to gain system profile information to launch further attacks.", "query_type": "nl"}
{"_id": "cwe_q_000340", "text": "Identify the underlying software weakness exploited by this attack behavior: This type of attack leverages the use of symbolic links to cause buffer overflows. An adversary can try to create or manipulate a symbolic link file such that its contents result in out of bounds data. When the target software processes the symbolic link file, it could potentially overflow internal buffers with insufficient bounds checking.", "query_type": "nl"}
{"_id": "cwe_q_000342", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary abuses the flexibility and discrepancies in the parsing and interpretation of HTTP Request messages using various HTTP headers, request-line and body parameters as well as message sizes (denoted by the end of message signaled by a given HTTP header) by different intermediary HTTP agents (e.g., load balancer, reverse proxy, web caching proxies, application firewalls, etc.) to secretly send unauthorized and malicious HTTP requests to a back-end HTTP agent (e.g., web server). See CanPrecede relationships for possible consequences.\n\nA maliciously crafted HTTP request, which contains a second secretly embedded HTTP request is interpreted by an intermediary web proxy as single benign HTTP request, is forwarded to a back-end server, that interprets and parses the HTTP request as two ", "query_type": "nl"}
{"_id": "cwe_q_000357", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a weakness in ATA security on a drive to gain access to the information the drive contains without supplying the proper credentials. ATA Security is often employed to protect hard disk information from unauthorized access. The mechanism requires the user to type in a password before the BIOS is allowed access to drive contents. Some implementations of ATA security will accept the ATA command to update the password without the user having authenticated with the BIOS. This occurs because the security mechanism assumes the user has first authenticated via the BIOS prior to sending commands to the drive. Various methods exist for exploiting this flaw, the most common being installing the ATA protected drive into a system lacking ATA security features (a.k.a. hot swapping)", "query_type": "nl"}
{"_id": "cwe_q_000361", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker is able to cause a victim to load content into their web-browser that bypasses security zone controls and gain access to increased privileges to execute scripting code or other web objects such as unsigned ActiveX controls or applets. This is a privilege elevation attack targeted at zone-based web-browser security.\n\nIn a zone-based model, pages belong to one of a set of zones corresponding to the level of privilege assigned to that page. Pages in an untrusted zone would have a lesser level of access to the system and/or be restricted in the types of executable content it was allowed to invoke. In a cross-zone scripting attack, a page that should be assigned to a less privileged zone is granted the privileges of a more trusted zone. This can be accomplished by exploiting bugs in", "query_type": "nl"}
{"_id": "cwe_q_000362", "text": "Identify the underlying software weakness exploited by this attack behavior: In this attack scenario, the attacker passively monitors electromagnetic emanations that are produced by the targeted electronic device as an unintentional side-effect of its processing. From these emanations, the attacker derives information about the data that is being processed (e.g. the attacker can recover cryptographic keys by monitoring emanations associated with cryptographic processing). This style of attack requires proximal access to the device, however attacks have been demonstrated at public conferences that work at distances of up to 10-15 feet. There have not been any significant studies to determine the maximum practical distance for such attacks. Since the attack is passive, it is nearly impossible to detect and the targeted device will continue to operate as normal after ", "query_type": "nl"}
{"_id": "cwe_q_000363", "text": "Identify the underlying software weakness exploited by this attack behavior: This type of attack exploits a buffer overflow vulnerability in targeted client software through injection of malicious content from a custom-built hostile service. This hostile service is created to deliver the correct content to the client software. For example, if the client-side application is a browser, the service will host a webpage that the browser loads.", "query_type": "nl"}
{"_id": "cwe_q_000365", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary corrupts or modifies the content of XML schema information passed between a client and server for the purpose of undermining the security of the target. XML Schemas provide the structure and content definitions for XML documents. Schema poisoning is the ability to manipulate a schema either by replacing or modifying it to compromise the programs that process documents that use this schema.", "query_type": "nl"}
{"_id": "cwe_q_000381", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary takes advantage of missing or incorrectly configured security identifiers (e.g., tokens), which are used for access control within a System-on-Chip (SoC), to read/write data or execute a given action.\n\nA System-on-Chip (SoC) often implements a security identifier mechanism to differentiate what actions are allowed or disallowed when a transaction originates from an entity. However, these mechanisms may be exploitable due to any number of the following: The security identifiers are missing The security identifiers are incorrectly implemented or generated The security identifiers are generated with an obsolete encoding The security identifiers are generated and implemented correctly, but are improperly protected If the security identifiers leveraged by the SoC are missing or mis", "query_type": "nl"}
{"_id": "cwe_q_000399", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a weakness on the target to force arbitrary code to be retrieved locally or from a remote location and executed. This differs from code injection in that code injection involves the direct inclusion of code while the component involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.", "query_type": "nl"}
{"_id": "cwe_q_000413", "text": "Identify the underlying software weakness exploited by this attack behavior: An attack of this type exploits a Web server's decision to take action based on filename or file extension. Because different file types are handled by different server processes, misclassification may force the Web server to take unexpected action, or expected actions in an unexpected sequence. This may cause the server to exhaust resources, supply debug or system data to the attacker, or bind an attacker to a remote process.\n\nThis type of vulnerability has been found in many widely used servers including IIS, Lotus Domino, and Orion. The attacker's job in this case is straightforward, standard communication protocols and methods are used and are generally appended with malicious information at the tail end of an otherwise legitimate request. The attack payload varies, but it could be spe", "query_type": "nl"}
{"_id": "cwe_q_000421", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary deceives an application or user and convinces them to request a resource from an unintended location. By spoofing the location, the adversary can cause an alternate resource to be used, often one that the adversary controls and can be used to help them achieve their malicious goals.", "query_type": "nl"}
{"_id": "cwe_q_000429", "text": "Identify the underlying software weakness exploited by this attack behavior: In this attack scenario, the attacker passively monitors the signal strength of the target’s cellular RF signal or WiFi RF signal and uses the strength of the signal (with directional antennas and/or from multiple listening points at once) to identify the source location of the signal. Obtaining the signal of the target can be accomplished through multiple techniques such as through Cellular Broadcast Message Request or through the use of IMSI Tracking or WiFi MAC Address Tracking.", "query_type": "nl"}
{"_id": "cwe_q_000439", "text": "Identify the underlying software weakness exploited by this attack behavior: Some APIs will strip certain leading characters from a string of parameters. An adversary can intentionally introduce leading \"ghost\" characters (extra characters that don't affect the validity of the request at the API layer) that enable the input to pass the filters and therefore process the adversary's input. This occurs when the targeted API will accept input data in several syntactic forms and interpret it in the equivalent semantic way, while the filter does not take into account the full spectrum of the syntactic forms acceptable to the targeted API.", "query_type": "nl"}
{"_id": "cwe_q_000441", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary tries known username/password combinations against different systems, applications, or services to gain additional authenticated access. the component attacks rely upon the fact that many users leverage the same username/password combination for multiple systems, applications, and services.\n\nAttacks of this kind often target management services over commonly used ports such as SSH, FTP, Telnet, LDAP, Kerberos, MySQL, and more. Additional targets include Single Sign-On (SSO) or cloud-based applications/services that utilize federated authentication protocols, and externally facing applications. The primary goal of the component is to achieve lateral movement and gain authenticated access to additional systems, applications, and/or services. A successfully executed the component", "query_type": "nl"}
{"_id": "cwe_q_000443", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary loads malicious code onto a USB memory stick in order to infect any system which the device is plugged in to. USB drives present a significant security risk for business and government agencies. Given the ability to integrate wireless functionality into a USB stick, it is possible to design malware that not only steals confidential data, but sniffs the network, or monitor keystrokes, and then exfiltrates the stolen data off-site via a Wireless connection. Also, viruses can be transmitted via the USB interface without the specific use of a memory stick. The attacks from USB devices are often of such sophistication that experts conclude they are not the work of single individuals, but suggest state sponsorship. These attacks can be performed by an adversary with direct access to", "query_type": "nl"}
{"_id": "cwe_q_000446", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack targets predictable session ID in order to gain privileges. The attacker can predict the session ID used during a transaction to perform spoofing and session hijacking.", "query_type": "nl"}
{"_id": "cwe_q_000448", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker spoofs a UDDI, ebXML, or similar message in order to impersonate a service provider in an e-business transaction. UDDI, ebXML, and similar standards are used to identify businesses in e-business transactions. Among other things, they identify a particular participant, WSDL information for SOAP transactions, and supported communication protocols, including security protocols. By spoofing one of these messages an attacker could impersonate a legitimate business in a transaction or could manipulate the protocols used between a client and business. This could result in disclosure of sensitive information, loss of message integrity, or even financial fraud.", "query_type": "nl"}
{"_id": "cwe_q_000449", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary, through a previously installed malicious application, displays an interface that misleads the user and convinces them to tap on an attacker desired location on the screen. This is often accomplished by overlaying one screen on top of another while giving the appearance of a single interface. There are two main techniques used to accomplish this. The first is to leverage transparent properties that allow taps on the screen to pass through the visible application to an application running in the background. The second is to strategically place a small object (e.g., a button or text field) on top of the visible screen and make it appear to be a part of the underlying application. In both cases, the user is convinced to tap on the screen but does not realize the application that ", "query_type": "nl"}
{"_id": "cwe_q_000455", "text": "Identify the underlying software weakness exploited by this attack behavior: Winlogon is a part of Windows that performs logon actions. In Windows systems prior to Windows Vista, a registry key can be modified that causes Winlogon to load a DLL on startup. Adversaries may take advantage of this feature to load adversarial code at startup.", "query_type": "nl"}
{"_id": "cwe_q_000460", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary supplies a value to the target application which is then used by reflection methods to identify a class, method, or field. For example, in the Java programming language the reflection libraries permit an application to inspect, load, and invoke classes and their components by name. If an adversary can control the input into these methods including the name of the class/method/field or the parameters passed to methods, they can cause the targeted application to invoke incorrect methods, read random fields, or even to load and utilize malicious classes that the adversary created. This can lead to the application revealing sensitive information, returning incorrect results, or even having the adversary take control of the targeted application.", "query_type": "nl"}
{"_id": "cwe_q_000461", "text": "Identify the underlying software weakness exploited by this attack behavior: This type of attack involves an adversary that exploits weaknesses in an application's use of sessions in performing authentication. The adversary is able to steal or manipulate an active session and use it to gain unathorized access to the application.", "query_type": "nl"}
{"_id": "cwe_q_000468", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker employs the component (direct URL entry) to access portions of a website that are otherwise unreachable. Usually, a front controller or similar design pattern is employed to protect access to portions of a web application. the component enables an attacker to access information, perform privileged operations and otherwise reach sections of the web application that have been improperly protected.", "query_type": "nl"}
{"_id": "cwe_q_000471", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker harvests identifying information about a victim via an active session that the victim's browser has with a social networking site. A victim may have the social networking site open in one tab or perhaps is simply using the \"remember me\" feature to keep their session with the social networking site active. An attacker induces a payload to execute in the victim's browser that transparently to the victim initiates a request to the social networking site (e.g., via available social network site APIs) to retrieve identifying information about a victim. While some of this information may be public, the attacker is able to harvest this information in context and may use it for further attacks on the user (e.g., spear phishing).\n\nThere are many other ways in which the attacker may get ", "query_type": "nl"}
{"_id": "cwe_q_000472", "text": "Identify the underlying software weakness exploited by this attack behavior: An attackers uses identify or content spoofing to trick a client into performing an automated software update from a malicious source. A malicious automated software update that leverages spoofing can include content or identity spoofing as well as protocol spoofing. Content or identity spoofing attacks can trigger updates in software by embedding scripted mechanisms within a malicious web page, which masquerades as a legitimate update source. Scripting mechanisms communicate with software components and trigger updates from locations specified by the attackers' server. The result is the client believing there is a legitimate software update available but instead downloading a malicious update from the attacker.", "query_type": "nl"}
{"_id": "cwe_q_000473", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack exploits target software that constructs SQL statements based on user input. An attacker crafts input strings so that when the target software constructs SQL statements based on the input, the resulting SQL statement performs actions other than those the application intended. the component results from failure of the application to appropriately validate input.\n\nWhen specially crafted user-controlled input consisting of SQL syntax is used without proper validation as part of SQL queries, it is possible to glean information from the database in ways not envisaged during application design. Depending upon the database and the design of the application, it may also be possible to leverage injection to have the database execute system-related commands of the attackers' choice. the ", "query_type": "nl"}
{"_id": "cwe_q_000476", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack targets programs running with elevated privileges. The adversary tries to leverage a vulnerability in the running program and get arbitrary code to execute with elevated privileges.", "query_type": "nl"}
{"_id": "cwe_q_000480", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary may execute a flooding attack using the SSL protocol with the intent to deny legitimate users access to a service by consuming all the available resources on the server side. These attacks take advantage of the asymmetric relationship between the processing power used by the client and the processing power used by the server to create a secure connection. In this manner the attacker can make a large number of HTTPS requests on a low provisioned machine to tie up a disproportionately large number of resources on the server. The clients then continue to keep renegotiating the SSL connection. When multiplied by a large number of attacking machines, this attack can result in a crash or loss of service to legitimate users.", "query_type": "nl"}
{"_id": "cwe_q_000482", "text": "Identify the underlying software weakness exploited by this attack behavior: The adversary exploits the target system's audio and video functionalities through malware or scheduled tasks. The goal is to capture sensitive information about the target for financial, personal, political, or other gains which is accomplished by collecting communication data between two parties via the use of peripheral devices (e.g. microphones and webcams) or applications with audio and video capabilities (e.g. Skype) on a system.", "query_type": "nl"}
{"_id": "cwe_q_000485", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary tricks a victim into unknowingly initiating some action in one system while interacting with the UI from a seemingly completely different, usually an adversary controlled or intended, system.\n\nWhile being logged in to some target system, the victim visits the adversary's malicious site which displays a UI that the victim wishes to interact with. In reality, the clickjacked page has a transparent layer above the visible UI with action controls that the adversary wishes the victim to execute. The victim clicks on buttons or other UI elements they see on the page which actually triggers the action controls in the transparent overlaying layer. Depending on what that action control is, the adversary may have just tricked the victim into executing some potentially privileged (and mo", "query_type": "nl"}
{"_id": "cwe_q_000493", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker may execute a the component attack against a target with the intention of consuming resources or causing a crash. The attacker crafts a large number of identical fragmented IP packets containing a portion of a fragmented ICMP message. The attacker these sends these messages to a target host which causes the host to become non-responsive. Another vector may be sending a fragmented ICMP message to a target host with incorrect sizes in the header which causes the host to hang.", "query_type": "nl"}
{"_id": "cwe_q_000501", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a weakness enabling them to elevate their privilege and perform an action that they are not supposed to be authorized to perform.", "query_type": "nl"}
{"_id": "cwe_q_000507", "text": "Identify the underlying software weakness exploited by this attack behavior: Fault injection attacks against mobile devices use disruptive signals or events (e.g. electromagnetic pulses, laser pulses, clock glitches, etc.) to cause faulty behavior. When performed in a controlled manner on devices performing cryptographic operations, this faulty behavior can be exploited to derive secret key information. Although this attack usually requires physical control of the mobile device, it is non-destructive, and the device can be used after the attack without any indication that secret keys were compromised.", "query_type": "nl"}
{"_id": "cwe_q_000512", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary inserts malicious logic into a product or technology via flashing the on-board memory with a code-base that contains malicious logic. Various attacks exist against the integrity of flash memory, the most direct being rootkits coded into the BIOS or chipset of a device.\n\nSuch attacks are very difficult to detect because the malicious code resides outside the filesystem or RAM, and in the underlying byte-code that drives the processor. Many devices, such as the recent attacks against digital picture frames, contain only a microprocessor and a small amount of solid-state memory, rendering these devices ideal for \"flash\" based malware or malicious logic. One of the pernicious characteristics of flash memory based attacks is that the malicious code can survive even a total format o", "query_type": "nl"}
{"_id": "cwe_q_000522", "text": "Identify the underlying software weakness exploited by this attack behavior: The extension of a file name is often used in various contexts to determine the application that is used to open and use it. If an attacker can cause an alternative application to be used, it may be able to execute malicious code, cause a denial of service or expose sensitive information.", "query_type": "nl"}
{"_id": "cwe_q_000529", "text": "Identify the underlying software weakness exploited by this attack behavior: In a the component attack, an adversary tries a small list (e.g. 3-5) of common or expected passwords, often matching the target's complexity policy, against a known list of user accounts to gain valid credentials. The adversary tries a particular password for each user account, before moving onto the next password in the list. This approach assists the adversary in remaining undetected by avoiding rapid or frequent account lockouts. The adversary may then reattempt the process with additional passwords, once enough time has passed to prevent inducing a lockout.\n\nthe component attacks often target management services over commonly used ports such as SSH, FTP, Telnet, LDAP, Kerberos, MySQL, and more. Additional targets include Single Sign-On (SSO) or cloud-based applications/services that u", "query_type": "nl"}
{"_id": "cwe_q_000541", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary takes advantage of the component to provide data or services under a falsified identity. The purpose of using the falsified identity may be to prevent traceability of the provided data or to assume the rights granted to another individual. One of the simplest forms of this attack would be the creation of an email message with a modified \"From\" field in order to appear that the message was sent from someone other than the actual sender. The root of the attack (in this case the email system) fails to properly authenticate the source and this results in the reader incorrectly performing the instructed action. Results of the attack vary depending on the details of the attack, but common results include privilege escalation, obfuscation of other attacks, and data corruption/manipul", "query_type": "nl"}
{"_id": "cwe_q_000542", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a weakness in an application's specification of external libraries to exploit the functionality of the loader where the process loading the library searches first in the same directory in which the process binary resides and then in other directories. Exploitation of this preferential search order can allow an attacker to make the loading process load the adversary's rogue library rather than the legitimate library. This attack can be leveraged with many different libraries and with many different loading processes. No forensic trails are left in the system's registry or file system that an incorrect library had been loaded.", "query_type": "nl"}
{"_id": "cwe_q_000547", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary masquerades as a legitimate Dynamic Host Configuration Protocol (DHCP) server by spoofing DHCP traffic, with the goal of redirecting network traffic or denying service to DHCP.\n\nDHCP is broadcast to the entire Local Area Network (LAN) and does not have any form of authentication by default. Therefore, it is susceptible to spoofing. An adversary with access to the target LAN can receive DHCP messages; obtaining the topology information required to potentially manipulate other hosts' network configurations. To improve the likelihood of the DHCP request being serviced by the Rogue server, an adversary can first starve the DHCP pool.", "query_type": "nl"}
{"_id": "cwe_q_000553", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary hosts an event within an application framework and then monitors the data exchanged during the course of the event for the purpose of harvesting any important data leaked during the transactions. One example could be harvesting lists of usernames or userIDs for the purpose of sending spam messages to those users. One example of this type of attack involves the adversary creating an event within the sub-application. Assume the adversary hosts a \"virtual sale\" of rare items. As other users enter the event, the attacker records via AiTM (this attack pattern) proxy the user_ids and usernames of everyone who attends. The adversary would then be able to spam those users within the application using an automated script.", "query_type": "nl"}
{"_id": "cwe_q_000554", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary takes advantage of weaknesses in the protocol by which a client and server are communicating to perform unexpected actions. Communication protocols are necessary to transfer messages between client and server applications. Moreover, different protocols may be used for different types of interactions.\n\nFor example, an authentication protocol might be used to establish the identities of the server and client while a separate messaging protocol might be used to exchange data. If there is a weakness in a protocol used by the client and server, an attacker might take advantage of this to perform various types of attacks. For example, if the attacker is able to manipulate an authentication protocol, the attacker may be able spoof other clients or servers. If the attacker is able to ", "query_type": "nl"}
{"_id": "cwe_q_000560", "text": "Identify the underlying software weakness exploited by this attack behavior: SIM cards are the de facto trust anchor of mobile devices worldwide. The cards protect the mobile identity of subscribers, associate devices with phone numbers, and increasingly store payment credentials, for example in NFC-enabled phones with mobile wallets. This attack leverages over-the-air (OTA) updates deployed via cryptographically-secured SMS messages to deliver executable code to the SIM. By cracking the DES key, an attacker can send properly signed binary SMS messages to a device, which are treated as Java applets and are executed on the SIM. These applets are allowed to send SMS, change voicemail numbers, and query the phone location, among many other predefined functions. These capabilities alone provide plenty of potential for abuse.", "query_type": "nl"}
{"_id": "cwe_q_000561", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary may try certain common or default usernames and passwords to gain access into the system and perform unauthorized actions. An adversary may try an intelligent brute force using empty passwords, known vendor default credentials, as well as a dictionary of common usernames and passwords. Many vendor products come preconfigured with default (and thus well-known) usernames and passwords that should be deleted prior to usage in a production environment. It is a common mistake to forget to remove these default login credentials. Another problem is that users would pick very simple (common) passwords (e.g. \"secret\" or \"password\") that make it easier for the attacker to gain access to the system compared to using a brute force attack or even a dictionary attack using a full dictionary", "query_type": "nl"}
{"_id": "cwe_q_000566", "text": "Identify the underlying software weakness exploited by this attack behavior: A transparent proxy serves as an intermediate between the client and the internet at large. It intercepts all requests originating from the client and forwards them to the correct location. The proxy also intercepts all responses to the client and forwards these to the client. All of this is done in a manner transparent to the client.\n\nTransparent proxies are often used by enterprises and ISPs. For requests originating at the client transparent proxies need to figure out the final destination of the client's data packet. Two ways are available to do that: either by looking at the layer three (network) IP address or by examining layer seven (application) HTTP header destination. A browser has same origin policy that typically prevents scripts coming from one domain initiating requests to ot", "query_type": "nl"}
{"_id": "cwe_q_000567", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker exploits the functionality of Microsoft NTFS Alternate Data Streams (ADS) to undermine system security. ADS allows multiple \"files\" to be stored in one directory entry referenced as filename:streamname. One or more alternate data streams may be stored in any file or directory. Normal Microsoft utilities do not show the presence of an ADS stream attached to a file. The additional space for the ADS is not recorded in the displayed file size. The additional space for ADS is accounted for in the used space on the volume. An ADS can be any type of file. ADS are copied by standard Microsoft utilities between NTFS volumes. ADS can be used by an attacker or intruder to hide tools, scripts, and data from detection by normal system utilities. Many anti-virus programs do not check for or ", "query_type": "nl"}
{"_id": "cwe_q_000569", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack targets applications and software that uses the syslog() function insecurely. If an application does not explicitely use a format string parameter in a call to syslog(), user input can be placed in the format string parameter leading to a format string injection attack. Adversaries can then inject malicious format string commands into the function call leading to a buffer overflow. There are many reported software vulnerabilities with the root cause being a misuse of the syslog() function.", "query_type": "nl"}
{"_id": "cwe_q_000572", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack relies on the adversary using unexpected formats for representing IP addresses. Networked applications may expect network location information in a specific format, such as fully qualified domains names (FQDNs), URL, IP address, or IP Address ranges. If the location information is not validated against a variety of different possible encodings and formats, the adversary can use an alternate format to bypass application access control.", "query_type": "nl"}
{"_id": "cwe_q_000576", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker modifies the HTTP Verb (e.g. GET, PUT, TRACE, etc.) in order to bypass access restrictions. Some web environments allow administrators to restrict access based on the HTTP Verb used with requests. However, attackers can often provide a different HTTP Verb, or even provide a random string as a verb in order to bypass these protections. This allows the attacker to access data that should otherwise be protected.", "query_type": "nl"}
{"_id": "cwe_q_000578", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary, aware of an application's location (and possibly authorized to use the application), probes an application's structure and evaluates its robustness by submitting requests and examining responses. Often, this is accomplished by sending variants of expected queries in the hope that these modified queries might return information beyond what the expected set of queries would provide.", "query_type": "nl"}
{"_id": "cwe_q_000582", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary distributes a link (or possibly some other query structure) with a request to a third party web server that is malformed and also contains a block of exploit code in order to have the exploit become live code in the resulting error page.\n\nWhen the third party web server receives the crafted request and notes the error it then creates an error message that echoes the malformed message, including the exploit. Doing this converts the exploit portion of the message into to valid language elements that are executed by the viewing browser. When a victim executes the query provided by the adversary the infected error message is returned including the exploit code which then runs in the victim's browser. XSS can result in execution of code as well as data leakage (e.g. session cookies", "query_type": "nl"}
{"_id": "cwe_q_000589", "text": "Identify the underlying software weakness exploited by this attack behavior: An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.", "query_type": "nl"}
{"_id": "cwe_q_000591", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits improper input validation by submitting maliciously crafted input to a target application running on a server, with the goal of forcing the server to make a request either to itself, to web services running in the server’s internal network, or to external third parties. If successful, the adversary’s request will be made with the server’s privilege level, bypassing its authentication controls. This ultimately allows the adversary to access sensitive data, execute commands on the server’s network, and make external requests with the stolen identity of the server. the component attacks differ from Cross Site Request Forgery attacks in that they target the server itself, whereas CSRF attacks exploit an insecure user authentication mechanism to perform unauthorized action", "query_type": "nl"}
{"_id": "cwe_q_000595", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary manipulates the content of request parameters for the purpose of undermining the security of the target. Some parameter encodings use text characters as separators. For example, parameters in a HTTP GET message are encoded as name-value pairs separated by an ampersand (&). If an attacker can supply text strings that are used to fill in these parameters, then they can inject special characters used in the encoding scheme to add or modify parameters. For example, if user input is fed directly into an HTTP GET request and the user provides the value \"myInput&new_param=myValue\", then the input parameter is set to myInput, but a new parameter (new_param) is also added with a value of myValue. This can significantly change the meaning of the query that is processed by the server. An", "query_type": "nl"}
{"_id": "cwe_q_000598", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker generates a message or datablock that causes the recipient to believe that the message or datablock was generated and cryptographically signed by an authoritative or reputable source, misleading a victim or victim operating system into performing malicious actions.", "query_type": "nl"}
|