Download data/cwe/queries_test.jsonl from continuum-oss/ccrb: direct link, hf CLI and curl.
- Browser
- Download file 289 kB
-
https://huggingface.co/datasets/continuum-oss/ccrb/resolve/main/data/cwe/queries_test.jsonl
- Command line
-
hf download hf://datasets/continuum-oss/ccrb/data/cwe/queries_test.jsonl
-
curl -L -o queries_test.jsonl https://huggingface.co/datasets/continuum-oss/ccrb/resolve/main/data/cwe/queries_test.jsonl
289 kB
| {"_id": "cwe_q_000001", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nstruct hostent *hp;struct in_addr myaddr;\nchar* tHost = \"trustme.example.com\";\nmyaddr.s_addr=inet_addr(ip_addr_string);\n\nhp = gethostbyaddr((char *) &myaddr, sizeof(struct in_addr), AF_INET);\nif (hp && !strncmp(hp->h_name, tHost, sizeof(tHost))) {\ntrusted = true;} else {\ntrusted = false;}\n\n[Java]\nString ip = request.getRemoteAddr();\nInetAddress addr = InetAddress.getByName(ip);\nif (addr.getCanonicalHostName().endsWith(\"trustme.com\")) {\ntrusted = true;}\n\n[C#]\nIPAddress hostIPAddress = IPAddress.Parse(RemoteIpAddress);\nIPHostEntry hostInfo = Dns.GetHostByAddress(hostIPAddress);\nif (hostInfo.HostName.EndsWith(\"trustme.com\")) {\ntrusted = true;}", "query_type": "code"} | |
| {"_id": "cwe_q_000002", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nvoid bind_socket(void) {\n\nint server_sockfd;\nint server_len;\nstruct sockaddr_in server_address;\n\n /*unlink the socket if already bound to avoid an error when bind() is called*/\n\nunlink(\"server_socket\");\nserver_sockfd = socket(AF_INET, SOCK_STREAM, 0);\n\nserver_address.sin_family = AF_INET;\nserver_address.sin_port = 21;\nserver_address.sin_addr.s_addr = htonl(INADDR_ANY);\nserver_len = sizeof(struct sockaddr_in);\n\nbind(server_sockfd, (struct sockaddr *) &s1, server_len);\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000003", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Go]\nfunc ExecuteGitCommand(name string, arg []string) error {\n\n c := exec.Command(name, arg...)\n\n var err error\n\n c.Path, err = exec.LookPath(name)\n\n if err != nil {\n\n return err\n\n }\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000004", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\nfunction printFile($username,$filename){\n\n //read file into string\n\n$file = file_get_contents($filename);\nif ($file && isOwnerOf($username,$filename)){\necho $file;\nreturn true;}\nelse{\necho 'You are not authorized to view this file';}\nreturn false;\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000005", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[JSP]\nSocial Security Number: <%= ssn %></br>Credit Card Number: <%= ccn %>", "query_type": "code"} | |
| {"_id": "cwe_q_000006", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString str1 = new String(\"Hello\");\nString str2 = new String(\"Hello\");\nif (str1 == str2) {\nSystem.out.println(\"str1 == str2\");}", "query_type": "code"} | |
| {"_id": "cwe_q_000007", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Python]\ndef validate_password(actual_pw, typed_pw):\n\nif len(actual_pw) <> len(typed_pw):\n\nreturn 0\n\nfor i in len(actual_pw):\n\nif actual_pw[i] <> typed_pw[i]:\n\nreturn 0\n\nreturn 1", "query_type": "code"} | |
| {"_id": "cwe_q_000008", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n// Define the target location where the picture being\n\n // uploaded is going to be saved.\n\n$target = \"pictures/\" . basename($_FILES['uploadedfile']['name']);\n\n // Move the uploaded file to the new location.\n\nif(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target))\n{\necho \"The picture has been successfully uploaded.\";}\nelse\n{\necho \"There was an error uploading the picture, please try again.\";}", "query_type": "code"} | |
| {"_id": "cwe_q_000009", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar* trimTrailingWhitespace(char *strMessage, int length) {\n\nchar *retMessage;\nchar *message = malloc(sizeof(char)*(length+1));\n\n // copy input string to a temporary string\n\nchar message[length+1];\nint index;\nfor (index = 0; index < length; index++) {\nmessage[index] = strMessage[index];}\nmessage[index] = '\\0';\n\n // trim trailing whitespace\n\nint len = index-1;\nwhile (isspace(message[len])) {\nmessage[len] = '\\0';\nlen--;}\n\n // return string without trailing whitespace\n\nretMessage = message;\nreturn retMessage;\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000010", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[JSP]\n<%Statement stmt = conn.createStatement();\nResultSet rs = stmt.executeQuery(\"select * from emp where id=\"+eid);\nif (rs != null) {\nrs.next();\nString name = rs.getString(\"name\");}%>\n\nEmployee Name: <%= name %>\n\n[ASP.NET]\n<%\nprotected System.Web.UI.WebControls.Label EmployeeName;\n...\nstring query = \"select * from emp where id=\" + eid;\nsda = new SqlDataAdapter(query, conn);\nsda.Fill(dt);\nstring name = dt.Rows[0][\"Name\"];\n...\nEmployeeName.Text = name;%>\n<p><asp:label id=\"EmployeeName\" runat=\"server\" /></p>", "query_type": "code"} | |
| {"_id": "cwe_q_000011", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\n// Android\n\n@Override\npublic boolean shouldOverrideUrlLoading(WebView view, String url){\n\nif (url.substring(0,14).equalsIgnoreCase(\"examplescheme:\")){\nif(url.substring(14,25).equalsIgnoreCase(\"getUserInfo\")){\nwriteDataToView(view, UserData);\nreturn false;}\nelse{\nreturn true;}}\n }\n\n[Objective-C]\n// iOS\n\n-(BOOL) webView:(UIWebView *)exWebView shouldStartLoadWithRequest:(NSURLRequest *)exRequest navigationType:(UIWebViewNavigationType)exNavigationType\n{\n\nNSURL *URL = [exRequest URL];\nif ([[URL scheme] isEqualToString:@\"exampleScheme\"])\n{\n\nNSString *functionString = [URL resourceSpecifier];\nif ([functionString hasPrefix:@\"specialFunction\"])\n{\n\n // Make data available back in webview.\n\nUIWebView *webView = [self writeDataToView:[URL query]];\n }\nreturn NO;\n }\nreturn YES;\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000012", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Verilog]\nassign addr_auth = (address == 32'hF00) ? 1: 0;", "query_type": "code"} | |
| {"_id": "cwe_q_000013", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString rName = request.getParameter(\"reportName\");\nFile rFile = new File(\"/usr/local/apfr/reports/\" + rName);\n...\nrFile.delete();", "query_type": "code"} | |
| {"_id": "cwe_q_000014", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n#define OUTFILE \"hello.out\"\n\numask(0);\nFILE *out;\n\n /* Ignore link following (this weakness) for brevity */\n\nout = fopen(OUTFILE, \"w\");\nif (out) {\nfprintf(out, \"hello world!\\n\");\nfclose(out);}", "query_type": "code"} | |
| {"_id": "cwe_q_000016", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Perl]\nmy $Username = GetUntrustedInput();\n$Username =~ s/\\.\\.\\///;\nmy $filename = \"/home/user/\" . $Username;\nReadAndSendFile($filename);", "query_type": "code"} | |
| {"_id": "cwe_q_000017", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\ntry {\n/.../}\ncatch (Exception e) {\nSystem.out.println(e);}", "query_type": "code"} | |
| {"_id": "cwe_q_000018", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString keystorePass = System.getProperty(\"javax.net.ssl.keyStorePassword\");\nif (keystorePass == null) {\nSystem.err.println(\"ERROR: Keystore password not specified.\");\nSystem.exit(-1);}\n\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000019", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Algorithm]\nSuppose an algorithm for implementing an encryption routine works fine per se, but the time taken to output the result of the encryption routine depends on a relationship between the input plaintext and the key (e.g., suppose, if the plaintext is similar to the key, it would run very fast).", "query_type": "code"} | |
| {"_id": "cwe_q_000020", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar *test_string;\n\n if (i != err_val)\n\n {\n\ntest_string = \"Hello World!\";\n }\n\n printf(\"%s\", test_string);", "query_type": "code"} | |
| {"_id": "cwe_q_000021", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nwebapp.ldap.username = secretUsername\nwebapp.ldap.password = secretPassword", "query_type": "code"} | |
| {"_id": "cwe_q_000022", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\ntmp = malloc(sizeof(int) * 4);\nif (tmp < 0 ) {\n\nperror(\"Failure\");\n\n //should have checked if the call returned 0\n\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000024", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nDataPacket *packet;\nint numHeaders;\nPacketHeader *headers;\n\nsock=AcceptSocketConnection();\nReadPacket(packet, sock);\nnumHeaders =packet->headers;\n\nif (numHeaders > 100) {\nExitError(\"too many headers!\");}\nheaders = malloc(numHeaders * sizeof(PacketHeader);\nParsePacketHeaders(packet, headers);", "query_type": "code"} | |
| {"_id": "cwe_q_000025", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\n...\n\n\t\t\t\tmodule mod_exp\n\n\t\t\t\t\t...\n\n\t\t\t\t\t`UPDATE: begin\n\n\t\t\t\t\t\tif (exponent_reg != 'd0) begin\n\n\t\t\t\t\t\t\tif (exponent_reg[0])\n\n\t\t\t\t\t\t\t\tresult_reg <= result_next;\n\n\t\t\t\t\t\t\tbase_reg <= base_next;\n\n\t\t\t\t\t\t\texponent_reg <= exponent_next;\n\n\t\t\t\t\t\t\tstate <= `UPDATE;\n\n\t\t\t\t\t...\n\n\t\t\t\tendmodule", "query_type": "code"} | |
| {"_id": "cwe_q_000028", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\nlogic [511:0] bigData;\n\n ...\n\n hmac hmac(\n\n .clk_i(clk_i),\n\n .rst_ni(rst_ni && ~rst_4),\n\n .init_i(startHash && ~startHash_r),\n\n .key_i(key),\n\n .ikey_hash_i(ikey_hash),\n\n .okey_hash_i(okey_hash),\n\n .key_hash_bypass_i(key_hash_bypass),\n\n .message_i(bigData),\n\n .hash_o(hash),\n\n .ready_o(ready),\n\n .hash_valid_o(hashValid)", "query_type": "code"} | |
| {"_id": "cwe_q_000029", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\nString username = request.getParameter(\"username\");\n\n // May cause unchecked NullPointerException.\n\nif (username.length() < 10) {\n...}\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000030", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nif (helper == null) {\n\nsynchronized (this) {\nif (helper == null) {\nhelper = new Helper();}}\n }\nreturn helper;\n\n[Java]\nhelper = new Helper();", "query_type": "code"} | |
| {"_id": "cwe_q_000031", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n#define CERT \"secret.pem\"\n#define CERT2 \"secret2.pem\"\n\nint main(){\n\nSSL_CTX *ctx;\nSSL *ssl;\ninit_OpenSSL();\nseed_prng();\n\nctx = SSL_CTX_new(SSLv23_method());\n\nif (SSL_CTX_use_certificate_chain_file(ctx, CERT) != 1)\nint_error(\"Error loading certificate from file\");\n\nif (SSL_CTX_use_PrivateKey_file(ctx, CERT, SSL_FILETYPE_PEM) != 1)\nint_error(\"Error loading private key from file\");\n\nif (!(ssl = SSL_new(ctx)))\nint_error(\"Error creating an SSL context\");\n\nif ( SSL_CTX_set_default_passwd_cb(ctx, \"new default password\" != 1))\nint_error(\"Doing something which is dangerous to do anyways\");\n\nif (!(ssl2 = SSL_new(ctx)))\nint_error(\"Error creating an SSL context\");\n\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000032", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nint debugLevel = Integer.getInteger(\"com.domain.application.debugLevel\").intValue();", "query_type": "code"} | |
| {"_id": "cwe_q_000033", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic void doExchange() throws Exception {\n...}", "query_type": "code"} | |
| {"_id": "cwe_q_000034", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\n...\nString name = new String(nameBytes, highByte);\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000035", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nserver.sin_family = AF_INET; hp = gethostbyname(argv[1]);\nif (hp==NULL) error(\"Unknown host\");\nmemcpy( (char *)&server.sin_addr,(char *)hp->h_addr,hp->h_length);\nif (argc < 3) port = 80;\nelse port = (unsigned short)atoi(argv[3]);\nserver.sin_port = htons(port);\nif (connect(sock, (struct sockaddr *)&server, sizeof server) < 0) error(\"Connecting\");\n...\nwhile ((n=read(sock,buffer,BUFSIZE-1))!=-1) {\n\nwrite(dfd,password_buffer,n);\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000036", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic boolean isReorderNeeded(String bookISBN, int rateSold) {\n\nboolean isReorder = false;\n\nint minimumCount = 10;\nint days = 0;\n\n // get inventory count for book\n\nint inventoryCount = inventory.getIventoryCount(bookISBN);\n\n // find number of days until inventory count reaches minimum\n\nwhile (inventoryCount > minimumCount) {\n\ninventoryCount = inventoryCount - rateSold;\ndays++;\n\n }\n\n // if number of days within reorder timeframe\n\n // set reorder return boolean to true\n\nif (days > 0 && days < 5) {\nisReorder = true;}\n\nreturn isReorder;\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000037", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nif (user == null) {\n\n // TODO: Handle null user condition.\n\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000041", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n#include <signal.h>\n#include <syslog.h>\n#include <string.h>\n#include <stdlib.h>\n\nvoid *global1, *global2;\nchar *what;\nvoid sh (int dummy) {\n\nsyslog(LOG_NOTICE,\"%s\\n\",what);\nfree(global2);\nfree(global1);\n\n /* Sleep statements added to expand timing window for race condition */\n\nsleep(10);\nexit(0);\n }\n\nint main (int argc,char* argv[]) {\n\nwhat=argv[1];\nglobal1=strdup(argv[2]);\nglobal2=malloc(340);\nsignal(SIGHUP,sh);\nsignal(SIGTERM,sh);\n\n /* Sleep statements added to expand timing window for race condition */\n\nsleep(10);\nexit(0);\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000042", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\n...\nString btype = request.getParameter(\"backuptype\");\nString cmd = new String(\"cmd.exe /K \\\"\nc:\\\\util\\\\rmanDB.bat \"\n+btype+\n\"&&c:\\\\utl\\\\cleanup.bat\\\"\")\n\nSystem.Runtime.getRuntime().exec(cmd);\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000045", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\n...\n\n logic [31:0] data_d, data_q\n\n logic [512-1:0] pass_data;\n\n ...\n\n Write: begin\n\n ...\n\n if (pass_mode) begin\n\n pass_data = { {60{8'h00}}, data_d};\n\n state_d = PassChk;\n\n pass_mode = 1'b0;\n\n ...\n\n end\n\n ...", "query_type": "code"} | |
| {"_id": "cwe_q_000046", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\nfunction generateSessionID($userID){\nsrand($userID);\nreturn rand();}", "query_type": "code"} | |
| {"_id": "cwe_q_000047", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n//hardcode input length for simplicity\n\nchar* input = (char*) malloc(40*sizeof(char));\nchar *tok;\nchar* sep = \" \\t\";\n\nget_user_input( input );\n\n /* The following loop will parse and process each token in the input string */\n\ntok = strtok( input, sep);\nwhile( NULL != tok ){\n\nif( isMalformed( tok ) ){\n\n /* ignore and discard bad data */\n\nfree( tok );\n }\nelse{\nadd_to_command_queue( tok );}\ntok = strtok( NULL, sep));\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000048", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Verilog]\n// 2x1 Multiplexor using logic-gates\n\n\t\t\t\t\t\tmodule glitchEx(\n\n\t\t\t\t\t\t\tinput wire in0, in1, sel,\n\n\t\t\t\t\t\t\toutput wire z\n\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\twire not_sel;\n\n\t\t\t\t\t\twire and_out1, and_out2;\n\n\t\t\t\t\t\tassign not_sel = ~sel;\n\n\t\t\t\t\t\tassign and_out1 = not_sel & in0;\n\n\t\t\t\t\t\tassign and_out2 = sel & in1;\n\n\t\t\t\t\t\t// Buggy line of code:\n\n\t\t\t\t\t\tassign z = and_out1 | and_out2; // glitch in signal z\n\n\t\t\t\t\t\tendmodule", "query_type": "code"} | |
| {"_id": "cwe_q_000049", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString author = request.getParameter(AUTHOR_PARAM);\n...\nCookie cookie = new Cookie(\"author\", author);\ncookie.setMaxAge(cookieExpiration);\nresponse.addCookie(cookie);", "query_type": "code"} | |
| {"_id": "cwe_q_000050", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar* ptr = (char*)malloc (SIZE);\n\n\t\t\t\t ...\n\n\t\t\t\t if (abrt) {\n\n\t\t\t\t\t free(ptr);\n\n\t\t\t\t }\n\n\t\t\t\t ...\n\n\t\t\t\t free(ptr);", "query_type": "code"} | |
| {"_id": "cwe_q_000051", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nPublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\ntry {\n...} catch (ApplicationSpecificException ase) {\nlogger.error(\"Caught: \" + ase.toString());\nSystem.exit(1);}}", "query_type": "code"} | |
| {"_id": "cwe_q_000052", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nprivate void buildList ( int untrustedListSize ){\nif ( 0 > untrustedListSize ){\ndie(\"Negative value supplied for list size, die evil hacker!\");}\nWidget[] list = new Widget [ untrustedListSize ];\nlist[0] = new Widget();}", "query_type": "code"} | |
| {"_id": "cwe_q_000054", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n$auth = $_COOKIES['authenticated'];\nif (! $auth) {\nif (AuthenticateUser($_POST['user'], $_POST['password']) == \"success\") {\n// save the cookie to send out in future responses\nsetcookie(\"authenticated\", \"1\", time()+60*60*2);}\nelse {\nShowLoginScreen();\ndie(\"\\n\");}}\nDisplayMedicalHistory($_POST['patient_ID']);", "query_type": "code"} | |
| {"_id": "cwe_q_000056", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[VHDL]\n-- The following VHDL example is written for VHDL-93 or later.\n\n\t\t type t_priv_state is (RESET, USER_ONLY, PRIVILEGED);\n\n\t\t signal priv_state : t_priv_state := RESET;\n\n\t\t signal auth_passed : boolean := false;\n\n\t\t signal privilege_revoke : boolean := false;\n\n\t\t ...\n\n\t\t process(clk, reset_n)\n\n\t\t begin\n\n\t\t\tif reset_n = '0' then\n\n\t\t\t priv_state <= RESET;\n\n\t\t\telsif rising_edge(clk) then\n\n\t\t\t case priv_state is\n\n\t\t\t\twhen RESET =>\n\n\t\t\t\t priv_state <= USER_ONLY;\n\n\t\t\t\twhen USER_ONLY =>\n\n\t\t\t\t if auth_passed then\n\n\t\t\t\t\tpriv_state <= PRIVILEGED;\n\n\t\t\t\t end if;\n\n\t\t\t\twhen PRIVILEGED =>\n\n\t\t\t\t if privilege_revoke then\n\n\t\t\t\t\tpriv_state <= USER_ONLY;\n\n\t\t\t\t end if;\n\n\t\t\t\twhen others =>\n\n\t\t\t\t priv_state <= USER_ONLY; -- intended recovery for unexpected encodings\n\n\t\t\t\tend case;\n\n\t\t\t end if;\n\n\t\t\tend process;\n\n\t\t\tprotected_cfg_write_en <= (priv_state = PRIVILEGED);\n\n[Verilog]\nlocalparam RESET = 2'b00;\n\n\t\t\tlocalparam USER_ONLY = 2'b01;\n\n\t\t\tlocalparam PRIVILEGED = 2'b10;\n\n\t\t\treg [1:0] priv_state = RESET;\n\n\t\t\twire auth_passed; // Implicitly 1-bit (boolean equivalent)\n\n\t\t\twire privilege_revoke; // Implicitly 1-bit (boolean equivalent)\n\n\t\t\twire c", "query_type": "code"} | |
| {"_id": "cwe_q_000057", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Go]\nfunc serve(w http.ResponseWriter, r *http.Request) {\n\n var body []byte\n\n if r.Body != nil {\n\n if data, err := io.ReadAll(r.Body); err == nil {\n\n body = data\n\n }\n }\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000058", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nprivate User user;\npublic void someMethod() {\n\n // Do something interesting.\n\n...\n\n // Throws NPE if user hasn't been properly initialized.\n\nString username = user.getName();\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000059", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\n// Method called from servlet to obtain product information\n\npublic String displayProductSummary(int index) {\n\nString productSummary = new String(\"\");\n\ntry {\nString productSummary = getProductSummary(index);\n\n} catch (Exception ex) {...}\n\nreturn productSummary;\n }\n\npublic String getProductSummary(int index) {\nreturn products[index];}", "query_type": "code"} | |
| {"_id": "cwe_q_000060", "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(\"role\")) {\nuserRole = c.getValue();}}", "query_type": "code"} | |
| {"_id": "cwe_q_000061", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nFILE *stream;\nif( (stream = tmpfile()) == NULL ) {\n\nperror(\"Could not open new temporary file\\n\");\nreturn (-1);\n }\n\n // write data to tmp file\n\n...\n// remove tmp file\nrmtmp();\n\n[Java]\ntry {\nFile temp = File.createTempFile(\"pattern\", \".suffix\");\ntemp.deleteOnExit();\nBufferedWriter out = new BufferedWriter(new FileWriter(temp));\nout.write(\"aString\");\nout.close();}\ncatch (IOException e) {\n}", "query_type": "code"} | |
| {"_id": "cwe_q_000062", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint main(int argc, char** argv) {\nchar cmd[CMD_MAX] = \"/usr/bin/cat \";\nstrcat(cmd, argv[1]);\nsystem(cmd);}", "query_type": "code"} | |
| {"_id": "cwe_q_000064", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nif LoginUser(){\n\n// Login successful\n\n\t\t RunProgram();\n } else {\n\n// Login unsuccessful\n\n\t\t LoginRetry();\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000065", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\n@Stateless\npublic class StockSymbolBean implements StockSymbolRemote {\n\nServerSocket serverSocket = null;\nSocket clientSocket = null;\n\npublic StockSymbolBean() {\n\ntry {\nserverSocket = new ServerSocket(Constants.SOCKET_PORT);} catch (IOException ex) {...}\n\ntry {\nclientSocket = serverSocket.accept();} catch (IOException e) {...}\n }\n\npublic String getStockSymbol(String name) {...}\n\npublic BigDecimal getStockValue(String symbol) {...}\n\nprivate void processClientInputFromSocket() {...}\n }\n\n[Java]\n@Stateless\npublic class StockSymbolBean extends Thread implements StockSymbolRemote {\n\nServerSocket serverSocket = null;\nSocket clientSocket = null;\nboolean listening = false;\n\npublic StockSymbolBean() {\n\ntry {\nserverSocket = new ServerSocket(Constants.SOCKET_PORT);} catch (IOException ex) {...}\n\nlistening = true;\nwhile(listening) {\nstart();}\n }\n\npublic String getStockSymbol(String name) {...}\n\npublic BigDecimal getStockValue(String symbol) {...}\n\npublic void run() {\ntry {\nclientSocket = serverSocket.accept();} catch (IOException e) {...}\n...}\n\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000066", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Perl]\nmy $test_string = \"Bad characters: \\$\\@\\#\";\n\n my $bdrslt = $test_string;\n\n $bdrslt =~ /^(\\w+\\s?)*$/i;", "query_type": "code"} | |
| {"_id": "cwe_q_000068", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[JSP]\n<% for (Iterator i = guestbook.iterator(); i.hasNext(); ) {\nEntry e = (Entry) i.next(); %>\n<p>Entry #<%= e.getId() %></p>\n<p><%= e.getText() %></p>\n<%\n} %>", "query_type": "code"} | |
| {"_id": "cwe_q_000069", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\ntry {\n\n // Something that may throw an exception.\n\n...\n } catch (Throwable t) {\nlogger.error(\"Caught: \" + t.toString());\nreturn;}", "query_type": "code"} | |
| {"_id": "cwe_q_000070", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C++]\nint myfunction() throw(std::exception) {\nif (0) throw out_of_range();\nthrow length_error();}", "query_type": "code"} | |
| {"_id": "cwe_q_000071", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nThread thr = new Thread() {\npublic void run() {\n...}};\n\nthr.run();", "query_type": "code"} | |
| {"_id": "cwe_q_000072", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic String getValue(int index) {\nreturn array[index];}", "query_type": "code"} | |
| {"_id": "cwe_q_000073", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nr = getName();\nr = getNewBuffer(buf);", "query_type": "code"} | |
| {"_id": "cwe_q_000074", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[XML]\n<form-validation>\n<formset>\n<form name=\"RegistrationForm\">\n<field property=\"name\" depends=\"required\">\n<arg position=\"0\" key=\"prompt.name\"/></field>\n<field property=\"address\" depends=\"required\">\n<arg position=\"0\" key=\"prompt.address\"/></field>\n<field property=\"city\" depends=\"required\">\n<arg position=\"0\" key=\"prompt.city\"/></field>\n<field property=\"state\" depends=\"required,mask\">\n<arg position=\"0\" key=\"prompt.state\"/>\n<var>\n<var-name>mask</var-name>\n<var-value>[a-zA-Z]{2}</var-value></var></field>\n<field property=\"zipcode\" depends=\"required,mask\">\n<arg position=\"0\" key=\"prompt.zipcode\"/>\n<var>\n<var-name>mask</var-name>\n<var-value>\\d{5}</var-value></var></field></form></formset></form-validation>", "query_type": "code"} | |
| {"_id": "cwe_q_000075", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[JSON]\n{\n\n\t\t\t\t\"model\": \"my-coding-model\",\n\n\t\t\t\t\"context_window\": 8192,\n\n\t\t\t\t\"max_output_tokens\": 4096,\n\n\t\t\t\t\"temperature\", 1.5,\n\n\t\t\t\t...\n\n\t\t\t }", "query_type": "code"} | |
| {"_id": "cwe_q_000076", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic class WebViewGUI extends Activity {\n\nWebView mainWebView;\n\npublic void onCreate(Bundle savedInstanceState) {\nsuper.onCreate(savedInstanceState);\nmainWebView = new WebView(this);\nmainWebView.getSettings().setJavaScriptEnabled(true);\nmainWebView.addJavascriptInterface(new JavaScriptInterface(), \"userInfoObject\");\nmainWebView.loadUrl(\"file:///android_asset/www/index.html\");\nsetContentView(mainWebView);}\n\nfinal class JavaScriptInterface {\n\nJavaScriptInterface () {}\n\npublic String getUserInfo() {\nreturn currentUser.Info();}\n }\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000077", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchroot(APP_HOME);\nchdir(\"/\");\nFILE* data = fopen(argv[1], \"r+\");\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000078", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint writeDataFromSocketToFile(char *host, int port)\n{\n\nchar filename[FILENAME_SIZE];\nchar buffer[BUFFER_SIZE];\nint socket = openSocketConnection(host, port);\n\nif (socket < 0) {\nprintf(\"Unable to open socket connection\");\nreturn(FAIL);}\nif (getNextMessage(socket, filename, FILENAME_SIZE) > 0) {\n\nif (openFileToWrite(filename) > 0) {\n\nwhile (getNextMessage(socket, buffer, BUFFER_SIZE) > 0){\nif (!(writeToFile(buffer) > 0))\nbreak;\n }\n }\ncloseFile();\n }\ncloseSocket(socket);\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000079", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n$dir = $_GET['module_name'];\ninclude($dir . \"/function.php\");\n\n[PHP]\nsystem($_GET['cmd']);", "query_type": "code"} | |
| {"_id": "cwe_q_000080", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint VerifyAdmin(char *password) {\nif (strcmp(compress(password), compressed_password)) {\nprintf(\"Incorrect Password!\\n\");\nreturn(0);}\nprintf(\"Entering Diagnostic Mode...\\n\");\nreturn(1);}\n\n[Java]\nint VerifyAdmin(String password) {\nif (passwd.Equals(compress(password), compressed_password)) {\nreturn(0);}\n\n //Diagnostic Mode\n\nreturn(1);}", "query_type": "code"} | |
| {"_id": "cwe_q_000081", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nvoid f(pthread_mutex_t *mutex) {\n\npthread_mutex_lock(mutex);\n\n /* access shared resource */\n\npthread_mutex_unlock(mutex);\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000082", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C#]\nint Division(int x, int y){\nreturn (x / y);}", "query_type": "code"} | |
| {"_id": "cwe_q_000083", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[JSP]\n<% if (Boolean.getBoolean(\"debugEnabled\")) {\n\n%>\nUser account number: <%= acctNo %>\n<%\n} %>", "query_type": "code"} | |
| {"_id": "cwe_q_000084", "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(\"User selected %s\\n\", items[index-1]);}", "query_type": "code"} | |
| {"_id": "cwe_q_000085", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString script = System.getProperty(\"SCRIPTNAME\");\nif (script != null)\nSystem.exec(script);", "query_type": "code"} | |
| {"_id": "cwe_q_000086", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n#define BUFSIZE 256\nint main(int argc, char **argv) {\nchar *buf;\nbuf = (char *)malloc(sizeof(char)*BUFSIZE);\nstrcpy(buf, argv[1]);}", "query_type": "code"} | |
| {"_id": "cwe_q_000087", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint GetUntrustedInt () {\nreturn(0x0000FFFF);}\n\nvoid main (int argc, char **argv) {\n\nchar path[256];\nchar *input;\nint i;\nshort s;\nunsigned int sz;\n\ni = GetUntrustedInt();\ns = i;\n/* s is -1 so it passes the safety check - this weakness */\nif (s > 256) {\nDiePainfully(\"go away!\\n\");}\n\n/* s is sign-extended and saved in sz */\nsz = s;\n\n/* output: i=65535, s=-1, sz=4294967295 - your mileage may vary */\nprintf(\"i=%d, s=%d, sz=%u\\n\", i, s, sz);\n\ninput = GetUserInput(\"Enter pathname:\");\n\n/* strncpy interprets s as unsigned int, so it's treated as MAX_INT\n(this weakness), enabling buffer overflow (this weakness) */\nstrncpy(path, input, s);\npath[255] = '\\0'; /* don't want this weakness */\nprintf(\"Path is: %s\\n\", path);\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000088", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\nmodule dma # (...)(...);\n\n\t\t\t\t\t...\n\n\t\t\t\t\t\tinput [7:0] [16-1:0] pmpcfg_i;\n\n\t\t\t\t\t\tinput logic [16-1:0][53:0] pmpaddr_i;\n\n\t\t\t\t\t\t...\n\n\t\t\t\t\t\t//// Save the input command\n\n \t\t\t\t\t\talways @ (posedge clk_i or negedge rst_ni)\n\n\t\t\t\t\t\t\tbegin: save_inputs\n\n\t\t\t\t\t\t\tif (!rst_ni)\n\n\t\t\t\t\t\t\t\tbegin\n\n\t\t\t\t\t\t\t\t...\n\n\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t\tbegin\n\n\t\t\t\t\t\t\t\t\tif (dma_ctrl_reg == CTRL_IDLE || dma_ctrl_reg == CTRL_DONE)\n\n\t\t\t\t\t\t\t\t\tbegin\n\n\t\t\t\t\t\t\t\t\t...\n\n\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\tend // save_inputs\n\n\t\t\t\t\t\t\t...\n\n\t\t\t\t\t\t\t// Load/store PMP check\n\n\t\t\t\t\t\t\tpmp #(\n\n\t\t\t\t\t\t\t\t.XLEN ( 64 ),\n\n\t\t\t\t\t\t\t\t.PMP_LEN ( 54 ),\n\n\t\t\t\t\t\t\t\t.NR_ENTRIES ( 16 )\n\n\t\t\t\t\t\t\t) i_pmp_data (\n\n\t\t\t\t\t\t\t\t.addr_i ( pmp_addr_reg ),\n\n\t\t\t\t\t\t\t\t.priv_lvl_i ( riscv::PRIV_LVL_U ),\n\n\t\t\t\t\t\t\t\t.access_type_i ( pmp_access_type_reg ),\n\n\t\t\t\t\t\t\t\t// Configuration\n\n\t\t\t\t\t\t\t\t.conf_addr_i ( pmpaddr_i ),\n\n\t\t\t\t\t\t\t\t.conf_i ( pmpcfg_i ),\n\n\t\t\t\t\t\t\t\t.allow_o ( pmp_data_allow )\n\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\tendmodule", "query_type": "code"} | |
| {"_id": "cwe_q_000089", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic void updateUserAccountOrder(String productNumber, String accountNumber) {\n\nboolean isValidProduct = false;\nboolean isValidAccount = false;\n\nif (validProductNumber(productNumber)) {\nisValidProduct = true;\nupdateInventory(productNumber);}\nelse {\nreturn;}\n\nif (validAccountNumber(accountNumber)) {\nisValidProduct = true;\nupdateAccount(accountNumber, productNumber);}\n\nif (isValidProduct && isValidAccount) {\nupdateAccountOrder(accountNumber, productNumber);}\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000090", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar * copy_input(char *user_supplied_string){\n\nint i, dst_index;\nchar *dst_buf = (char*)malloc(4*sizeof(char) * MAX_SIZE);\nif ( MAX_SIZE <= strlen(user_supplied_string) ){\ndie(\"user string too long, die evil hacker!\");}\ndst_index = 0;\nfor ( i = 0; i < strlen(user_supplied_string); i++ ){\n\nif( '&' == user_supplied_string[i] ){\ndst_buf[dst_index++] = '&';\ndst_buf[dst_index++] = 'a';\ndst_buf[dst_index++] = 'm';\ndst_buf[dst_index++] = 'p';\ndst_buf[dst_index++] = ';';}\nelse if ('<' == user_supplied_string[i] ){\n\n /* encode to < */\n\n }\nelse dst_buf[dst_index++] = user_supplied_string[i];\n }\nreturn dst_buf;\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000091", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nprivate void processFile(string fName)\n{\nBufferReader fil = new BufferReader(new FileReader(fName));\nString line;\nwhile ((line = fil.ReadLine()) != null)\n{\nprocessLine(line);}}", "query_type": "code"} | |
| {"_id": "cwe_q_000093", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic class RegistrationForm extends org.apache.struts.validator.ValidatorForm {\n\n// private variables for registration form\nprivate String name;\nprivate String email;\n...\n\npublic RegistrationForm() {\nsuper();}\n\npublic ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {\nActionErrors errors = new ActionErrors();\nif (getName() == null || getName().length() < 1) {\nerrors.add(\"name\", new ActionMessage(\"error.name.required\"));}\nreturn errors;}\n\n// getter and setter methods for private variables\n...\n\n}", "query_type": "code"} | |
| {"_id": "cwe_q_000094", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\n...\n\n\t\t\t\t\t\t// Implement SHA256 I/O memory map interface\n\n\t\t\t\t\t\t// Write side\n\n\t\t\t\t\t\talways @(posedge clk_i)\n\n\t\t\t\t\t\t\tbegin\n\n\t\t\t\t\t\t\t\tif(~(rst_ni && ~rst_3))\n\n\t\t\t\t\t\t\t\t\tbegin\n\n\t\t\t\t\t\t\t\t\t\tstartHash <= 0;\n\n\t\t\t\t\t\t\t\t\t\tnewMessage <= 0;\n\n\t\t\t\t\t\t\t\t\t\tdata[0] <= 0;\n\n\t\t\t\t\t\t\t\t\t\tdata[1] <= 0;\n\n\t\t\t\t\t\t\t\t\t\tdata[2] <= 0;\n\n\t\t\t\t\t\t\t\t\t\t...\n\n\t\t\t\t\t\t\t\t\t\tdata[14] <= 0;\n\n\t\t\t\t\t\t\t\t\t\tdata[15] <= 0;\n\n\t\t\t\t\t...", "query_type": "code"} | |
| {"_id": "cwe_q_000095", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchroot(\"/var/ftproot\");\n...\nfgets(filename, sizeof(filename), network);\nlocalfile = fopen(filename, \"r\");\nwhile ((len = fread(buf, 1, sizeof(buf), localfile)) != EOF) {\nfwrite(buf, 1, sizeof(buf), network);}\nfclose(localfile);", "query_type": "code"} | |
| {"_id": "cwe_q_000096", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\n...\n\nIntentFilter filter = new IntentFilter(\"com.example.URLHandler.openURL\");\nMyReceiver receiver = new MyReceiver();\nregisterReceiver(receiver, filter);\n\n ...\n\npublic class UrlHandlerReceiver extends BroadcastReceiver {\n\n@Override\npublic void onReceive(Context context, Intent intent) {\n\nif(\"com.example.URLHandler.openURL\".equals(intent.getAction())) {\nString URL = intent.getStringExtra(\"URLToOpen\");\nint length = URL.length();\n\n ...\n\n}\n }\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000097", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic boolean isSameAccount(BankAccount accountA, BankAccount accountB) {\nreturn accountA == accountB;}", "query_type": "code"} | |
| {"_id": "cwe_q_000099", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nresponse.addCookie( new Cookie(\"userAccountID\", acctID) );", "query_type": "code"} | |
| {"_id": "cwe_q_000100", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n$role = $_COOKIES['role'];\nif (!$role) {\n$role = getRole('user');\nif ($role) {\n// save the cookie to send out in future responses\nsetcookie(\"role\", $role, time()+60*60*2);}\nelse{\nShowLoginScreen();\ndie(\"\\n\");}}\nif ($role == 'Reader') {\nDisplayMedicalHistory($_POST['patient_ID']);}\nelse{\ndie(\"You are not Authorized to view this record\\n\");}", "query_type": "code"} | |
| {"_id": "cwe_q_000101", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n$debugEnabled = false;\nif ($_POST[\"debug\"] == \"true\"){\n$debugEnabled = true;}\n\n /.../\n\nfunction login($username, $password){\nif($debugEnabled){\necho 'Debug Activated';\nphpinfo();\n$isAdmin = True;\nreturn True;}}", "query_type": "code"} | |
| {"_id": "cwe_q_000102", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic class Kibitzer {\n\npublic Object clone() throws CloneNotSupportedException {\n\nObject returnMe = new Kibitzer();\n...\n }\n }\n\npublic class FancyKibitzer extends Kibitzer{\n\npublic Object clone() throws CloneNotSupportedException {\n\nObject returnMe = super.clone();\n...\n }\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000103", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\ntry {\ndoExchange();}\ncatch (Exception e) {\nlogger.error(\"doExchange failed\", e);}", "query_type": "code"} | |
| {"_id": "cwe_q_000105", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n$requestingIP = $_SERVER['REMOTE_ADDR'];\nif(!in_array($requestingIP,$ipAllowList)){\necho \"You are not authorized to view this page\";\nhttp_redirect($errorPageURL);}\n$status = getServerStatus();\necho $status;\n\n ...", "query_type": "code"} | |
| {"_id": "cwe_q_000106", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nprotected void doPost (HttpServletRequest req, HttpServletResponse res) throws IOException {\nString ip = req.getRemoteAddr();\nInetAddress addr = InetAddress.getByName(ip);\n...\nout.println(\"hello \" + addr.getHostName());}", "query_type": "code"} | |
| {"_id": "cwe_q_000107", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nunsigned char *check_passwd(char *plaintext) {\nctext = simple_digest(\"sha1\",plaintext,strlen(plaintext), ... );\n\n //Login if hash matches stored hash\n\nif (equal(ctext, secret_password())) {\nlogin_user();}}\n\n[Java]\nString plainText = new String(plainTextIn);\nMessageDigest encer = MessageDigest.getInstance(\"SHA\");\nencer.update(plainTextIn);\nbyte[] digest = password.digest();\n\n //Login if hash matches stored hash\n\nif (equal(digest,secret_password())) {\nlogin_user();}", "query_type": "code"} | |
| {"_id": "cwe_q_000108", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\n...\n\n\t\tlogic [31-1:0] data_d, data_q;\n\n\t\t...\n\n\t\tlogic [512-1:0] pass_data;\n\n\t\t...\n\n\t\t\tWrite: begin\n\n\t\t\t\t...\n\n\t\t\t\t\tif (pass_mode) begin\n\n\t\t\t\t\t\t\tpass_data = { {60{8'h00}}, data_d};\n\n\t\t\t\t\t\t\tstate_d = PassChk;\n\n\t\t\t\t\t\t\tpass_mode = 1'b0;\n\n\t\t\t\t\t...\n\n\t\t\tend\n\n\t\t...", "query_type": "code"} | |
| {"_id": "cwe_q_000109", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint isValid(int value) {\nif (value=100) {\nprintf(\"Value is valid\\n\");\nreturn(1);}\nprintf(\"Value is not valid\\n\");\nreturn(0);}\n\n[C#]\nbool isValid(int value) {\nif (value=100) {\nConsole.WriteLine(\"Value is valid.\");\nreturn true;}\nConsole.WriteLine(\"Value is not valid.\");\nreturn false;}", "query_type": "code"} | |
| {"_id": "cwe_q_000110", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nvoid foo(){\n\nrecord_t bar[MAX_SIZE];\n\n /* do something interesting with bar */\n\n...\nfree(bar);\n }\n\n[C]\nrecord_t bar[MAX_SIZE]; //Global var\nvoid foo(){\n\n /* do something interesting with bar */\n\n...\nfree(bar);\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000111", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Verilog]\n// IP definition\n\n\t\t\t module tz_peripheral(clk, reset, data_in, data_in_security_level, ...);\n\n\t\t\t\tinput clk, reset;\n\n\t\t\t\tinput [31:0] data_in;\n\n\t\t\t\tinput data_in_security_level;\n\n\t\t\t\t...\n\n\t\t\t endmodule\n\n\t\t\t // Instantiation of IP in a parent system\n\n\t\t\t module soc(...)\n\n\t\t\t\t...\n\n\t\t\t\ttz_peripheral u_tz_peripheral(\n\n\t\t\t\t .clk(clk),\n\n\t\t\t\t .rst(rst),\n\n\t\t\t\t .data_in(rdata),\n\n\t\t\t\t //Copy-and-paste error or typo grounds data_in_security_level (in this example 0=secure, 1=non-secure) effectively promoting all data to \"secure\")\n\n\t\t\t\t .data_in_security_level(1'b0),\n\n\t\t\t\t);\n\n\t\t\t\t...\n\n\t\t\t endmodule", "query_type": "code"} | |
| {"_id": "cwe_q_000112", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint getValueFromArray(int *array, int len, int index) {\n\nint value;\n\n // check that the array index is less than the maximum\n\n // length of the array\n\nif (index < len) {\n\n // get the value at the specified index of the array\n\nvalue = array[index];\n }\n\n // if array index is invalid then output error message\n\n // and return value indicating error\n\nelse {\nprintf(\"Value is: %d\\n\", array[index]);\nvalue = -1;}\n\nreturn value;\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000113", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint i;\nunsigned int numWidgets;\nWidget **WidgetList;\n\nnumWidgets = GetUntrustedSizeValue();\nif ((numWidgets == 0) || (numWidgets > MAX_NUM_WIDGETS)) {\nExitError(\"Incorrect number of widgets requested!\");}\nWidgetList = (Widget **)malloc(numWidgets * sizeof(Widget *));\nprintf(\"WidgetList ptr=%p\\n\", WidgetList);\nfor(i=0; i<numWidgets; i++) {\nWidgetList[i] = InitializeWidget();}\nWidgetList[numWidgets] = NULL;\nshowWidgets(WidgetList);", "query_type": "code"} | |
| {"_id": "cwe_q_000115", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar b[2000];\n\nFILE *f = fopen(\"dbl_cls.c\", \"r\");\n\nif (f)\n\n{\n\nb[0] = 0;\n\n\tfread(b, 1, sizeof(b) - 1, f);\n\n\tprintf(\"%s\\n'\", b);\n\n\tint r1 = fclose(f);\n\n\tprintf(\"\\n-----------------\\n1 close done '%d'\\n\", r1);\n\n\tint r2 = fclose(f);\t// Double close\n\n\tprintf(\"2 close done '%d'\\n\", r2);\n}", "query_type": "code"} | |
| {"_id": "cwe_q_000116", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nfinal class JavaScriptInterface {\n\nJavaScriptInterface () { }\n\n@JavascriptInterface\npublic String getUserInfo() {\nreturn currentUser.Info();}\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000117", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nif (condition==true)\nDo_X();\nDo_Y();", "query_type": "code"} | |
| {"_id": "cwe_q_000118", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString cmd = null;\n...\ncmd = Environment.GetEnvironmentVariable(\"cmd\");\ncmd = cmd.Trim();", "query_type": "code"} | |
| {"_id": "cwe_q_000119", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n$filename = $_GET['file']; // User-controlled input\n\n\t\t\t\t\techo file_get_contents($filename); // Read and display the file contents", "query_type": "code"} | |
| {"_id": "cwe_q_000120", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nvoid handler (int sigNum) {\n...}\n\nint main (int argc, char* argv[]) {\nsignal(SIGUSR1, handler)\nsignal(SIGUSR2, handler)}", "query_type": "code"} | |
| {"_id": "cwe_q_000121", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[JavaScript]\n<p id=\"ieq3s1\" type=\"text\">(i === s1) is FALSE</p>\n\n <p id=\"s4eq3i\" type=\"text\">(s4 === i) is FALSE</p>\n\n <p id=\"s4eq3s1\" type=\"text\">(s4 === s1) is FALSE</p>\n\n var i = 65;\n\n var s1 = '65';\n\n var s4 = new String('65');\n\n if (i === s1)\n\n {\n\ndocument.getElementById(\"ieq3s1\").innerHTML = \"(i === s1) is TRUE\";\n }\n\n if (s4 === i)\n\n {\n\ndocument.getElementById(\"s4eq3i\").innerHTML = \"(s4 === i) is TRUE\";\n }\n\n if (s4 === s1)\n\n {\n\ndocument.getElementById(\"s4eq3s1\").innerHTML = \"(s4 === s1) is TRUE\";\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000122", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nJava Web App ResourceBundle properties file\n\n...\nwebapp.ldap.username=secretUsername\nwebapp.ldap.password=secretPassword\n...\n\n[ASP.NET]\n...\n<connectionStrings>\n<add name=\"ud_DEV\" connectionString=\"connectDB=uDB; uid=db2admin; pwd=password; dbalias=uDB;\" providerName=\"System.Data.Odbc\" /></connectionStrings>\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000123", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nvoid parse_data(char *untrusted_input){\n\nint m, n, error;\nerror = sscanf(untrusted_input, \"%d:%d\", &m, &n);\nif ( EOF == error ){\ndie(\"Did not specify integer value. Die evil hacker!\\n\");}\n\n /* proceed assuming n and m are initialized correctly */\n\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000124", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Shell]\naz storage account update --name <storage-account> --resource-group <resource-group> --allow-blob-public-access true", "query_type": "code"} | |
| {"_id": "cwe_q_000125", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString GenerateReceiptURL(String baseUrl) {\nRandom ranGen = new Random();\nranGen.setSeed((new Date()).getTime());\nreturn(baseUrl + ranGen.nextInt(400000000) + \".html\");}", "query_type": "code"} | |
| {"_id": "cwe_q_000127", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n#define FAIL 0\n#define SUCCESS 1\n#define ERROR -1\n#define MAX_MESSAGE_SIZE 32\n\nint processMessage(char **message)\n{\n\nint result = SUCCESS;\n\nint length = getMessageLength(message[0]);\nchar *messageBody;\n\nif ((length > 0) && (length < MAX_MESSAGE_SIZE)) {\n\nmessageBody = (char*)malloc(length*sizeof(char));\nmessageBody = &message[1][0];\n\nint success = processMessageBody(messageBody);\n\nif (success == ERROR) {\nresult = ERROR;\nfree(messageBody);}\n }\nelse {\nprintf(\"Unable to process message; invalid message length\");\nresult = FAIL;}\n\nif (result == ERROR) {\nlogError(\"Error processing message\", messageBody);}\n\nreturn result;\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000128", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Python]\nimport subprocess\n\n\t\t import re\n\n\t\t def validate_ip_regex(ip: str):\n\n\t\t ip_validator = re.compile(r\"((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}\")\n\n\t\t if ip_validator.match(ip):\n\n\t\t return ip\n\n\t\t else:\n\n\t\t raise ValueError(\"IP address does not match valid pattern.\")\n\n\t\t def run_ping_regex(ip: str):\n\n\t\t validated = validate_ip_regex(ip)\n\n\t\t # The ping command treats zero-prepended IP addresses as octal\n\n\t\t result = subprocess.call([\"ping\", validated])\n\n\t\t print(result)", "query_type": "code"} | |
| {"_id": "cwe_q_000129", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[XML]\n<ejb-jar>\n...\n<assembly-descriptor>\n<method-permission>\n<role-name>ANYONE</role-name>\n<method>\n<ejb-name>Employee</ejb-name>\n<method-name>getSalary</method-name></method-permission></assembly-descriptor>\n...</ejb-jar>", "query_type": "code"} | |
| {"_id": "cwe_q_000130", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nunsigned int readdata () {\nint amount = 0;\n...\nif (result == ERROR)\namount = -1;\n...\nreturn amount;}", "query_type": "code"} | |
| {"_id": "cwe_q_000133", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Verilog]\n// Parameterized Register module example\n\n\t\t\t// Secure_mode : REGISTER_DEFAULT[0] : When set to 1 register is read only and not writable//\n\n\t\t\tmodule register_example\n\n\t\t\t#(\n\n\t\t\tparameter REGISTER_WIDTH = 8, // Parameter defines width of register, default 8 bits\n\n\t\t\tparameter [REGISTER_WIDTH-1:0] REGISTER_DEFAULT = 2**REGISTER_WIDTH -2 // Default value of register computed from Width. Sets all bits to 1s except bit 0 (Secure _mode)\n\n\t\t\t)\n\n\t\t\t(\n\n\t\t\tinput [REGISTER_WIDTH-1:0] Data_in,\n\n\t\t\tinput Clk,\n\n\t\t\tinput resetn,\n\n\t\t\tinput write,\n\n\t\t\toutput reg [REGISTER_WIDTH-1:0] Data_out\n\n\t\t\t);\n\n\t\t\treg Secure_mode;\n\n\t\t\talways @(posedge Clk or negedge resetn)\n\n\t\t\t if (~resetn)\n\n\t\t\t begin\n\n\t\t\t Data_out <= REGISTER_DEFAULT; // Register content set to Default at reset\n\n\t\t\t Secure_mode <= REGISTER_DEFAULT[0]; // Register Secure_mode set at reset\n\n\t\t\t end\n\n\t\t\t else if (write & ~Secure_mode)\n\n\t\t\t begin\n\n\t\t\t Data_out <= Data_in;\n\n\t\t\t end\n\n\t\t\tendmodule\n\n\t\t\tmodule register_top\n\n\t\t\t(\n\n\t\t\tinput Clk,\n\n\t\t\tinput resetn,\n\n\t\t\tinput write,\n\n\t\t\tinput [31:0] Data_in,\n\n\t\t\toutput reg [31:0] Secure_reg,\n\n\t\t\toutput reg [31:0] Insecure_reg\n\n\t\t\t);\n\n\t\t\tregister_example #(\n\n\t\t\t .REGISTER_WIDTH (", "query_type": "code"} | |
| {"_id": "cwe_q_000134", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Python]\nsock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\nsock.bind( (UDP_IP,UDP_PORT) )\nwhile true:\n\ndata = sock.recvfrom(1024)\nif not data:\nbreak\n\n(requestIP, nameToResolve) = parseUDPpacket(data)\nrecord = resolveName(nameToResolve)\nsendResponse(requestIP,record)", "query_type": "code"} | |
| {"_id": "cwe_q_000135", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nEVP_CIPHER_CTX ctx;\nchar key[EVP_MAX_KEY_LENGTH];\nchar iv[EVP_MAX_IV_LENGTH];\nRAND_bytes(key, b);\nmemset(iv,0,EVP_MAX_IV_LENGTH);\nEVP_EncryptInit(&ctx,EVP_bf_cbc(), key,iv);\n\n[Java]\npublic class SymmetricCipherTest {\n\npublic static void main() {\n\nbyte[] text =\"Secret\".getBytes();\nbyte[] iv ={\n0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};\nKeyGenerator kg = KeyGenerator.getInstance(\"DES\");\nkg.init(56);\nSecretKey key = kg.generateKey();\nCipher cipher = Cipher.getInstance(\"DES/CBC/PKCS5Padding\");\nIvParameterSpec ips = new IvParameterSpec(iv);\ncipher.init(Cipher.ENCRYPT_MODE, key, ips);\nreturn cipher.doFinal(inpBytes);\n }\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000138", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint *p = x;\nchar * second_char = (char *)(p + 1);", "query_type": "code"} | |
| {"_id": "cwe_q_000142", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Perl]\n$ConfigDir = \"/home/myprog/config\";\n$uname = GetUserInput(\"username\");\n\n # avoid this weakness, this weakness, others.\n\nExitError(\"Bad hacker!\") if ($uname !~ /^\\w+$/);\n$file = \"$ConfigDir/$uname.txt\";\nif (! (-e $file)) {\nExitError(\"Error: $file does not exist\");}\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000143", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\n...\nDriverManager.getConnection(url, \"scott\", \"tiger\");\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000144", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Perl]\nmy $UserPrivilegeArray = [\"user\", \"user\", \"admin\", \"user\"];\n\nmy $userID = get_current_user_ID();\n\nif ($UserPrivilegeArray eq \"user\") {\nprint \"Regular user!\\n\";}\nelse {\nprint \"Admin!\\n\";}\n\nprint \"\\$UserPrivilegeArray = $UserPrivilegeArray\\n\";", "query_type": "code"} | |
| {"_id": "cwe_q_000145", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\nfunction persistLogin($username, $password){\n$data = array(\"username\" => $username, \"password\"=> $password);\nsetcookie (\"userdata\", $data);}", "query_type": "code"} | |
| {"_id": "cwe_q_000146", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Python]\ndef storePassword(userName,Password):\nhasher = hashlib.new('md5')\nhasher.update(Password)\nhashedPassword = hasher.digest()\n\n # UpdateUserLogin returns True on success, False otherwise\n\nreturn updateUserLogin(userName,hashedPassword)", "query_type": "code"} | |
| {"_id": "cwe_q_000148", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar buf[24];\nprintf(\"Please enter your name and press <Enter>\\n\");\ngets(buf);\n...}", "query_type": "code"} | |
| {"_id": "cwe_q_000149", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nstruct stat *sb;\n...\nlstat(\"...\",sb); // it has not been updated since the last time it was read\nprintf(\"stated file\\n\");\nif (sb->st_mtimespec==...){\nprint(\"Now updating things\\n\");\nupdateThings();}", "query_type": "code"} | |
| {"_id": "cwe_q_000150", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nlogger.info(\"User's street address: \" + request.getParameter(\"streetAddress\"));", "query_type": "code"} | |
| {"_id": "cwe_q_000151", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nprivate void auth(LoginContext lc, HttpSession session) throws LoginException {\n...\nlc.login();\n...}", "query_type": "code"} | |
| {"_id": "cwe_q_000152", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic class Main {\n\npublic static void main(String[] args) {\n\ndouble s = 10.0;\n\ndouble r = 1.0;\n\ndouble pi = 3.14159;\n\ndouble surface_area;\n\nif(r > 0.0) {\n\n// complex math equations\n\nsurface_area = pi * r * s + pi * Math.pow(r, 2);\n\n}\n\nif(r > 1.0) {\n\n// a complex set of math\n\nsurface_area = pi * r * s + pi * Math.pow(r, 2);\n\n}\n\n}\n\n}", "query_type": "code"} | |
| {"_id": "cwe_q_000154", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n#define SUCCESS (1)\n#define FAILURE (0)\n\nint contains_char(char c){\n\nchar *str;\nstr = (char*)malloc(20*sizeof(char));\nstrcpy(str, \"Search Me!\");\nwhile( *str != NULL){\n\nif( *str == c ){\n\n /* matched char, free string and return success */\n\nfree(str);\nreturn SUCCESS;\n }\n\n /* didn't match yet, increment pointer and try next char */\n\nstr = str + 1;\n }\n\n /* we did not match the char in the string, free mem and return failure */\n\nfree(str);\nreturn FAILURE;\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000155", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic void actionPerformed(ActionEvent e) {\nif (e.getSource() == button) {\nSystem.out.println(\"print out secret information\");}}", "query_type": "code"} | |
| {"_id": "cwe_q_000157", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Perl]\nsub ReportAuth {\nmy ($username, $result, $fatal) = @_;\nPrintLog(\"auth: username=%s, result=%d\", $username, $result);\nif (($result ne \"success\") && $fatal) {\ndie \"Failed!\\n\";}}\n\nsub PrivilegedFunc\n{\nmy $result = CheckAuth($username);\nReportAuth($username, $result, 0);\nDoReallyImportantStuff();}", "query_type": "code"} | |
| {"_id": "cwe_q_000158", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C++]\nint outputStringToFile(char *output, char *filename) {\n\nopenFileToWrite(filename);\nwriteToFile(output);\ncloseFile(filename);\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000159", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\ntry {\n\n // something that might throw IOException\n\n...\n } catch (IOException ioe) {\nresponse.sendError(SC_NOT_FOUND);}", "query_type": "code"} | |
| {"_id": "cwe_q_000161", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[JSP]\n<!-- FIXME: calling this with more than 30 args kills the JDBC server -->", "query_type": "code"} | |
| {"_id": "cwe_q_000162", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C++]\nString trustedReferer = \"\nwhile(true){\nn = read(newsock, buffer, BUFSIZE);\nrequestPacket = processPacket(buffer, n);\nif (requestPacket.referer == trustedReferer){\nopenNewSecureSession(requestPacket);}}\n\n[Java]\nboolean processConnectionRequest(HttpServletRequest request){\nString referer = request.getHeader(\"referer\")\nString trustedReferer = \"\nif(referer.equals(trustedReferer)){\nopenPrivilegedConnection(request);\nreturn true;}\nelse{\nsendPrivilegeError(request);\nreturn false;}}", "query_type": "code"} | |
| {"_id": "cwe_q_000163", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Perl]\nmy $username=param('username');\n\nmy $password=param('password');\n\nif (IsValidUsername($username) == 1)\n\n{\n\nif (IsValidPassword($username, $password) == 1)\n\n{\n\nprint \"Login Successful\";\n }\n\nelse\n\n{\n\nprint \"Login Failed - incorrect password\";\n }\n }\n\nelse\n\n{\n\nprint \"Login Failed - unknown username\";\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000164", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[XML]\n<manifest package=\"com.example.vulnerableApplication\">\n\n<application>\n\n ...\n\n<receiver android:name=\".ShutdownReceiver\">\n<intent-filter>\n<action android:name=\"android.intent.action.ACTION_SHUTDOWN\" /></intent-filter></receiver>\n\n ...\n\n</application>\n </manifest>\n\n[Java]\n...\n\nIntentFilter filter = new IntentFilter(Intent.ACTION_SHUTDOWN);\nBroadcastReceiver sReceiver = new ShutDownReceiver();\nregisterReceiver(sReceiver, filter);\n\n ...\n\npublic class ShutdownReceiver extends BroadcastReceiver {\n@Override\npublic void onReceive(final Context context, final Intent intent) {\nmainActivity.saveLocalData();\nmainActivity.stopActivity();}}", "query_type": "code"} | |
| {"_id": "cwe_q_000166", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[XML]\n<cross-domain-policy xmlns:xsi=\"\nxsi:noNamespaceSchemaLocation=\"\n<allow-access-from domain=\"*.example.com\"/>\n<allow-access-from domain=\"*\"/>\n</cross-domain-policy>\n\n[XML]\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<access-policy>\n<cross-domain-access>\n<policy>\n<allow-from http-request-headers=\"SOAPAction\">\n<domain uri=\"*\"/>\n</allow-from>\n<grant-to>\n<resource path=\"/\" include-subpaths=\"true\"/>\n</grant-to>\n</policy>\n</cross-domain-access>\n</access-policy>", "query_type": "code"} | |
| {"_id": "cwe_q_000167", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nif (cert = SSL_get_peer_certificate(ssl)) {\n\n // got certificate, host can be trusted\n\n //foo=SSL_get_verify_result(ssl);\n\n //if (X509_V_OK==foo) ...\n\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000168", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nPublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\ntry {\n...} catch (ApplicationSpecificException ase) {\nlogger.error(\"Caught: \" + ase.toString());}}", "query_type": "code"} | |
| {"_id": "cwe_q_000169", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nsd = socket(AF_INET, SOCK_DGRAM, 0);\nserv.sin_family = AF_INET;\nserv.sin_addr.s_addr = htonl(INADDR_ANY);\nservr.sin_port = htons(1008);\nbind(sd, (struct sockaddr *) & serv, sizeof(serv));\n\nwhile (1) {\nmemset(msg, 0x0, MAX_MSG);\nclilen = sizeof(cli);\nif (inet_ntoa(cli.sin_addr)==getTrustedAddress()) {\nn = recvfrom(sd, msg, MAX_MSG, 0, (struct sockaddr *) & cli, &clilen);}}\n\n[Java]\nwhile(true) {\n\nDatagramPacket rp=new DatagramPacket(rData,rData.length);\noutSock.receive(rp);\nString in = new String(p.getData(),0, rp.getLength());\nInetAddress clientIPAddress = rp.getAddress();\nint port = rp.getPort();\n\nif (isTrustedAddress(clientIPAddress) & secretKey.equals(in)) {\nout = secret.getBytes();\nDatagramPacket sp =new DatagramPacket(out,out.length, IPAddress, port); outSock.send(sp);}\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000170", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar *foo;\nint counter;\nfoo=calloc(sizeof(char)*10);\n\nfor (counter=0;counter!=10;counter++) {\nfoo[counter]='a';\n\nprintf(\"%s\\n\",foo);\n}", "query_type": "code"} | |
| {"_id": "cwe_q_000171", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar* getName() {\nchar name[STR_MAX];\nfillInName(name);\nreturn name;}", "query_type": "code"} | |
| {"_id": "cwe_q_000172", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nIntentFilter filter = new IntentFilter(\"com.example.RemoveUser\");\nMyReceiver receiver = new MyReceiver();\nregisterReceiver(receiver, filter);\n\npublic class DeleteReceiver extends BroadcastReceiver {\n@Override\npublic void onReceive(Context context, Intent intent) {\nint userID = intent.getIntExtra(\"userID\");\ndestroyUserData(userID);}}", "query_type": "code"} | |
| {"_id": "cwe_q_000173", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic class FileUploadServlet extends HttpServlet {\n\n...\n\nprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\nresponse.setContentType(\"text/html\");\nPrintWriter out = response.getWriter();\nString contentType = request.getContentType();\n\n// the starting position of the boundary header\nint ind = contentType.indexOf(\"boundary=\");\nString boundary = contentType.substring(ind+9);\n\nString pLine = new String();\nString uploadLocation = new String(UPLOAD_DIRECTORY_STRING); //Constant value\n\n// verify that content type is multipart form data\nif (contentType != null && contentType.indexOf(\"multipart/form-data\") != -1) {\n\n// extract the filename from the Http header\nBufferedReader br = new BufferedReader(new InputStreamReader(request.getInputStream()));\n...\npLine = br.readLine();\nString filename = pLine.substring(pLine.lastIndexOf(\"\\\\\"), pLine.lastIndexOf(\"\\\"\"));\n...\n\n// output the file to the local upload directory\ntry {\n\nBufferedWriter bw = new BufferedWriter(new FileWriter(uploadLocation+filename, true));\nfor (String line; (line=br.readLine())!=null; ) {\nif (line.indexOf(boundary) == -1) {\nbw.write(line);\nbw.newLine()", "query_type": "code"} | |
| {"_id": "cwe_q_000174", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[HTML]\n<div class=\"header\"> Welcome!\n<div id=\"loginBox\">Please Login:\n<form id =\"loginForm\" name=\"loginForm\" action=\"login.php\" method=\"post\">\nUsername: <input type=\"text\" name=\"username\" />\n<br/>\nPassword: <input type=\"password\" name=\"password\" />\n<input type=\"submit\" value=\"Login\" />\n</form></div>\n<div id=\"WeatherWidget\">\n<script type=\"text/javascript\" src=\"externalDomain.example.com/weatherwidget.js\"></script></div></div>", "query_type": "code"} | |
| {"_id": "cwe_q_000175", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\nfunction runEmployeeQuery($dbName, $name){\nmysql_select_db($dbName,$globalDbHandle) or die(\"Could not open Database\".$dbName);\n\n //Use a prepared statement to avoid this weakness\n\n$preparedStatement = $globalDbHandle->prepare('SELECT * FROM employees WHERE name = :name');\n$preparedStatement->execute(array(':name' => $name));\nreturn $preparedStatement->fetchAll();}\n\n /.../\n\n$employeeRecord = runEmployeeQuery('EmployeeDB',$_GET['EmployeeName']);", "query_type": "code"} | |
| {"_id": "cwe_q_000176", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nunsigned char *simple_digest(char *alg,char *buf,unsigned int len, int *olen) {\nconst EVP_MD *m;\nEVP_MD_CTX ctx;\nunsigned char *ret;\nOpenSSL_add_all_digests();\nif (!(m = EVP_get_digestbyname(alg))) return NULL;\nif (!(ret = (unsigned char*)malloc(EVP_MAX_MD_SIZE))) return NULL;\nEVP_DigestInit(&ctx, m);\nEVP_DigestUpdate(&ctx,buf,len);\nEVP_DigestFinal(&ctx,ret,olen);\nreturn ret;}\nunsigned char *generate_password_and_cmd(char *password_and_cmd) {\nsimple_digest(\"sha1\",password,strlen(password_and_cmd)\n...\n);}\n\n[Java]\nString command = new String(\"some cmd to execute & the password\") MessageDigest encer = MessageDigest.getInstance(\"SHA\");\nencer.update(command.getBytes(\"UTF-8\"));\nbyte[] digest = encer.digest();", "query_type": "code"} | |
| {"_id": "cwe_q_000177", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Verilog]\nmodule foo_bar(data_out, usr_id, data_in, clk, rst_n);\n\n \t\t\toutput reg [7:0] data_out;\n\n \t\t\tinput wire [2:0] usr_id;\n\n \t\t\tinput wire [7:0] data_in;\n\n \t\t\tinput wire clk, rst_n;\n\n \t\t\twire grant_access;\n\n \t\t\talways @ (posedge clk or negedge rst_n)\n\n \t\t\tbegin\n\n\t\t\t\t if (!rst_n)\n\n\t\t\t\t\tdata_out = 0;\n\n\t\t\t\t else\n\n\t\t\t\t\tdata_out = (grant_access) ? data_in : data_out;\n\n\t\t\t\t\tassign grant_access = (usr_id == 3'h4) ? 1'b1 : 1'b0;\n\n\t\t\t end\n\n\t\t\t endmodule", "query_type": "code"} | |
| {"_id": "cwe_q_000178", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic String removeScriptTags(String input, String mask) {\nreturn input.replaceAll(\"script\", mask);}", "query_type": "code"} | |
| {"_id": "cwe_q_000179", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\ntry {\nURL u = new URL(\"\nHttpURLConnection hu = (HttpURLConnection) u.openConnection();\nhu.setRequestMethod(\"PUT\");\nhu.connect();\nOutputStream os = hu.getOutputStream();\nhu.disconnect();}\ncatch (IOException e) {\n\n //...\n\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000180", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic class BookStore {\n\nprivate BookStoreInventory inventory;\nprivate SalesDBManager sales;\n...\n\n // constructor for BookStore\n\npublic BookStore() {\nthis.inventory = new BookStoreInventory();\nthis.sales = new SalesDBManager();\n...}\npublic void updateSalesAndInventoryForBookSold(String bookISBN) {\n\n // Get book object from inventory using ISBN\n\nBook book = inventory.getBookWithISBN(bookISBN);\n\n // update sales information for book sold\n\nsales.updateSalesInformation(book);\n\n // update inventory\n\ninventory.updateInventory(book);\n }\n\n // other BookStore methods\n\n...\n }\npublic class Book {\nprivate String title;\nprivate String author;\nprivate String isbn;\n\n // Book object constructors and get/set methods\n\n...}", "query_type": "code"} | |
| {"_id": "cwe_q_000182", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar* ptr = (char*)malloc (SIZE);\n...\nif (abrt) {\nfree(ptr);}\n...\nfree(ptr);", "query_type": "code"} | |
| {"_id": "cwe_q_000185", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n<?php\n$dbName = 'usersDB';\n$dbPassword = 'skjdh#67nkjd3$3$';\n?>\n\n[PHP]\n<?php\ninclude('database.inc');\n$db = connectToDB($dbName, $dbPassword);\n$db.authenticateUser($username, $password);\n?>", "query_type": "code"} | |
| {"_id": "cwe_q_000186", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nseteuid(0);\n\n /* do some stuff */\n\nseteuid(getuid());", "query_type": "code"} | |
| {"_id": "cwe_q_000187", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nstruct node {\nint data;\nstruct node* next;};\n\n // Returns the number of nodes in a linked list from\n\n // the given pointer to the head of the list.\n\nint size(struct node* head) {\nstruct node* current = head;\nstruct node* tail;\nwhile (current != NULL) {\ntail = current;\ncurrent = current->next;}\nreturn tail - head;}\n\n // other methods for manipulating the list\n\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000188", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\n...\n\n\t\t\t\t\t\tbootrom i_bootrom_patch (\n\n\t\t\t\t\t\t\t.clk_i ,\n\n\t\t\t\t\t\t\t.req_i ( rom_req ),\n\n\t\t\t\t\t\t\t.addr_i ( rom_addr ),\n\n\t\t\t\t\t\t\t.rdata_o ( rom_rdata_patch )\n\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tbootrom_linux i_bootrom_linux (\n\n\t\t\t\t\t\t\t.clk_i ,\n\n\t\t\t\t\t\t\t.req_i ( rom_req ),\n\n\t\t\t\t\t\t\t.addr_i ( rom_addr ),\n\n\t\t\t\t\t\t\t.rdata_o ( rom_rdata_linux )\n\n\t\t\t\t\t\t);\n\n\t\t\t\t\tassign rom_rdata = (ariane_boot_sel_i) ? rom_rdata_linux : rom_rdata_linux;\n\n\t\t\t\t\t...", "query_type": "code"} | |
| {"_id": "cwe_q_000189", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nusrname = request.getParameter(\"usrname\");\nif (session.getAttribute(ATTR_USR) == null) {\nsession.setAttribute(ATTR_USR, usrname);}\n\n[C#]\nusrname = request.Item(\"usrname\");\nif (session.Item(ATTR_USR) == null) {\nsession.Add(ATTR_USR, usrname);}", "query_type": "code"} | |
| {"_id": "cwe_q_000190", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nprivate long someLongValue;\npublic long getLongValue() {\nreturn someLongValue;}\n\npublic void setLongValue(long l) {\nsomeLongValue = l;}", "query_type": "code"} | |
| {"_id": "cwe_q_000191", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n$username = $_GET['username'];\n\n\t\t try {\n\n\t\t if (strlen($username) > 20) {\n\n\t\t throw new Exception(\"Username too long\");\n\n\t\t }\n\n\t\t } catch (Exception $e) {\n\n\t\t error_log(\"User registration failed: \" . $username);\n\t\t }", "query_type": "code"} | |
| {"_id": "cwe_q_000192", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\n...\nProperties prop = new Properties();\nprop.load(new FileInputStream(\"config.properties\"));\nString password = prop.getProperty(\"password\");\nDriverManager.getConnection(url, usr, password);\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000193", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Go]\nfunc HandleRequest(client http.Client, request *http.Request) (*http.Response, error) {\n\n response, err := client.Do(request)\n\n defer response.Body.Close()\n\n if err != nil {\n\n return nil, err\n\n }\n...\n\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000194", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar* processNext(char* strm) {\nchar buf[512];\nshort len = *(short*) strm;\nstrm += sizeof(len);\nif (len <= 512) {\nmemcpy(buf, strm, len);\nprocess(buf);\nreturn strm + len;}\nelse {\nreturn -1;}}", "query_type": "code"} | |
| {"_id": "cwe_q_000195", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n$user = $_GET['user'];\n$pass = $_GET['pass'];\n$checkpass = $_GET['checkpass'];\nif ($pass == $checkpass) {\nSetUserPassword($user, $pass);}", "query_type": "code"} | |
| {"_id": "cwe_q_000197", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n#define MAXLEN 1024\n...\nchar *pathbuf[MAXLEN];\n...\nread(cfgfile,inputbuf,MAXLEN); //does not null terminate\nstrcpy(pathbuf,inputbuf); //requires null terminated input\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000198", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n#define NAME_TYPE 1\n#define ID_TYPE 2\n\nstruct MessageBuffer\n{\nint msgType;\nunion {\nchar *name;\nint nameID;};};\n\nint main (int argc, char **argv) {\n\nstruct MessageBuffer buf;\nchar *defaultMessage = \"Hello World\";\n\nbuf.msgType = NAME_TYPE;\nbuf.name = defaultMessage;\nprintf(\"Pointer of buf.name is %p\\n\", buf.name);\n\n /* This particular value for nameID is used to make the code architecture-independent. If coming from untrusted input, it could be any value. */\n\nbuf.nameID = (int)(defaultMessage + 1);\nprintf(\"Pointer of buf.name is now %p\\n\", buf.name);\nif (buf.msgType == NAME_TYPE) {\nprintf(\"Message: %s\\n\", buf.name);}\nelse {\nprintf(\"Message: Use ID %d\\n\", buf.nameID);}\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000199", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nprivate boolean initialized = true;\npublic void someMethod() {\n\nif (!initialized) {\n\n // perform initialization tasks\n\n...\n\ninitialized = true;\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000200", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nnresp = packet_get_int();\nif (nresp > 0) {\nresponse = xmalloc(nresp*sizeof(char*));\nfor (i = 0; i < nresp; i++) response[i] = packet_get_string(NULL);}", "query_type": "code"} | |
| {"_id": "cwe_q_000201", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C++]\nprivate: float price;\npublic: void changePrice(float newPrice) {\nprice = newPrice;}", "query_type": "code"} | |
| {"_id": "cwe_q_000203", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic void removeDatabase(String databaseName) {\n\ntry {\n\nStatement stmt = conn.createStatement();\nstmt.execute(\"DROP DATABASE \" + databaseName);\n\n } catch (SQLException ex) {...}\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000206", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\ntry {\n...\nthrow IllegalArgumentException();}\nfinally {\nreturn r;}", "query_type": "code"} | |
| {"_id": "cwe_q_000209", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nIntent intent = new Intent();\nintent.setAction(\"com.example.BackupUserData\");\nintent.setData(file_uri);\nintent.addFlags(FLAG_GRANT_READ_URI_PERMISSION);\nsendBroadcast(intent);", "query_type": "code"} | |
| {"_id": "cwe_q_000210", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\n...\n\n\t\talways @(posedge clk_i)\n\n\t\t\tbegin\n\n\t\t\t\tif(~(rst_ni && ~jtag_unlock && ~rst_9))\n\n\t\t\t\t\tbegin\n\n\t\t\t\t\t\tfor (j=0; j < 6; j=j+1) begin\n\n\t\t\t\t\t\t\treglk_mem[j] <= 'h0;\n\n\t\t\t\t\t\tend\n\n\t\t\t\t\tend\n\n\t\t...", "query_type": "code"} | |
| {"_id": "cwe_q_000213", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n// $user and $pass automatically set from POST request\n\nif (login_user($user,$pass)) {\n$authorized = true;}\n\n ...\n\nif ($authorized) {\ngeneratePage();}", "query_type": "code"} | |
| {"_id": "cwe_q_000215", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Verilog]\nmodule ocp2ahb\n\n\t (\n\n\t ahb_hprot,\n\n\t ocp_mreqinfo\n\n\t );\n\n\t output [1:0] ahb_hprot; // output is 2 bit signal for AHB HPROT\n\n\t input [4:0] ocp_mreqinfo; // input is 5 bit signal from OCP MReqInfo\n\n\t wire [6:0] p0_mreqinfo_o_temp; // OCP signal that transmits hardware identity of bus controller\n\n\t wire y;\n\n\t reg [1:0] ahb_hprot;\n\n\t // hardware identity of bus controller is in bits 5:1 of p0_mreqinfo_o_temp signal\n\n\t assign p0_mreqinfo_o_temp[6:0] = {1'b0, ocp_mreqinfo[4:0], y};\n\n\t always @*\n\n\t begin\n\n\t case (p0_mreqinfo_o_temp[4:2])\n\n\t 000: ahb_hprot = 2'b11; // OCP MReqInfo to AHB HPROT mapping\n\n\t 001: ahb_hprot = 2'b00;\n\n\t 010: ahb_hprot = 2'b00;\n\n\t 011: ahb_hprot = 2'b01;\n\n\t 100: ahb_hprot = 2'b00;\n\n\t 101: ahb_hprot = 2'b00;\n\n\t 110: ahb_hprot = 2'b10;\n\n\t 111: ahb_hprot = 2'b00;\n\n\t endcase\n\n\t end\n\n\t endmodule", "query_type": "code"} | |
| {"_id": "cwe_q_000217", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\n// Read DOM\n\ntry {\n...\nDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\nfactory.setValidating( false );\n....\nc_dom = factory.newDocumentBuilder().parse( xmlFile );} catch(Exception ex) {\n...}", "query_type": "code"} | |
| {"_id": "cwe_q_000218", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n$MessageFile = \"messages.out\";\nif ($_GET[\"action\"] == \"NewMessage\") {\n$name = $_GET[\"name\"];\n$message = $_GET[\"message\"];\n$handle = fopen($MessageFile, \"a+\");\nfwrite($handle, \"<b>$name</b> says '$message'<hr>\\n\");\nfclose($handle);\necho \"Message Saved!<p>\\n\";}\nelse if ($_GET[\"action\"] == \"ViewMessages\") {\ninclude($MessageFile);}", "query_type": "code"} | |
| {"_id": "cwe_q_000219", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[XML]\n<system.serviceModel>\n<behaviors>\n<serviceBehaviors>\n<behavior name=\"NewBehavior\">\n<serviceSecurityAudit auditLogLocation=\"Default\"\nsuppressAuditFailure=\"false\"\nserviceAuthorizationAuditLevel=\"None\"\nmessageAuthenticationAuditLevel=\"None\" />\n...\n\n </system.serviceModel>", "query_type": "code"} | |
| {"_id": "cwe_q_000220", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic class DoubleDead {\nprivate void doTweedledee() {\ndoTweedledumb();}\nprivate void doTweedledumb() {\ndoTweedledee();}\npublic static void main(String[] args) {\nSystem.out.println(\"running DoubleDead\");}}", "query_type": "code"} | |
| {"_id": "cwe_q_000221", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint processMessageFromSocket(int socket) {\n\n\t\t // initialize variable to represent the failure case by default\n\n\t\t int success = -1;\n\n char buffer[BUFFER_SIZE];\n\n\t\t char message[MESSAGE_SIZE];\n\n // get message from socket and store into buffer\n\n // for clarity of this example, ignore the possibility that buffer > BUFFER_SIZE\n\n\t\t if (getMessage(socket, buffer, BUFFER_SIZE) > 0) {\n\n // place contents of the buffer into message structure\n\n\t\t ExMessage *msg = recastBuffer(buffer);\n\n // copy message body into string for processing\n\n int index;\n\n\t\t for (index = 0; index < msg->msgLength; index++) {\n\n\t\t message[index] = msg->msgBody[index];\n\n\t\t }\n\n\t\t message[index] = '\\0';\n\n // process message\n\n\t\t success = processMessage(message);\n\n\t\t }\n\n\t\t return success;\n\n\t\t }", "query_type": "code"} | |
| {"_id": "cwe_q_000222", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic final class urlTool extends Applet {\npublic final static URL[] urls;\n...}", "query_type": "code"} | |
| {"_id": "cwe_q_000223", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic BankAccount getUserBankAccount(String username, String accountNumber) {\n\nBankAccount userAccount = null;\nString query = null;\ntry {\nif (isAuthorizedUser(username)) {\nquery = \"SELECT * FROM accounts WHERE owner = \"\n+ username + \" AND accountID = \" + accountNumber;\nDatabaseManager dbManager = new DatabaseManager();\nConnection conn = dbManager.getConnection();\nStatement stmt = conn.createStatement();\nResultSet queryResult = stmt.executeQuery(query);\nuserAccount = (BankAccount)queryResult.getObject(accountNumber);}} catch (SQLException ex) {\nString logMessage = \"Unable to retrieve account information from database,\\nquery: \" + query;\nLogger.getLogger(BankManager.class.getName()).log(Level.SEVERE, logMessage, ex);}\nreturn userAccount;\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000224", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint VerifyAdmin(char *password) {\n\nif (strcmp(password,\"68af404b513073584c4b6f22b6c63e6b\")) {\n\nprintf(\"Incorrect Password!\\n\");\nreturn(0);\n }\nprintf(\"Entering Diagnostic Mode...\\n\");\nreturn(1);\n }\n\n[Java]\npublic boolean VerifyAdmin(String password) {\nif (password.equals(\"68af404b513073584c4b6f22b6c63e6b\")) {\nSystem.out.println(\"Entering Diagnostic Mode...\");\nreturn true;}\nSystem.out.println(\"Incorrect Password!\");\nreturn false;\n\n[C#]\nint VerifyAdmin(String password) {\nif (password.Equals(\"68af404b513073584c4b6f22b6c63e6b\")) {\nConsole.WriteLine(\"Entering Diagnostic Mode...\");\nreturn(1);}\nConsole.WriteLine(\"Incorrect Password!\");\nreturn(0);}", "query_type": "code"} | |
| {"_id": "cwe_q_000225", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n...\n\n if (signature_matches) // <-Glitch Here\n\n {\n\n load_runtime_firmware();\n\n }\n\n else\n\n {\n\n do_not_load_runtime_firmware();\n\n }\n\n ...", "query_type": "code"} | |
| {"_id": "cwe_q_000226", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nsd = socket(AF_INET, SOCK_DGRAM, 0); serv.sin_family = AF_INET;\nserv.sin_addr.s_addr = htonl(INADDR_ANY);\nservr.sin_port = htons(1008);\nbind(sd, (struct sockaddr *) & serv, sizeof(serv));\nwhile (1) {\n\nmemset(msg, 0x0, MAX_MSG);\nclilen = sizeof(cli);\nif (inet_ntoa(cli.sin_addr)==...) n = recvfrom(sd, msg, MAX_MSG, 0, (struct sockaddr *) & cli, &clilen);\n }\n\n[Java]\nwhile(true) {\nDatagramPacket packet = new DatagramPacket(data,data.length,IPAddress, port);\nsocket.send(sendPacket);}", "query_type": "code"} | |
| {"_id": "cwe_q_000227", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nlogger.info(\"Username: \" + usernme + \", CCN: \" + ccn);", "query_type": "code"} | |
| {"_id": "cwe_q_000228", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString username = getUserName();\nif (username.equals(ADMIN_USER)) {\n...}", "query_type": "code"} | |
| {"_id": "cwe_q_000230", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\n...\npublic static final double price = 20.00;\nint quantity = currentUser.getAttribute(\"quantity\");\ndouble total = price * quantity;\nchargeUser(total);\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000231", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic class Truck {\n\nprivate String make;\nprivate String model;\nprivate int year;\n\npublic boolean equals(Object o) {\n\nif (o == null) return false;\nif (o == this) return true;\nif (!(o instanceof Truck)) return false;\n\nTruck t = (Truck) o;\n\nreturn (this.make.equals(t.getMake()) && this.model.equals(t.getModel()));\n }\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000232", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n$redirect_url = $_GET['url'];\nheader(\"Location: \" . $redirect_url);", "query_type": "code"} | |
| {"_id": "cwe_q_000234", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C#]\nchar[] byteArray = new char[1024];\nfor (IEnumerator i=users.GetEnumerator(); i.MoveNext() ;i.Current()) {\nString userName = (String) i.Current();\nString pFileName = PFILE_ROOT + \"/\" + userName;\nStreamReader sr = new StreamReader(pFileName);\nsr.Read(byteArray,0,1024);//the file is always 1k bytes\nsr.Close();\nprocessPFile(userName, byteArray);}\n\n[Java]\nFileInputStream fis;\nbyte[] byteArray = new byte[1024];\nfor (Iterator i=users.iterator(); i.hasNext();) {\n\nString userName = (String) i.next();\nString pFileName = PFILE_ROOT + \"/\" + userName;\nFileInputStream fis = new FileInputStream(pFileName);\nfis.read(byteArray); // the file is always 1k bytes\nfis.close();\nprocessPFile(userName, byteArray);", "query_type": "code"} | |
| {"_id": "cwe_q_000235", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Python]\nfrom langchain.agents import AgentExecutor, create_tool_calling_agent, tool\n\n\t\t\t\t from langchain_openai import ChatOpenAI\n\n\t\t\t\t from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder\n\n\t\t\t\t from langchain_core.messages import AIMessage, HumanMessage\n\n\t\t\t\t @tool\n\n\t\t\t\t def tell_joke(content):\n\n\t\t\t\t\t\"\"\"Tell a joke based on the provided user-supplied content\"\"\"\n\n\t\t\t\t\tpass\n\n\t\t\t\t tools = [tell_joke]\n\n\t\t\t\t system_prompt = \"\"\"\n\n\t\t\t\t You are a witty and helpful LLM agent, ready to sprinkle humor into your responses like confetti at a birthday party.\n\n\t\t\t\t Aim to make users smile while providing clear and useful information, balancing hilarity with helpfulness.\n\n\t\t\t\t You have a secret token 48a67f to use during operation of your task.\n\n\t\t\t\t \"\"\"\n\n\t\t\t\t prompt = ChatPromptTemplate.from_messages(\n\n\t\t\t\t\t[\n\n\t\t\t\t\t (\"system\", system_prompt),\n\n\t\t\t\t\t (\"human\", \"{input}\"),\n\n\t\t\t\t\t MessagesPlaceholder(variable_name=\"agent_scratchpad\")\n\n\t\t\t\t\t]\n\n\t\t\t\t )\n\n\t\t\t\t model = ChatOpenAI(model=\"gpt-3.5-turbo\", openai_api_key=\"KEY\")\n\n\t\t\t\t agent = create_tool_calling_agent(model, tools, prompt)\n\n\t\t\t\t agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)\n\n\t", "query_type": "code"} | |
| {"_id": "cwe_q_000236", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nvoid getUserInfo(char *username, struct _USER_INFO_2 info){\nWCHAR unicodeUser[UNLEN+1];\nMultiByteToWideChar(CP_ACP, 0, username, -1, unicodeUser, sizeof(unicodeUser));\nNetUserGetInfo(NULL, unicodeUser, 2, (LPBYTE *)&info);}", "query_type": "code"} | |
| {"_id": "cwe_q_000238", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\ntry {\nConnection con = DriverManager.getConnection(some_connection_string);}\ncatch ( Exception e ) {\nlog( e );}", "query_type": "code"} | |
| {"_id": "cwe_q_000239", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nvoid processString (char *str) {\n\nint i;\n\nfor(i=0; i<strlen(str); i++) {\nif (isalnum(str[i])){\nprocessChar(str[i]);}\nelse if (str[i] = ':') {\nmovingToNewInput();}}}\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000240", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar buf[MAXPATH];\n...\nreadlink(pathname, buf, MAXPATH);\nint length = strlen(buf);\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000241", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[PHP]\n$xmlContent = file_get_contents('php://input');\n\n if (empty($xmlContent)) {\n\n http_response_code(400);\n\n exit('No XML content received.');\n\n }\n\n $xml = simplexml_load_string($xmlContent, 'SimpleXMLElement');\n\n echo $xml->asXML();", "query_type": "code"} | |
| {"_id": "cwe_q_000242", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\n@Stateless\npublic class InterestRateBean implements InterestRateRemote {\n\nprivate Document interestRateXMLDocument = null;\nprivate File interestRateFile = null;\n\npublic InterestRateBean() {\n\ntry {\n\n /* get XML document from the local filesystem */\n\ninterestRateFile = new File(Constants.INTEREST_RATE_FILE);\n\nif (interestRateFile.exists())\n{\nDocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\nDocumentBuilder db = dbf.newDocumentBuilder();\ninterestRateXMLDocument = db.parse(interestRateFile);}\n } catch (IOException ex) {...}\n }\n\npublic BigDecimal getInterestRate(Integer points) {\nreturn getInterestRateFromXML(points);}\n\n /* member function to retrieve interest rate from XML document on the local file system */\n\nprivate BigDecimal getInterestRateFromXML(Integer points) {...}\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000243", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic String readFile(String filename) {\n\nString retString = null;\ntry {\n\n// initialize File and FileReader objects\nFile file = new File(filename);\nFileReader fr = new FileReader(file);\n\n// initialize character buffer\nlong fLen = file.length();\nchar[] cBuf = new char[(int) fLen];\n\n// read data from file\nint iRead = fr.read(cBuf, 0, (int) fLen);\n\n// close file\nfr.close();\n\nretString = new String(cBuf);\n\n } catch (Exception ex) {\n/* do nothing, but catch so it'll compile... */}\nreturn retString;\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000244", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[JavaScript]\nlet sessionId = generateSessionId()\n\n let cookieOptions = { domain: 'example.com' }\n\n response.cookie('sessionid', sessionId, cookieOptions)", "query_type": "code"} | |
| {"_id": "cwe_q_000245", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[JavaScript]\nvar test_string = \"Bad characters: $@#\";\n\n var bad_pattern = /^(\\w+\\s?)*$/i;\n\n var result = test_string.search(bad_pattern);", "query_type": "code"} | |
| {"_id": "cwe_q_000246", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C++]\nclass Color\n{\nprivate:\nint[2] colorArray;\nint colorValue;public:\nColor () : colorArray { 1, 2 }, colorValue (3) { };\nint[2] & fa () { return colorArray; } // return reference to private array\nint & fv () { return colorValue; } // return reference to private integer};\n\nint main ()\n{\nColor c;\n\nc.fa () [1] = 42; // modifies private array element\nc.fv () = 42; // modifies private int\n\nreturn 0;}", "query_type": "code"} | |
| {"_id": "cwe_q_000248", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nif (cert = SSL_get_peer_certificate(ssl)) {\n\nfoo=SSL_get_verify_result(ssl);\nif ((X509_V_OK==foo) || (X509_V_ERRCERT_NOT_YET_VALID==foo))\n\n //do stuff\n\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000249", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Perl]\nmy $arg = GetArgument(\"filename\");\n\n\t\t\t\t\tdo_listing($arg);\n\n\t\t\t\t\tsub do_listing {\n\n\t\t\t\t\t\tmy($fname) = @_;\n\n\t\t\t\t\t\tif (! validate_name($fname)) {\n\n\t\t\t\t\t\t\tprint \"Error: name is not well-formed!\\n\";\n\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t# build command\n\n\t\t\t\t\t\tmy $cmd = \"/bin/ls -l $fname\";\n\n\t\t\t\t\t\tsystem($cmd);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tsub validate_name {\n\n\t\t\t\t\t\tmy($name) = @_;\n\n\t\t\t\t\t\tif ($name =~ /^[\\w\\-]+$/) {\n\n\t\t\t\t\t\t\treturn(1);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\treturn(0);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}", "query_type": "code"} | |
| {"_id": "cwe_q_000251", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Python]\ngetting 2 bytes of randomness for the seeding the PRNG\n\n\t\t\t\t seed = os.urandom(2)\n\n\t\t\t\t random.seed(a=seed)\n\n\t\t\t\t key = random.getrandbits(128)", "query_type": "code"} | |
| {"_id": "cwe_q_000252", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nvoid encryptAndSendPassword(char *password){\nchar *nonce = \"bad\";\n...\nchar *data = (unsigned char*)malloc(20);\nint para_size = strlen(nonce) + strlen(password);\nchar *paragraph = (char*)malloc(para_size);\nSHA1((const unsigned char*)paragraph,parsize,(unsigned char*)data);\nsendEncryptedData(data)}", "query_type": "code"} | |
| {"_id": "cwe_q_000254", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic void updateInventory(String productNumber) {\n\nboolean isProductAvailable = false;\nboolean isDelayed = false;\n\nif (productInStore(productNumber)) {\nisProductAvailable = true;\nupdateInStoreDatabase(productNumber);}\nelse if (productInWarehouse(productNumber)) {\nisProductAvailable = true;\nupdateInWarehouseDatabase(productNumber);}\nelse {\nisProductAvailable = true;}\n\nif ( isProductAvailable ) {\nupdateProductDatabase(productNumber);}\nelse if ( isDelayed ) {\n\n /* Warn customer about delay before order processing */\n\n...\n }\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000256", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nUINT errCode = WinExec( \"C:\\\\Program Files\\\\Foo\\\\Bar\", SW_SHOW );", "query_type": "code"} | |
| {"_id": "cwe_q_000257", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic final class WidgetData extends Applet {\npublic float price;\n...\npublic WidgetData(...) {\nthis.price = LookupPrice(\"MyWidgetType\");}}", "query_type": "code"} | |
| {"_id": "cwe_q_000260", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nunsigned int readdata () {\nint amount = 0;\n...\namount = accessmainframe();\n...\nreturn amount;}", "query_type": "code"} | |
| {"_id": "cwe_q_000261", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nclass Echo {\n\npublic native void runEcho();\nstatic {\n\nSystem.loadLibrary(\"echo\");\n }\npublic static void main(String[] args) {\n\nnew Echo().runEcho();\n }\n }\n\n[C]\n#include <jni.h>\n#include \"Echo.h\"//the java class above compiled with javah\n#include <stdio.h>\n\nJNIEXPORT void JNICALL\nJava_Echo_runEcho(JNIEnv *env, jobject obj)\n{\nchar buf[64];\ngets(buf);\nprintf(buf);}", "query_type": "code"} | |
| {"_id": "cwe_q_000262", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\n// time to clean up\n\nwidget.finalize();", "query_type": "code"} | |
| {"_id": "cwe_q_000264", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nvoid fn(int idx) {\n\n\t\t\t\t\tunsigned char v;\n\n\t\t\t\t\tidx_array[0] = 4096;\n\n\t\t\t\t\tv = array[idx_array[idx] * (idx)];\n\n\t\t\t\t }", "query_type": "code"} | |
| {"_id": "cwe_q_000266", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nchar *message;\nvoid sh(int dummy) {\nsyslog(LOG_NOTICE,\"%s\\n\",message);\nsleep(10);\nexit(0);}\nint main(int argc,char* argv[]) {\n...\nsignal(SIGHUP,sh);\nsignal(SIGTERM,sh);\nsleep(10);\nexit(0);}\nIf the execution of the first call to the signal handler is suspended after invoking syslog(), and the signal handler is called a second time, the memory allocated by syslog() enters an undefined, and possibly, exploitable state.", "query_type": "code"} | |
| {"_id": "cwe_q_000267", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n/* Ignore this weakness (hard-coded password) and this weakness (use of password system for authentication) for this example. */\n\nchar *username = \"admin\";\nchar *pass = \"password\";\n\nint AuthenticateUser(char *inUser, char *inPass) {\nif (strncmp(username, inUser, strlen(inUser))) {\nlogEvent(\"Auth failure of username using strlen of inUser\");\nreturn(AUTH_FAIL);}\nif (! strncmp(pass, inPass, strlen(inPass))) {\nlogEvent(\"Auth success of password using strlen of inUser\");\nreturn(AUTH_SUCCESS);}\nelse {\nlogEvent(\"Auth fail of password using sizeof\");\nreturn(AUTH_FAIL);}}\n\nint main (int argc, char **argv) {\n\n int authResult;\n\nif (argc < 3) {\nExitError(\"Usage: Provide a username and password\");}\nauthResult = AuthenticateUser(argv[1], argv[2]);\nif (authResult == AUTH_SUCCESS) {\nDoAuthenticatedTask(argv[1]);}\nelse {\nExitError(\"Authentication failed\");}}", "query_type": "code"} | |
| {"_id": "cwe_q_000268", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nboolean authorizeCard(String ccn) {\n\n // Authorize credit card.\n\n ...\n\nmailCardNumber(ccn, \"evil_developer@evil_domain.com\");\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000269", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C++]\nString command = new String(\"some command to execute\");\nMessageDigest nonce = MessageDigest.getInstance(\"SHA\");\nnonce.update(String.valueOf(\"bad nonce\"));\nbyte[] nonce = nonce.digest();\nMessageDigest password = MessageDigest.getInstance(\"SHA\");\npassword.update(nonce + \"secretPassword\");\nbyte[] digest = password.digest();\nsendCommand(digest, command)", "query_type": "code"} | |
| {"_id": "cwe_q_000271", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString sessionID = generateSessionId();\nCookie c = new Cookie(\"session_id\", sessionID);\nresponse.addCookie(c);", "query_type": "code"} | |
| {"_id": "cwe_q_000272", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\nif (csr_we || csr_read) begin\n\n\t\t\t\t\t\t\t\tif ((riscv::priv_lvl_t'(priv_lvl_o & csr_addr.csr_decode.priv_lvl) != csr_addr.csr_decode.priv_lvl) && !(csr_addr.address==riscv::CSR_MEPC)) begin\n\n\t\t\t\t\t\t\t\t\tcsr_exception_o.cause = riscv::ILLEGAL_INSTR;\n\n\t\t\t\t\t\t\t\t\tcsr_exception_o.valid = 1'b1;\n\n\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t// check access to debug mode only CSRs\n\n\t\t\t\t\t\t\t\tif (csr_addr_i[11:4] == 8'h7b && !debug_mode_q) begin\n\n\t\t\t\t\t\t\t\t\tcsr_exception_o.cause = riscv::ILLEGAL_INSTR;\n\n\t\t\t\t\t\t\t\t\tcsr_exception_o.valid = 1'b1;\n\n\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\tend", "query_type": "code"} | |
| {"_id": "cwe_q_000274", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[JSON]\n{\n\n\t\t \"name\": \"{StorageAccountName}\",\n\n\t\t \"enableHttpsTrafficOnly\": false,\n\n\t\t \"type\": \"Microsoft.Storage/storageAccounts\"\n\n\t\t }", "query_type": "code"} | |
| {"_id": "cwe_q_000276", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n...\nchar source[21] = \"the character string\";\nchar dest[12];\nstrncpy(dest, source, sizeof(source)-1);\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000277", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nshort int bytesRec = 0;\nchar buf[SOMEBIGNUM];\n\nwhile(bytesRec < MAXGET) {\nbytesRec += getFromInput(buf+bytesRec);}", "query_type": "code"} | |
| {"_id": "cwe_q_000278", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[VHDL]\n-- The following VHDL example is written for VHDL-93 or later.\n\n\t\t\tsignal secure : boolean; -- implicitly initialized to ‘false’\n\n\t\t\tsignal policy_ok : boolean;\n\n\t\t\tsignal lock_ready : boolean;\n\n\t\t\t...\n\n\t\t\t-- synthesis translate_off\n\n\t\t\tsecure <= security_check(policy_ok, lock_ready); -- TODO: restore this after debugging\n\n\t\t\t-- synthesis translate_on\n\n\t\t\tprotected_mode_enabled <= secure;\n\n[Verilog]\nreg secure;\n\n\t\t\twire policy_ok;\n\n\t\t\twire lock_ready;\n\n\t\t\twire protected_mode_enabled;\n\n\t\t\t...\n\n\t\t\talways @(*) begin\n\n\t\t\t secure = 1'b0; // default value\n\n\t\t\t // synopsys translate_off\n\n\t\t\t secure = security_check(policy_ok, lock_ready); // TODO: restore this after debugging\n\n\t\t\t // synopsys translate_on\n\n\t\t\tend\n\n\t\t\tassign protected_mode_enabled = secure;", "query_type": "code"} | |
| {"_id": "cwe_q_000279", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString email = request.getParameter(\"email_address\");\nassert email != null;", "query_type": "code"} | |
| {"_id": "cwe_q_000280", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Perl]\nsub DisplayPrivateMessage {\nmy($id) = @_;\nmy $Message = LookupMessageObject($id);\nprint \"From: \" . encodeHTML($Message->{from}) . \"<br>\\n\";\nprint \"Subject: \" . encodeHTML($Message->{subject}) . \"\\n\";\nprint \"<hr>\\n\";\nprint \"Body: \" . encodeHTML($Message->{body}) . \"\\n\";}\n\nmy $q = new CGI;\n\n # For purposes of this example, assume that this weakness and\n\n # this weakness do not apply.\n\nif (! AuthenticateUser($q->param('username'), $q->param('password'))) {\nExitError(\"invalid username or password\");}\n\nmy $id = $q->param('id');\nDisplayPrivateMessage($id);", "query_type": "code"} | |
| {"_id": "cwe_q_000281", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[HTML]\n<form action=\"/url/profile.php\" method=\"post\">\n<input type=\"text\" name=\"firstname\"/>\n<input type=\"text\" name=\"lastname\"/>\n<br/>\n<input type=\"text\" name=\"email\"/>\n<input type=\"submit\" name=\"submit\" value=\"Update\"/>\n</form>\n\n[PHP]\n// initiate the session in order to validate sessions\n\nsession_start();\n\n //if the session is registered to a valid user then allow update\n\nif (! session_is_registered(\"username\")) {\n\necho \"invalid session detected!\";\n\n // Redirect user to login page\n\n[...]\n\nexit;\n }\n\n // The user session is valid, so process the request\n\n // and update the information\n\nupdate_profile();\n\nfunction update_profile {\n\n // read in the data from $POST and send an update\n\n // to the database\n\nSendUpdateToDatabase($_SESSION['username'], $_POST['email']);\n[...]\necho \"Your profile has been successfully updated.\";\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000282", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic Cipher getRSACipher() {\nCipher rsa = null;\ntry {\nrsa = javax.crypto.Cipher.getInstance(\"RSA/NONE/NoPadding\");}\ncatch (java.security.NoSuchAlgorithmException e) {\nlog(\"this should never happen\", e);}\ncatch (javax.crypto.NoSuchPaddingException e) {\nlog(\"this should never happen\", e);}\nreturn rsa;}", "query_type": "code"} | |
| {"_id": "cwe_q_000283", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\n...\n\nalways_ff @(posedge clk_i) begin\n\nif (req_i) begin\n\nif (!we_i) begin\n\nraddr_q <= addr_i[$clog2(RomSize)-1+3:3];\n\t\t\t\t\t\t\t\t\t\tend else begin\n\nmem[addr_i[$clog2(RomSize)-1+3:3]] <= wdata_i;\n\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\tend\n \t...\n\n\t\t\t\t\t\t\t\t// this prevents spurious Xes from propagating into the speculative fetch stage of the core\n\nassign rdata_o = (raddr_q < RomSize) ? mem[raddr_q] : '0;\n\n\t\t\t\t\t\t\t...", "query_type": "code"} | |
| {"_id": "cwe_q_000284", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\nmodule Locked_register_example\n\n (\n\n\t\t input [15:0] Data_in,\n\n\t\t input Clk,\n\n\t\t input resetn,\n\n\t\t input write,\n\n\t\t input Lock,\n\n\t\t input scan_mode,\n\n\t\t input debug_unlocked,\n\n\t\t output reg [15:0] Data_out\n\n\t\t );\n\n reg lock_status;\n\n always @(posedge Clk or negedge resetn)\n\n\t\t\tif (~resetn) // Register is reset resetn\n\n\t\t\tbegin\n\n\t\t\t lock_status <= 1'b0;\n\n\t\t\tend\n\n\t\t\telse if (Lock)\n\n\t\t\tbegin\n\n\t\t\t lock_status <= 1'b1;\n\n\t\t\tend\n\n\t\t\telse if (~Lock)\n\n\t\t\tbegin\n\n\t\t\t lock_status <= lock_status\n\n\t\t\tend\n\n\t\t always @(posedge Clk or negedge resetn)\n\n\t\t\tif (~resetn) // Register is reset resetn\n\n\t\t\tbegin\n\n\t\t\t Data_out <= 16'h0000;\n\n\t\t\tend\n\n\t\t\telse if (write & (~lock_status | scan_mode | debug_unlocked) ) // Register protected by Lock bit input, overrides supported for scan_mode & debug_unlocked\n\n\t\t\tbegin\n\n\t\t\t Data_out <= Data_in;\n\n\t\t\tend\n\n\t\t\telse if (~write)\n\n\t\t\tbegin\n\n\t\t\t Data_out <= Data_out;\n\n\t\t\tend\n\n\t\t endmodule", "query_type": "code"} | |
| {"_id": "cwe_q_000285", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Perl]\n$ENV{\"HOMEDIR\"} = \"/home/mydir/public/\";\nmy $stream = AcceptUntrustedInputStream();\nwhile (<$stream>) {\n\nchomp;\nif (/^ENV ([\\w\\_]+) (.*)/) {\n$ENV{$1} = $2;}\nelsif (/^QUIT/) { ... }\nelsif (/^LIST/) {\nopen($fh, \"/bin/ls -l $ENV{HOMEDIR}|\");\nwhile (<$fh>) {\nSendOutput($stream, \"FILEINFO: $_\");}\nclose($fh);}\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000286", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nwhile(true) {\nDatagramPacket rp = new DatagramPacket(rData,rData.length);\noutSock.receive(rp);\nInetAddress IPAddress = rp.getAddress();\nint port = rp.getPort();\nout = secret.getBytes();\nDatagramPacket sp =new DatagramPacket(out, out.length, IPAddress, port);\noutSock.send(sp);}", "query_type": "code"} | |
| {"_id": "cwe_q_000287", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[HTML]\n<form method=\"POST\" action=\"j_security_check\">\n<input type=\"text\" name=\"j_username\">\n<input type=\"text\" name=\"j_password\"></form>", "query_type": "code"} | |
| {"_id": "cwe_q_000289", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Perl]\nmy $dataPath = \"/users/cwe/profiles\";\nmy $username = param(\"user\");\nmy $profilePath = $dataPath . \"/\" . $username;\n\nopen(my $fh, \"<\", $profilePath) || ExitError(\"profile read error: $profilePath\");\nprint \"<ul>\\n\";\nwhile (<$fh>) {\nprint \"<li>$_</li>\\n\";}\nprint \"</ul>\\n\";", "query_type": "code"} | |
| {"_id": "cwe_q_000291", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C++]\nvoid foo(){\n\nBarObj *ptr = new BarObj()\n\n /* do some work with ptr here */\n\n...\n\nfree(ptr);\n }", "query_type": "code"} | |
| {"_id": "cwe_q_000292", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\n#define DIR \"/restricted/directory\"\n\nchar cmd[500];\nsprintf(cmd, \"ls -l %480s\", DIR);\n\n /* Raise privileges to those needed for accessing DIR. */\n\nRaisePrivileges(...);\nsystem(cmd);\nDropPrivileges(...);\n...", "query_type": "code"} | |
| {"_id": "cwe_q_000293", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\ncontext = new InitialDirContext(env);\nString searchFilter = \"StreetAddress=\" + address;\nNamingEnumeration answer = context.search(searchBase, searchFilter, searchCtls);", "query_type": "code"} | |
| {"_id": "cwe_q_000294", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\npublic class BankManagerLoginServlet extends HttpServlet {\n\nprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\ntry {\n\n // Get username and password from login page request\n\nString username = request.getParameter(\"username\");\nString password = request.getParameter(\"password\");\n\n // Authenticate user\n\nBankManager bankMgr = new BankManager();\nboolean isAuthentic = bankMgr.authenticateUser(username, password);\n\n // If user is authenticated then go to successful login page\n\nif (isAuthentic) {\nrequest.setAttribute(\"login\", new String(\"Login Successful.\"));\ngetServletContext().getRequestDispatcher(\"/BankManagerServiceLoggedIn.jsp\"). forward(request, response);}\nelse {\n\n // Otherwise, raise failed login exception and output unsuccessful login message to error page\n\nthrow new FailedLoginException(\"Failed Login for user \" + username + \" with password \" + password);\n }\n } catch (FailedLoginExce", "query_type": "code"} | |
| {"_id": "cwe_q_000295", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\ntry {\nFile file = new File(\"object.obj\");\nObjectInputStream in = new ObjectInputStream(new FileInputStream(file));\njavax.swing.JButton button = (javax.swing.JButton) in.readObject();\nin.close();}", "query_type": "code"} | |
| {"_id": "cwe_q_000296", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\npwd = getpwnam(getlogin());\nif (isTrustedGroup(pwd->pw_gid)) {\nallow();} else {\ndeny();}", "query_type": "code"} | |
| {"_id": "cwe_q_000298", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[SystemVerilog]\nmodule reglk_wrapper #(\n\n ...\n\n always @(posedge clk_i)\n\n begin\n\n if(~(rst_ni && ~jtag_unlock && ~rst_9))\n\n begin\n\n for (j=0; j < 6; j=j+1) begin\n\n reglk_mem[j] <= 'h0;\n\n end\n\n end\n\n ...", "query_type": "code"} | |
| {"_id": "cwe_q_000299", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[C]\nint main() {\n\n...\n\n char *result = strstr(destBuf, \"Replace Me\");\n\n int idx = result - destBuf;\n\n strcpy(&destBuf[idx], srcBuf);\n\n ...}", "query_type": "code"} | |
| {"_id": "cwe_q_000300", "text": "Which software weakness classification applies to this vulnerable code snippet?\n[Java]\nString[] colors = car.getAllPossibleColors();\ncolors[0] = \"Red\";", "query_type": "code"} | |
| {"_id": "cwe_q_000301", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits weaknesses in privilege management or access control to replace a trusted executable with a malicious version and enable the execution of malware when that trusted executable is called.", "query_type": "nl"} | |
| {"_id": "cwe_q_000302", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary adds duplicate HTTP GET/POST parameters by injecting query string delimiters. Via HPP it may be possible to override existing hardcoded HTTP parameters, modify the application behaviors, access and, potentially exploit, uncontrollable variables, and bypass input validation checkpoints and WAF rules.", "query_type": "nl"} | |
| {"_id": "cwe_q_000303", "text": "Identify the underlying software weakness exploited by this attack behavior: An Adversary can eavesdrop on the content of an external monitor through the air without modifying any cable or installing software, just capturing this signal emitted by the cable or video port, with this the attacker will be able to impact the confidentiality of the data without being detected by traditional security tools\n\nThis attack gives the adversary the ability to view an external monitor with an insignificant delay. There is also no indicator of compromise from the victim visible on the monitor. The eavesdrop is possible due to a signal leakage, that is produced at different points of the connection, including the source port, the connection between the cable and PC, the cable itself, and the connection between the cable and the monitor. That signal leakage can be captured near an", "query_type": "nl"} | |
| {"_id": "cwe_q_000304", "text": "Identify the underlying software weakness exploited by this attack behavior: The adversary modifies state information maintained by the target software or causes a state transition in hardware. If successful, the target will use this tainted state and execute in an unintended manner. State management is an important function within a software application. User state maintained by the application can include usernames, payment information, browsing history as well as application-specific contents such as items in a shopping cart. Manipulating user state can be employed by an adversary to elevate privilege, conduct fraudulent transactions or otherwise modify the flow of the application to derive certain benefits. If there is a hardware logic error in a finite state machine, the adversary can use this to put the system in an undefined state which could cause a denial ", "query_type": "nl"} | |
| {"_id": "cwe_q_000306", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker tricks a victim to execute malicious flash content that executes commands or makes flash calls specified by the attacker. One example of this attack is cross-site flashing, an attacker controlled parameter to a reference call loads from content specified by the attacker.", "query_type": "nl"} | |
| {"_id": "cwe_q_000307", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a weakness in access control to gain access to currently installed hardware and precedes to implement changes or secretly replace a hardware component which undermines the system's integrity for the purpose of carrying out an attack.", "query_type": "nl"} | |
| {"_id": "cwe_q_000308", "text": "Identify the underlying software weakness exploited by this attack behavior: Adversaries may attempt to obtain information about attached peripheral devices and components connected to a computer system. Examples may include discovering the presence of iOS devices by searching for backups, analyzing the Windows registry to determine what USB devices have been connected, or infecting a victim system with malware to report when a USB device has been connected. This may allow the adversary to gain additional insight about the system or network environment, which may be useful in constructing further attacks.", "query_type": "nl"} | |
| {"_id": "cwe_q_000310", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary attacks a target by providing input that causes an application to read beyond the boundary of a defined buffer. This typically occurs when a value influencing where to start or stop reading is set to reflect positions outside of the valid memory location of the buffer. This type of attack may result in exposure of sensitive information, a system crash, or arbitrary code execution.", "query_type": "nl"} | |
| {"_id": "cwe_q_000311", "text": "Identify the underlying software weakness exploited by this attack behavior: This type of attack leverages the use of tags or variables from a formatted configuration data to cause buffer overflow. The adversary crafts a malicious HTML page or configuration file that includes oversized strings, thus causing an overflow.", "query_type": "nl"} | |
| {"_id": "cwe_q_000312", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary serves content whose IP address is resolved by a DNS server that the adversary controls. After initial contact by a web browser (or similar client), the adversary changes the IP address to which its name resolves, to an address within the target organization that is not publicly accessible. This allows the web browser to examine this internal address on behalf of the adversary.\n\nWeb browsers enforce security zones based on DNS names in order to prevent cross-zone disclosure of information. Because the same name resolves to both these IP addresses, browsers will place both IP addresses in the same security zone and allow information to flow between the addresses. This allows adversaries to discover sensitive information about the internal network of an enterprise. If there is a", "query_type": "nl"} | |
| {"_id": "cwe_q_000313", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary positions a symbolic link in such a manner that the targeted user or application accesses the link's endpoint, assuming that it is accessing a file with the link's name.\n\nThe endpoint file may be either output or input. If the file is output, the result is that the endpoint is modified, instead of a file at the intended location. Modifications to the endpoint file may include appending, overwriting, corrupting, changing permissions, or other modifications. In some variants of this attack the adversary may be able to control the change to a file while in other cases they cannot. The former is especially damaging since the adversary may be able to grant themselves increased privileges or insert false information, but the latter can also be damaging as it can expose sensitive inf", "query_type": "nl"} | |
| {"_id": "cwe_q_000314", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack targets libraries or shared code modules which are vulnerable to buffer overflow attacks. An adversary who has knowledge of known vulnerable libraries or shared code can easily target software that makes use of these libraries. All clients that make use of the code library thus become vulnerable by association. This has a very broad effect on security across a system, usually affecting more than one software process.", "query_type": "nl"} | |
| {"_id": "cwe_q_000315", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits missing or incorrectly configured access control within registers to read/write data that is not meant to be obtained or modified by a user.\n\nHardware systems often utilize trusted lock bits to prevent a set of registers from being written to or to restrict a register to only being written to once. Registers are also frequently used to store sensitive data leveraged in additional security operations, such as secure booting, authenticating code, device attestation, and more. However, the access control mechanisms meant to protect these registers may be fully missing or ineffective due to misconfiguration. If an adversary is able to discover improper access controls surrounding registers, it could result in the adversary obtaining sensitive data and/or modifying data th", "query_type": "nl"} | |
| {"_id": "cwe_q_000316", "text": "Identify the underlying software weakness exploited by this attack behavior: A domain name server translates a domain name (such as www.example.com) into an IP address that Internet hosts use to contact Internet resources. An adversary modifies a public DNS cache to cause certain names to resolve to incorrect addresses that the adversary specifies. The result is that client applications that rely upon the targeted cache for domain name resolution will be directed not to the actual address of the specified domain name but to some other address. Adversaries can use this to herd clients to sites that install malware on the victim's computer or to masquerade as part of a Pharming attack.", "query_type": "nl"} | |
| {"_id": "cwe_q_000318", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary places a malicious version of a Dynamic-Link Library (DLL) in the Windows Side-by-Side (WinSxS) directory to trick the operating system into loading this malicious DLL instead of a legitimate DLL. Programs specify the location of the DLLs to load via the use of WinSxS manifests or DLL redirection and if they aren't used then Windows searches in a predefined set of directories to locate the file. If the applications improperly specify a required DLL or WinSxS manifests aren't explicit about the characteristics of the DLL to be loaded, they can be vulnerable to side-loading.", "query_type": "nl"} | |
| {"_id": "cwe_q_000321", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker manipulates or crafts an LDAP query for the purpose of undermining the security of the target. Some applications use user input to create LDAP queries that are processed by an LDAP server. For example, a user might provide their username during authentication and the username might be inserted in an LDAP query during the authentication process. An attacker could use this input to inject additional commands into an LDAP query that could disclose sensitive information. For example, entering a * in the aforementioned query might return information about all users on the system. This attack is very similar to an SQL injection attack in that it manipulates a query to gather additional information or coerce a particular return value.", "query_type": "nl"} | |
| {"_id": "cwe_q_000322", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary includes formatting characters in a string input field on the target application. Most applications assume that users will provide static text and may respond unpredictably to the presence of formatting character. For example, in certain functions of the C programming languages such as printf, the formatting character %s will print the contents of a memory location expecting this location to identify a string and the formatting character %n prints the number of DWORD written in the memory. An adversary can use this to read or write to memory locations or files, or simply to manipulate the value of the resulting text in unexpected ways. Reading or writing memory may result in program crashes and writing memory could result in the execution of arbitrary code if the adversary can", "query_type": "nl"} | |
| {"_id": "cwe_q_000323", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary engages in fingerprinting activities to determine the type or version of an application installed on a remote target.", "query_type": "nl"} | |
| {"_id": "cwe_q_000324", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker utilizes crafted XML user-controllable input to probe, attack, and inject data into the XML database, using techniques similar to SQL injection. The user-controllable input can allow for unauthorized viewing of data, bypassing authentication or the front-end application for direct XML database access, and possibly altering database information.", "query_type": "nl"} | |
| {"_id": "cwe_q_000325", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the adversary finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.\n\nAlthough the focus of this attack is putting excessive content into an environment variable that is loaded into a buffer, environment variables can be used to assist a classic buffer overflow attack as well. In the case where the buffer used in a traditional buffer overflow attack is not large enough to store the adversary's shell code, they will store the shell code in an environment variable and attempt to return to its address, rather than back into the data they wrote to the buffer.", "query_type": "nl"} | |
| {"_id": "cwe_q_000326", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a weakness in authorization in order to modify content within a registry (e.g., Windows Registry, Mac plist, application registry). Editing registry information can permit the adversary to hide configuration information or remove indicators of compromise to cover up activity. Many applications utilize registries to store configuration and service information. As such, modification of registry information can affect individual services (affecting billing, authorization, or even allowing for identity spoofing) or the overall configuration of a targeted application. For example, both Java RMI and SOAP use registries to track available services. Changing registry values is sometimes a preliminary step towards completing another attack pattern, but given the long term usag", "query_type": "nl"} | |
| {"_id": "cwe_q_000327", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary attempts to exploit an application by injecting additional, malicious content during its processing of serialized objects. Developers leverage serialization in order to convert data or state into a static, binary format for saving to disk or transferring over a network. These objects are then deserialized when needed to recover the data/state. By injecting a malformed object into a vulnerable application, an adversary can potentially compromise the application by manipulating the deserialization process. This can result in a number of unwanted outcomes, including remote code execution.", "query_type": "nl"} | |
| {"_id": "cwe_q_000328", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack utilizes the frequent client-server roundtrips in Ajax conversation to scan a system. While Ajax does not open up new vulnerabilities per se, it does optimize them from an attacker point of view. A common first step for an attacker is to footprint the target environment to understand what attacks will work. Since footprinting relies on enumeration, the conversational pattern of rapid, multiple requests and responses that are typical in Ajax applications enable an attacker to look for many vulnerabilities, well-known ports, network locations and so on. The knowledge gained through Ajax fingerprinting can be used to support other attacks, such as XSS.", "query_type": "nl"} | |
| {"_id": "cwe_q_000330", "text": "Identify the underlying software weakness exploited by this attack behavior: The adversary utilizes a repeating of the encoding process for a set of characters (that is, character encoding a character encoding of a character) to obfuscate the payload of a particular request. This may allow the adversary to bypass filters that attempt to detect illegal characters or strings, such as those that might be used in traversal or injection attacks. Filters may be able to catch illegal encoded strings, but may not catch doubly encoded strings. For example, a dot (.), often used in path traversal attacks and therefore often blocked by filters, could be URL encoded as %2E. However, many filters recognize this encoding and would still block the request. In a the component, the % in the above URL encoding would be encoded again as %25, resulting in %252E which some filters migh", "query_type": "nl"} | |
| {"_id": "cwe_q_000331", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary collects information about the target system in an attempt to identify the system's geographical location. Information gathered could include keyboard layout, system language, and timezone. This information may benefit an adversary in confirming the desired target and/or tailoring further attacks.", "query_type": "nl"} | |
| {"_id": "cwe_q_000332", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary obtains decommissioned, recycled, or discarded systems and devices that can include an organization’s intellectual property, employee data, and other types of controlled information. Systems and devices that have reached the end of their lifecycles may be subject to recycle or disposal where they can be exposed to adversarial attempts to retrieve information from internal memory chips and storage devices that are part of the system.", "query_type": "nl"} | |
| {"_id": "cwe_q_000333", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker initiates cross domain HTTP / GET requests and times the server responses. The timing of these responses may leak important information on what is happening on the server. Browser's same origin policy prevents the attacker from directly reading the server responses (in the absence of any other weaknesses), but does not prevent the attacker from timing the responses to requests that the attacker issued cross domain.\n\nFor GET requests an attacker could for instance leverage the \"img\" tag in conjunction with \"onload() / onerror()\" javascript events. For the POST requests, an attacker could leverage the \"iframe\" element and leverage the \"onload()\" event. There is nothing in the current browser security model that prevents an attacker to use these methods to time responses to the at", "query_type": "nl"} | |
| {"_id": "cwe_q_000334", "text": "Identify the underlying software weakness exploited by this attack behavior: the component results from an insufficient mitigation for SQL Injection. Although suppressing database error messages are considered best practice, the suppression alone is not sufficient to prevent SQL Injection. the component is a form of SQL Injection that overcomes the lack of error messages. Without the error messages that facilitate SQL Injection, the adversary constructs input strings that probe the target through simple Boolean SQL expressions. The adversary can determine if the syntax and structure of the injection was successful based on whether the query was executed or not. Applied iteratively, the adversary determines how and where the target is vulnerable to SQL Injection.", "query_type": "nl"} | |
| {"_id": "cwe_q_000335", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker exploits a weakness in input validation on the target by supplying a specially constructed path utilizing dot and slash characters for the purpose of obtaining access to arbitrary files or resources. An attacker modifies a known path on the target in order to reach material that is not available through intended channels. These attacks normally involve adding additional path separators (/ or \\) and/or dots (.), or encodings thereof, in various combinations in order to reach parent directories or entirely separate trees of the target's directory structure.", "query_type": "nl"} | |
| {"_id": "cwe_q_000337", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker may intercept and log encrypted transmissions for the purpose of analyzing metadata such as packet timing and sizes. Although the actual data may be encrypted, this metadata may reveal valuable information to an attacker. Note that this attack is applicable to VOIP data as well as application data, especially for interactive apps that require precise timing and low-latency (e.g. thin-clients).", "query_type": "nl"} | |
| {"_id": "cwe_q_000338", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary identifies a Rest HTTP (Get, Put, Delete) style permission method allowing them to perform various malicious actions upon server data due to lack of access control mechanisms implemented within the application service accepting HTTP messages.\n\nRest uses standard HTTP (Get, Put, Delete) style permissions methods, but these are not necessarily correlated generally with back end programs. Strict interpretation of HTTP get methods means that these HTTP Get services should not be used to delete information on the server, but there is no access control mechanism to back up this logic. This means that unless the services are properly ACL'd and the application's service implementation are following these guidelines then an HTTP request can easily execute a delete or update on the serv", "query_type": "nl"} | |
| {"_id": "cwe_q_000339", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker is able to leverage access gained to the database to read / write data to the file system, compromise the operating system, create a tunnel for accessing the host machine, and use this access to potentially attack other machines on the same network as the database machine. Traditionally SQL injections attacks are viewed as a way to gain unauthorized read access to the data stored in the database, modify the data in the database, delete the data, etc. However, almost every data base management system (DBMS) system includes facilities that if compromised allow an attacker complete access to the file system, operating system, and full access to the host running the database. The attacker can then use this privileged access to launch subsequent attacks. These facilities include dro", "query_type": "nl"} | |
| {"_id": "cwe_q_000341", "text": "Identify the underlying software weakness exploited by this attack behavior: In this attack scenario, the attacker passively listens for WiFi management frame messages containing the Service Set Identifier (SSID) for the WiFi network. These messages are frequently transmitted by WiFi access points (e.g., the retransmission device) as well as by clients that are accessing the network (e.g., the handset/mobile device). Once the attacker is able to associate an SSID with a particular user or set of users (for example, when attending a public event), the attacker can then scan for this SSID to track that user in the future.", "query_type": "nl"} | |
| {"_id": "cwe_q_000343", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker with access to data files and processes on a victim's system injects malicious data into critical operational data during configuration or recalibration, causing the victim's system to perform in a suboptimal manner that benefits the adversary.", "query_type": "nl"} | |
| {"_id": "cwe_q_000344", "text": "Identify the underlying software weakness exploited by this attack behavior: In this attack pattern, the adversary monitors network traffic between nodes of a public or multicast network in an attempt to capture sensitive information at the protocol level. Network sniffing applications can reveal TCP/IP, DNS, Ethernet, and other low-level network communication information. The adversary takes a passive role in this attack pattern and simply observes and analyzes the traffic. The adversary may precipitate or indirectly influence the content of the observed transaction, but is never the intended recipient of the target information.", "query_type": "nl"} | |
| {"_id": "cwe_q_000345", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker takes advantage of the structure of integer variables to cause these variables to assume values that are not expected by an application. For example, adding one to the largest positive integer in a signed integer variable results in a negative number. Negative numbers may be illegal in an application and the application may prevent an attacker from providing them directly, but the application may not consider that adding two positive numbers can create a negative number do to the structure of integer storage formats.", "query_type": "nl"} | |
| {"_id": "cwe_q_000346", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary injects one or more TCP RST packets to a target after the target has made a HTTP GET request. The goal of this attack is to have the target and/or destination web server terminate the TCP connection.", "query_type": "nl"} | |
| {"_id": "cwe_q_000347", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker exploits a weakness in the parsing or display code of the recipient software to generate a data blob containing a supposedly valid signature, but the signer's identity is falsely represented, which can lead to the attacker manipulating the recipient software or its victim user to perform compromising actions.", "query_type": "nl"} | |
| {"_id": "cwe_q_000348", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker can craft special user-controllable input consisting of XPath expressions to inject the XML database and bypass authentication or glean information that they normally would not be able to. the component enables an attacker to talk directly to the XML database, thus bypassing the application completely. the component results from the failure of an application to properly sanitize input used as part of dynamic XPath expressions used to query an XML database.", "query_type": "nl"} | |
| {"_id": "cwe_q_000349", "text": "Identify the underlying software weakness exploited by this attack behavior: Operating system allows logon scripts to be run whenever a specific user or users logon to a system. If adversaries can access these scripts, they may insert additional code into the logon script. This code can allow them to maintain persistence or move laterally within an enclave because it is executed every time the affected user or users logon to a computer. Modifying logon scripts can effectively bypass workstation and enclave firewalls. Depending on the access configuration of the logon scripts, either local credentials or a remote administrative account may be necessary.", "query_type": "nl"} | |
| {"_id": "cwe_q_000350", "text": "Identify the underlying software weakness exploited by this attack behavior: The adversary extracts credentials used for code signing from a production environment and then uses these credentials to sign malicious content with the developer's key. Many developers use signing keys to sign code or hashes of code. When users or applications verify the signatures are accurate they are led to believe that the code came from the owner of the signing key and that the code has not been modified since the signature was applied. If the adversary has extracted the signing credentials then they can use those credentials to sign their own code bundles. Users or tools that verify the signatures attached to the code will likely assume the code came from the legitimate developer and install or run the code, effectively allowing the adversary to execute arbitrary code on the victim", "query_type": "nl"} | |
| {"_id": "cwe_q_000351", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack targets the use of the backslash in alternate encoding. An adversary can provide a backslash as a leading character and causes a parser to believe that the next character is special. This is called an escape. By using that trick, the adversary tries to exploit alternate ways to encode the same character which leads to filter problems and opens avenues to attack.", "query_type": "nl"} | |
| {"_id": "cwe_q_000352", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary inserts a debugger into the program entry point of a mobile application to modify the application binary, with the goal of evading Root/Jailbreak detection. Mobile device users often Root/Jailbreak their devices in order to gain administrative control over the mobile operating system and/or to install third-party mobile applications that are not provided by authorized application stores (e.g. Google Play Store and Apple App Store). Rooting/Jailbreaking a mobile device also provides users with access to system debuggers and disassemblers, which can be leveraged to exploit applications by dumping the application's memory at runtime in order to remove or bypass signature verification methods. This further allows the adversary to evade Root/Jailbreak detection mechanisms, which ca", "query_type": "nl"} | |
| {"_id": "cwe_q_000353", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary spoofs a checksum message for the purpose of making a payload appear to have a valid corresponding checksum. Checksums are used to verify message integrity. They consist of some value based on the value of the message they are protecting. Hash codes are a common checksum mechanism. Both the sender and recipient are able to compute the checksum based on the contents of the message. If the message contents change between the sender and recipient, the sender and recipient will compute different checksum values. Since the sender's checksum value is transmitted with the message, the recipient would know that a modification occurred. In the component an adversary modifies the message body and then modifies the corresponding checksum so that the recipient's checksum calculation will ", "query_type": "nl"} | |
| {"_id": "cwe_q_000354", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack targets a race condition occurring between the time of check (state) for a resource and the time of use of a resource. A typical example is file access. The adversary can leverage a file access race condition by \"running the race\", meaning that they would modify the resource between the first time the target program accesses the file and the time the target program uses the file. During that period of time, the adversary could replace or modify the file, causing the application to behave unexpectedly.", "query_type": "nl"} | |
| {"_id": "cwe_q_000355", "text": "Identify the underlying software weakness exploited by this attack behavior: Compromising Emanations (CE) are defined as unintentional signals which an attacker may intercept and analyze to disclose the information processed by the targeted equipment. Commercial mobile devices and retransmission devices have displays, buttons, microchips, and radios that emit mechanical emissions in the form of sound or vibrations. Capturing these emissions can help an adversary understand what the device is doing.", "query_type": "nl"} | |
| {"_id": "cwe_q_000356", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits weaknesses in input validation on web-mail servers to execute commands on the IMAP/SMTP server. Web-mail servers often sit between the Internet and the IMAP or SMTP mail server. User requests are received by the web-mail servers which then query the back-end mail server for the requested information and return this response to the user. In an the component attack, mail-server commands are embedded in parts of the request sent to the web-mail server. If the web-mail server fails to adequately sanitize these requests, these commands are then sent to the back-end mail server when it is queried by the web-mail server, where the commands are then executed. This attack can be especially dangerous since administrators may assume that the back-end server is protected against ", "query_type": "nl"} | |
| {"_id": "cwe_q_000358", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker exploits characteristics of the infrastructure of a network entity in order to perpetrate attacks or information gathering on network objects or effect a change in the ordinary information flow between network objects. Most often, this involves manipulation of the routing of network messages so, instead of arriving at their proper destination, they are directed towards an entity of the attackers' choosing, usually a server controlled by the attacker. The victim is often unaware that their messages are not being processed correctly. For example, a targeted client may believe they are connecting to their own bank but, in fact, be connecting to a Pharming site controlled by the attacker which then collects the user's login information in order to hijack the actual bank account.", "query_type": "nl"} | |
| {"_id": "cwe_q_000359", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker gains access to application, service, or device with the privileges of an authorized or privileged user by evading or circumventing an authentication mechanism. The attacker is therefore able to access protected data without authentication ever having taken place.\n\nThis refers to an attacker gaining access equivalent to an authenticated user without ever going through an authentication procedure. This is usually the result of the attacker using an unexpected access procedure that does not go through the proper checkpoints where authentication should occur. For example, a web site might assume that all users will click through a given link in order to get to secure material and simply authenticate everyone that clicks the link. However, an attacker might be able to reach secured", "query_type": "nl"} | |
| {"_id": "cwe_q_000360", "text": "Identify the underlying software weakness exploited by this attack behavior: The adversary takes advantage of a bug in an application failing to verify the integrity of the running process to execute arbitrary code in the address space of a separate live process. The adversary could use running code in the context of another process to try to access process's memory, system/network resources, etc. The goal of this attack is to evade detection defenses and escalate privileges by masking the malicious code under an existing legitimate process. Examples of approaches include but not limited to: dynamic-link library (DLL) injection, portable executable injection, thread execution hijacking, ptrace system calls, VDSO hijacking, function hooking, reflective code loading, and more.", "query_type": "nl"} | |
| {"_id": "cwe_q_000364", "text": "Identify the underlying software weakness exploited by this attack behavior: Applications often need to transform data in and out of a data format (e.g., XML and YAML) by using a parser. It may be possible for an adversary to inject data that may have an adverse effect on the parser when it is being processed. Many data format languages allow the definition of macro-like structures that can be used to simplify the creation of complex structures. By nesting these structures, causing the data to be repeatedly substituted, an adversary can cause the parser to consume more resources while processing, causing excessive memory consumption and CPU utilization.\n\nAn adversary's goal is to leverage parser failure to their advantage. In most cases this type of an attack will result in a Denial of Service due to an application becoming unstable, freezing, or crashing. However ", "query_type": "nl"} | |
| {"_id": "cwe_q_000366", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary intercepts an implicit intent sent to launch a Android-based trusted activity and instead launches a counterfeit activity in its place. The malicious activity is then used to mimic the trusted activity's user interface and prompt the target to enter sensitive data as if they were interacting with the trusted activity.", "query_type": "nl"} | |
| {"_id": "cwe_q_000367", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker, armed with the cipher text and the encryption algorithm used, performs an exhaustive (brute force) search on the key space to determine the key that decrypts the cipher text to obtain the plaintext.", "query_type": "nl"} | |
| {"_id": "cwe_q_000368", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker crafts malicious web links and distributes them (via web pages, email, etc.), typically in a targeted manner, hoping to induce users to click on the link and execute the malicious action against some third-party application. If successful, the action embedded in the malicious link will be processed and accepted by the targeted application with the users' privilege level. This type of attack leverages the persistence and implicit trust placed in user session cookies by many web applications today. In such an architecture, once the user authenticates to an application and a session cookie is created on the user's system, all following transactions for that session are authenticated using that cookie including potential actions initiated by an attacker and simply \"riding\" the exis", "query_type": "nl"} | |
| {"_id": "cwe_q_000369", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary manipulates the headers and content of an email message by injecting data via the use of delimiter characters native to the protocol.\n\nMany applications allow users to send email messages by filling in fields. For example, a web site may have a link to \"share this site with a friend\" where the user provides the recipient's email address and the web application fills out all the other fields, such as the subject and body. In this pattern, an adversary adds header and body information to an email message by injecting additional content in an input field used to construct a header of the mail message. This attack takes advantage of the fact that RFC 822 requires that headers in a mail message be separated by a carriage return. As a result, an adversary can inject new headers or c", "query_type": "nl"} | |
| {"_id": "cwe_q_000370", "text": "Identify the underlying software weakness exploited by this attack behavior: In this attack pattern, an adversary injects a the component packet to one or both ends of a target's connection. The attacker is therefore able to have the target and/or the destination server sever the connection without having to directly filter the traffic between them.", "query_type": "nl"} | |
| {"_id": "cwe_q_000371", "text": "Identify the underlying software weakness exploited by this attack behavior: In this attack pattern, the adversary leverages fuzzing to try to identify weaknesses in the system. Fuzzing is a software security and functionality testing method that feeds randomly constructed input to the system and looks for an indication that a failure in response to that input has occurred. Fuzzing treats the system as a black box and is totally free from any preconceptions or assumptions about the system. Fuzzing can help an attacker discover certain assumptions made about user input in the system. Fuzzing gives an attacker a quick way of potentially uncovering some of these assumptions despite not necessarily knowing anything about the internals of the system. These assumptions can then be turned against the system by specially crafting user input that may allow an attacker to ac", "query_type": "nl"} | |
| {"_id": "cwe_q_000372", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary performing this type of attack drops packets destined for a target IP address. The aim is to prevent access to the service hosted at the target IP address.", "query_type": "nl"} | |
| {"_id": "cwe_q_000373", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker initiates a resource depletion attack where a large number of small XML messages are delivered at a sufficiently rapid rate to cause a denial of service or crash of the target. Transactions such as repetitive SOAP transactions can deplete resources faster than a simple flooding attack because of the additional resources used by the SOAP protocol and the resources necessary to process SOAP messages. The transactions used are immaterial as long as they cause resource utilization on the target. In other words, this is a normal flooding attack augmented by using messages that will require extra processing on the target.", "query_type": "nl"} | |
| {"_id": "cwe_q_000374", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker forces the target into a previous state in order to leverage potential weaknesses in the target dependent upon a prior configuration or state-dependent factors. Even in cases where an attacker may not be able to directly control the configuration of the targeted application, they may be able to reset the configuration to a prior state since many applications implement reset functions.\n\nSince these functions are usually intended as emergency features to return an application to a stable configuration if the current configuration degrades functionality, they may not be as strongly secured as other configuration options. The resetting of values is dangerous as it may enable undesired functionality, disable services, or modify access controls. At the very least this is a nuisance a", "query_type": "nl"} | |
| {"_id": "cwe_q_000375", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a weakness in the way an application searches for external libraries to manipulate the execution flow to point to an adversary supplied library or code base. This pattern of attack allows the adversary to compromise the application or server via the execution of unauthorized code. An application typically makes calls to functions that are a part of libraries external to the application. These libraries may be part of the operating system or they may be third party libraries. If an adversary can redirect an application's attempts to access these libraries to other libraries that the adversary supplies, the adversary will be able to force the targeted application to execute arbitrary code. This is especially dangerous if the targeted application has enhanced privileges.", "query_type": "nl"} | |
| {"_id": "cwe_q_000376", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker forces the encryption level to be lowered, thus enabling a successful attack against the encrypted data.", "query_type": "nl"} | |
| {"_id": "cwe_q_000377", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary uses stolen Kerberos tickets to access systems/resources that leverage the Kerberos authentication protocol. The Kerberos authentication protocol centers around a ticketing system which is used to request/grant access to services and to then access the requested services. An adversary can obtain any one of these tickets (e.g. Service Ticket, Ticket Granting Ticket, Silver Ticket, or Golden Ticket) to authenticate to a system/resource without needing the account's credentials. Depending on the ticket obtained, the adversary may be able to access a particular resource or generate TGTs for any account within an Active Directory Domain.", "query_type": "nl"} | |
| {"_id": "cwe_q_000378", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary gains access to an application, service, or device with the privileges of an authorized or privileged user by escaping the confines of a virtualized environment. The adversary is then able to access resources or execute unauthorized code within the host environment, generally with the privileges of the user running the virtualized process. Successfully executing an attack of this type is often the first step in executing more complex attacks.", "query_type": "nl"} | |
| {"_id": "cwe_q_000379", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary is able to disguise one action for another and therefore trick a user into initiating one type of action when they intend to initiate a different action. For example, a user might be led to believe that clicking a button will submit a query, but in fact it downloads software. Adversaries may perform this attack through social means, such as by simply convincing a victim to perform the action or relying on a user's natural inclination to do so, or through technical means, such as a clickjacking attack where a user sees one interface but is actually interacting with a second, invisible, interface.", "query_type": "nl"} | |
| {"_id": "cwe_q_000380", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary manipulates the files in a shared location by adding malicious programs, scripts, or exploit code to valid content. Once a user opens the shared content, the tainted content is executed.", "query_type": "nl"} | |
| {"_id": "cwe_q_000382", "text": "Identify the underlying software weakness exploited by this attack behavior: Web Logs Tampering attacks involve an attacker injecting, deleting or otherwise tampering with the contents of web logs typically for the purposes of masking other malicious behavior. Additionally, writing malicious data to log files may target jobs, filters, reports, and other agents that process the logs in an asynchronous attack pattern. This pattern of attack is similar to \"Log Injection-Tampering-Forging\" except that in this case, the attack is targeting the logs of the web server and not the application.", "query_type": "nl"} | |
| {"_id": "cwe_q_000383", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a weakness in the server's trust of client-side processing by modifying data on the client-side, such as price information, and then submitting this data to the server, which processes the modified data. For example, eShoplifting is a data manipulation attack against an on-line merchant during a purchasing transaction. The manipulation of price, discount or quantity fields in the transaction message allows the adversary to acquire items at a lower cost than the merchant intended. The adversary performs a normal purchasing transaction but edits hidden fields within the HTML form response that store price or other information to give themselves a better deal. The merchant then uses the modified pricing information in calculating the cost of the selected items.", "query_type": "nl"} | |
| {"_id": "cwe_q_000384", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker gets access to the database table where hashes of passwords are stored. They then use a rainbow table of pre-computed hash chains to attempt to look up the original password. Once the original password corresponding to the hash is obtained, the attacker uses the original password to gain access to the system.\n\nA password rainbow table stores hash chains for various passwords. A password chain is computed, starting from the original password, P, via a reduce(compression) function R and a hash function H. A recurrence relation exists where Xi+1 = R(H(Xi)), X0 = P. Then the hash chain of length n for the original password P can be formed: X1, X2, X3, ... , Xn-2, Xn-1, Xn, H(Xn). P and H(Xn) are then stored together in the rainbow table. Constructing the rainbow tables takes a very", "query_type": "nl"} | |
| {"_id": "cwe_q_000385", "text": "Identify the underlying software weakness exploited by this attack behavior: Simple Object Access Protocol (SOAP) is used as a communication protocol between a client and server to invoke web services on the server. It is an XML-based protocol, and therefore suffers from many of the same shortcomings as other XML-based protocols. Adversaries can make use of these shortcomings and manipulate the content of SOAP paramters, leading to undesirable behavior on the server and allowing the adversary to carry out a number of further attacks.", "query_type": "nl"} | |
| {"_id": "cwe_q_000386", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary may execute a flooding attack using XML messages with the intent to deny legitimate users access to a web service. These attacks are accomplished by sending a large number of XML based requests and letting the service attempt to parse each one. In many cases this type of an attack will result in a XML Denial of Service (XDoS) due to an application becoming unstable, freezing, or crashing.\n\nXDoS is most closely associated with web services, SOAP, and Rest, because remote service requesters can post malicious XML payloads to the service provider designed to exhaust the service provider's memory, CPU, and/or disk space. The main weakness in XDoS is that the service provider generally must inspect, parse, and validate the XML messages to determine routing, workflow, security consi", "query_type": "nl"} | |
| {"_id": "cwe_q_000387", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker exploits two layers of weaknesses in server or client software for automated update mechanisms to undermine the integrity of the target code-base. The first weakness involves a failure to properly authenticate a server as a source of update or patch content. This type of weakness typically results from authentication mechanisms which can be defeated, allowing a hostile server to satisfy the criteria that establish a trust relationship. The second weakness is a systemic failure to validate the identity and integrity of code downloaded from a remote location, hence the inability to distinguish malicious code from a legitimate update.\n\nOne predominate type of redirection attack requires DNS spoofing or hijacking of a domain name corresponding to an update server. The target softwa", "query_type": "nl"} | |
| {"_id": "cwe_q_000388", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary searches for and invokes interfaces or functionality that the target system designers did not intend to be publicly available. If interfaces fail to authenticate requests, the attacker may be able to invoke functionality they are not authorized for.\n\nAdversaries can also search for undocumented bits on a hardware device, commonly known as \"chicken bits\". These bits are used to enable/disable certain functionality, but are not published. Adversaries can reverse engineer firmware to identify hidden features and change these bits at runtime to achieve malicious behavior.", "query_type": "nl"} | |
| {"_id": "cwe_q_000389", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a cryptographic weakness in the signature verification algorithm implementation to generate a valid signature without knowing the key.\n\nSignature verification algorithms are generally used to determine whether a certificate or piece of code (e.g. executable, binary, etc.) possesses a valid signature and can be trusted. If the leveraged algorithm confirms that a valid signature exists, it establishes a foundation of trust that is further conveyed to the end-user when interacting with a website or application. However, if the signature verification algorithm improperly validates the signature, either by not validating the signature at all or by failing to fully validate the signature, it could result in an adversary generating a spoofed signature and being classified as", "query_type": "nl"} | |
| {"_id": "cwe_q_000390", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a weakness resulting from using a hashing algorithm with weak collision resistance to generate certificate signing requests (CSR) that contain collision blocks in their \"to be signed\" parts. The adversary submits one CSR to be signed by a trusted certificate authority then uses the signed blob to make a second certificate appear signed by said certificate authority. Due to the hash collision, both certificates, though different, hash to the same value and so the signed blob works just as well in the second certificate. The net effect is that the adversary's second X.509 certificate, which the Certification Authority has never seen, is now signed and validated by that Certification Authority.\n\nAlternatively, the second certificate could be a signing certificate. Thus t", "query_type": "nl"} | |
| {"_id": "cwe_q_000391", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary, through a previously installed malicious application, intercepts messages from a trusted Android-based application in an attempt to achieve a variety of different objectives including denial of service, information disclosure, and data injection. An implicit intent sent from a trusted application can be received by any application that has declared an appropriate intent filter. If the intent is not protected by a permission that the malicious application lacks, then the attacker can gain access to the data contained within the intent. Further, the intent can be either blocked from reaching the intended destination, or modified and potentially forwarded along.", "query_type": "nl"} | |
| {"_id": "cwe_q_000392", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary may execute an attack on a program that uses a poor Regular Expression(Regex) implementation by choosing input that results in an extreme situation for the Regex. A typical extreme situation operates at exponential time compared to the input size. This is due to most implementations using a Nondeterministic Finite Automaton(NFA) state machine to be built by the Regex algorithm since NFA allows backtracking and thus more complex regular expressions.\n\nThe algorithm builds a finite state machine and based on the input transitions through all the states until the end of the input is reached. NFA engines may evaluate each character in the input string multiple times during the backtracking. The algorithm tries each path through the NFA one by one until a match is found; the malicio", "query_type": "nl"} | |
| {"_id": "cwe_q_000393", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary embeds malicious scripts in content that will be served to web browsers. The goal of the attack is for the target software, the client-side browser, to execute the script with the users' privilege level. An attack of this type exploits a programs' vulnerabilities that are brought on by allowing remote hosts to execute code and scripts. Web browsers, for example, have some simple security controls in place, but if a remote attacker is allowed to execute scripts (through injecting them in to user-generated content like bulletin boards) then these controls may be bypassed. Further, these attacks are very difficult for an end user to detect.", "query_type": "nl"} | |
| {"_id": "cwe_q_000394", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack targets the encoding of the URL. An adversary can take advantage of the multiple way of encoding an URL and abuse the interpretation of the URL.\n\nA URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An adversary will try to craft an URL with a sequence of special characters which once interpreted b", "query_type": "nl"} | |
| {"_id": "cwe_q_000395", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker exploits a weakness in input validation by controlling the format, structure, and composition of data to an input-processing interface. By supplying input of a non-standard or unexpected form an attacker can adversely impact the security of the target.\n\nFor example, using a different character encoding might cause dangerous text to be treated as safe text. Alternatively, the attacker may use certain flags, such as file extensions, to make a target application believe that provided data should be handled using a certain interpreter when the data is not actually of the appropriate type. This can lead to bypassing protection mechanisms, forcing the target to use specific components for input processing, or otherwise causing the user's data to be handled differently than might othe", "query_type": "nl"} | |
| {"_id": "cwe_q_000396", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary adds malicious logic, often in the form of a computer virus, to otherwise benign software. This logic is often hidden from the user of the software and works behind the scenes to achieve negative impacts. Many times, the malicious logic is inserted into empty space between legitimate code, and is then called when the software is executed. This pattern of attack focuses on software already fielded and used in operation as opposed to software that is still under development and part of the supply chain.", "query_type": "nl"} | |
| {"_id": "cwe_q_000397", "text": "Identify the underlying software weakness exploited by this attack behavior: Inter-component protocols are used to communicate between different software and hardware modules within a single computer. Common examples are: interrupt signals and data pipes. Subverting the protocol can allow an adversary to impersonate others, discover sensitive information, control the outcome of a session, or perform other attacks. This type of attack targets invalid assumptions that may be inherent in implementers of the protocol, incorrect implementations of the protocol, or vulnerabilities in the protocol itself.", "query_type": "nl"} | |
| {"_id": "cwe_q_000398", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary uses path manipulation methods to exploit insufficient input validation of a target to obtain access to data that should be not be retrievable by ordinary well-formed requests. A typical variety of this attack involves specifying a path to a desired file together with dot-dot-slash characters, resulting in the file access API or function traversing out of the intended directory structure and into the root file system. By replacing or modifying the expected path information the access function or API retrieves the file desired by the attacker. These attacks either involve the attacker providing a complete path to a targeted file or using control characters (e.g. path separators (/ or \\) and/or dots (.)) to reach desired directories or files.", "query_type": "nl"} | |
| {"_id": "cwe_q_000400", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker sends a series of probes to a web application in order to elicit version-dependent and type-dependent behavior that assists in identifying the target. An attacker could learn information such as software versions, error pages, and response headers, variations in implementations of the HTTP protocol, directory structures, and other similar information about the targeted service. This information can then be used by an attacker to formulate a targeted attack plan. While the component is not intended to be damaging (although certain activities, such as network scans, can sometimes cause disruptions to vulnerable applications inadvertently) it may often pave the way for more damaging attacks.", "query_type": "nl"} | |
| {"_id": "cwe_q_000401", "text": "Identify the underlying software weakness exploited by this attack behavior: In this attack, the idea is to cause an active filter to fail by causing an oversized transaction. An attacker may try to feed overly long input strings to the program in an attempt to overwhelm the filter (by causing a buffer overflow) and hoping that the filter does not fail securely (i.e. the user input is let into the system unfiltered).", "query_type": "nl"} | |
| {"_id": "cwe_q_000402", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker manipulates either egress or ingress data from a client within an application framework in order to change the content of messages. Performing this attack can allow the attacker to gain unauthorized privileges within the application, or conduct attacks such as phishing, deceptive strategies to spread malware, or traditional web-application attacks. The techniques require use of specialized software that allow the attacker to perform adversary-in-the-middle (this attack pattern) communications between the web browser and the remote system. Despite the use of AiTH software, the attack is actually directed at the server, as the client is one node in a series of content brokers that pass information along to the application framework. Additionally, it is not true \"Adversary-in-the-", "query_type": "nl"} | |
| {"_id": "cwe_q_000403", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary injects the component into a parser during data processing to produce adverse effects upon the parser such as exhausting system resources and arbitrary code execution.\n\nApplications often need to transform data in and out of serialized data formats, such as XML and YAML, by using a data parser. It may be possible for an adversary to inject data that may have an adverse effect on the parser when it is being processed. By supplying oversized payloads in input vectors that will be processed by the parser, an adversary can cause the parser to consume more resources while processing, causing excessive memory consumption and CPU utilization, and potentially cause execution of arbitrary code. An adversary's goal is to leverage parser failure to their advantage. DoS is most closely as", "query_type": "nl"} | |
| {"_id": "cwe_q_000404", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.", "query_type": "nl"} | |
| {"_id": "cwe_q_000405", "text": "Identify the underlying software weakness exploited by this attack behavior: This type of attack involves an attacker leveraging meta-characters in email headers to inject improper behavior into email programs. Email software has become increasingly sophisticated and feature-rich. In addition, email applications are ubiquitous and connected directly to the Web making them ideal targets to launch and propagate attacks. As the user demand for new functionality in email applications grows, they become more like browsers with complex rendering and plug in routines. As more email functionality is included and abstracted from the user, this creates opportunities for attackers. Virtually all email applications do not list email header information by default, however the email header contains valuable attacker vectors for the attacker to exploit particularly if the behavio", "query_type": "nl"} | |
| {"_id": "cwe_q_000406", "text": "Identify the underlying software weakness exploited by this attack behavior: Some web applications require users to submit information through an ordered sequence of web forms. This is often done if there is a very large amount of information being collected or if information on earlier forms is used to pre-populate fields or determine which additional information the application needs to collect. An attacker who knows the names of the various forms in the sequence may be able to explicitly type in the name of a later form and navigate to it without first going through the previous forms. This can result in incomplete collection of information, incorrect assumptions about the information submitted by the attacker, or other problems that can impair the functioning of the application.", "query_type": "nl"} | |
| {"_id": "cwe_q_000407", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary, through a previously installed malicious application, impersonates an expected or routine task in an attempt to steal sensitive information or leverage a user's privileges.\n\nWhen impersonating an expected task, the adversary monitors the task list maintained by the operating system and waits for a specific legitimate task to become active. Once the task is detected, the malicious application launches a new task in the foreground that mimics the user interface of the legitimate task. At this point, the user thinks that they are interacting with the legitimate task that they started, but instead they are interacting with the malicious application. Once the adversary's goal is reached, the malicious application can exit, leaving the original trusted application visible and the a", "query_type": "nl"} | |
| {"_id": "cwe_q_000408", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack pattern combines malicious Javascript and a legitimate webpage loaded into a concealed iframe. The malicious Javascript is then able to interact with a legitimate webpage in a manner that is unknown to the user. This attack usually leverages some element of social engineering in that an attacker must convinces a user to visit a web page that the attacker controls.", "query_type": "nl"} | |
| {"_id": "cwe_q_000409", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary inserts malicious logic into memory enabling them to achieve a negative impact. This logic is often hidden from the user of the system and works behind the scenes to achieve negative impacts. This pattern of attack focuses on systems already fielded and used in operation as opposed to systems that are still under development and part of the supply chain.", "query_type": "nl"} | |
| {"_id": "cwe_q_000410", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary hijacks a privileged thread of execution by injecting malicious code into a running process. By using a privleged thread to do their bidding, adversaries can evade process-based detection that would stop an attack that creates a new process. This can lead to an adversary gaining access to the process's memory and can also enable elevated privileges. The most common way to perform this attack is by suspending an existing thread and manipulating its memory.", "query_type": "nl"} | |
| {"_id": "cwe_q_000411", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary inserts invalid characters in identifiers to bypass application filtering of input. Filters may not scan beyond invalid characters but during later stages of processing content that follows these invalid characters may still be processed. This allows the adversary to sneak prohibited commands past filters and perform normally prohibited operations. Invalid characters may include null, carriage return, line feed or tab in an identifier. Successful bypassing of the filter can result in a XSS attack, resulting in the disclosure of web cookies or possibly other results.", "query_type": "nl"} | |
| {"_id": "cwe_q_000412", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary gains control of a process that is assigned elevated privileges in order to execute arbitrary code with those privileges. Some processes are assigned elevated privileges on an operating system, usually through association with a particular user, group, or role. If an attacker can hijack this process, they will be able to assume its level of privilege in order to execute their own code.", "query_type": "nl"} | |
| {"_id": "cwe_q_000414", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a weakness in authentication to create an access token (or equivalent) that impersonates a different entity, and then associates a process/thread to that that impersonated token. This action causes a downstream user to make a decision or take action that is based on the assumed identity, and not the response that blocks the adversary.", "query_type": "nl"} | |
| {"_id": "cwe_q_000415", "text": "Identify the underlying software weakness exploited by this attack behavior: In this attack pattern, the adversary intercepts information transmitted between two third parties. The adversary must be able to observe, read, and/or hear the communication traffic, but not necessarily block the communication or change its content. Any transmission medium can theoretically be sniffed if the adversary can examine the contents between the sender and recipient. the component are similar to Adversary-In-The-Middle attacks (this attack pattern), but are entirely passive. AiTM attacks are predominantly active and often alter the content of the communications themselves.", "query_type": "nl"} | |
| {"_id": "cwe_q_000416", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a resource shared between multiple applications, an application pool or hardware pin multiplexing to affect behavior. Resources may be shared between multiple applications or between multiple threads of a single application. Resource sharing is usually accomplished through mutual access to a single memory location or multiplexed hardware pins. If an adversary can manipulate this shared resource (usually by co-opting one of the applications or threads) the other applications or threads using the shared resource will often continue to trust the validity of the compromised shared resource and use it in their calculations. This can result in invalid trust assumptions, corruption of additional data through the normal operations of the other users of the shared resource, or", "query_type": "nl"} | |
| {"_id": "cwe_q_000417", "text": "Identify the underlying software weakness exploited by this attack behavior: The use of cryptanalytic techniques to derive cryptographic keys or otherwise effectively defeat cellular encryption to reveal traffic content. Some cellular encryption algorithms such as A5/1 and A5/2 (specified for GSM use) are known to be vulnerable to such attacks and commercial tools are available to execute these attacks and decrypt mobile phone conversations in real-time. Newer encryption algorithms in use by UMTS and LTE are stronger and currently believed to be less vulnerable to these types of attacks. Note, however, that an attacker with a Cellular Rogue Base Station can force the use of weak cellular encryption even by newer mobile devices.", "query_type": "nl"} | |
| {"_id": "cwe_q_000418", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a sample, demonstration, test, or debug interface that is unintentionally enabled on a production system, with the goal of gleaning information or leveraging functionality that would otherwise be unavailable.\n\nNon-production interfaces are insecure by default and should not be resident on production systems, since they may reveal sensitive information or functionality that should not be known to end-users. However, such interfaces may be unintentionally left enabled on a production system due to configuration errors, supply chain mismanagement, or other pre-deployment activities. Ultimately, failure to properly disable non-production interfaces, in a production environment, may expose a great deal of diagnostic information or functionality to an adversary, which can b", "query_type": "nl"} | |
| {"_id": "cwe_q_000419", "text": "Identify the underlying software weakness exploited by this attack behavior: The adversary bypasses input validation by using doubled characters in order to perform a cross-site scripting attack. Some filters fail to recognize dangerous sequences if they are preceded by repeated characters. For example, by doubling the < before a script command, (<<script or %3C%3script using URI encoding) the filters of some web applications may fail to recognize the presence of a script tag. If the targeted server is vulnerable to this type of bypass, the adversary can create a crafted URL or other trap to cause a victim to view a page on the targeted server where the malicious content is executed, as per a normal XSS attack.", "query_type": "nl"} | |
| {"_id": "cwe_q_000420", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker leverages the security functionality of the system aimed at thwarting potential attacks to launch a denial of service attack against a legitimate system user. Many systems, for instance, implement a password throttling mechanism that locks an account after a certain number of incorrect log in attempts. An attacker can leverage this throttling mechanism to lock a legitimate user out of their own account. The weakness that is being leveraged by an attacker is the very security feature that has been put in place to counteract attacks.", "query_type": "nl"} | |
| {"_id": "cwe_q_000422", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.", "query_type": "nl"} | |
| {"_id": "cwe_q_000423", "text": "Identify the underlying software weakness exploited by this attack behavior: An attack of this type exploits the ability of most browsers to interpret \"data\", \"javascript\" or other URI schemes as client-side executable content placeholders. This attack consists of passing a malicious URI in an anchor tag HREF attribute or any other similar attributes in other HTML tags. Such malicious URI contains, for example, a base64 encoded HTML content with an embedded cross-site scripting payload. The attack is executed when the browser interprets the malicious content i.e., for example, when the victim clicks on the malicious link.", "query_type": "nl"} | |
| {"_id": "cwe_q_000424", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary gathers sensitive information by exploiting the system's screen capture functionality. Through screenshots, the adversary aims to see what happens on the screen over the course of an operation. The adversary can leverage information gathered in order to carry out further attacks.", "query_type": "nl"} | |
| {"_id": "cwe_q_000425", "text": "Identify the underlying software weakness exploited by this attack behavior: An attack of this type exploits a buffer overflow vulnerability in the handling of binary resources. Binary resources may include music files like MP3, image files like JPEG files, and any other binary file. These attacks may pass unnoticed to the client machine through normal usage of files, such as a browser loading a seemingly innocent JPEG file. This can allow the adversary access to the execution stack and execute arbitrary code in the target process.\n\nThis attack pattern is a variant of standard buffer overflow attack using an unexpected vector (binary files) to wrap its attack and open up a new attack vector. The adversary is required to either directly serve the binary content to the victim, or place it in a locale like a MP3 sharing application for the victim to download. The adve", "query_type": "nl"} | |
| {"_id": "cwe_q_000426", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary uses deceptive methods to cause a user or an automated process to download and install dangerous code believed to be a valid update that originates from an adversary controlled source.\n\nAlthough there are several variations to this strategy of attack, the attack methods are united in that all rely on the ability of an adversary to position and disguise malicious content such that it masquerades as a legitimate software update which is then processed by a program, undermining application integrity. As such the attack employs 'spoofing' techniques augmented by psychological or technological mechanisms to disguise the update and/or its source. Virtually all software requires frequent updates or patches, giving the adversary immense latitude when structuring the attack, as well as", "query_type": "nl"} | |
| {"_id": "cwe_q_000427", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker may execute a the component attack against a target server in an attempt to consume resources such as bandwidth and CPU. IP fragmentation occurs when an IP datagram is larger than the MTU of the route the datagram has to traverse. Typically the attacker will use large UDP packets over 1500 bytes of data which forces fragmentation as ethernet MTU is 1500 bytes. This attack is a variation on a typical UDP flood but it enables more network bandwidth to be consumed with fewer packets. Additionally it has the potential to consume server CPU resources and fill memory buffers associated with the processing and reassembling of fragmented packets.", "query_type": "nl"} | |
| {"_id": "cwe_q_000428", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary, through a previously installed malicious application, performs malicious actions against a third-party Software as a Service (SaaS) application (also known as a cloud based application) by leveraging the persistent and implicit trust placed on a trusted user's session. This attack is executed after a trusted user is authenticated into a cloud service, \"piggy-backing\" on the authenticated session, and exploiting the fact that the cloud service believes it is only interacting with the trusted user. If successful, the actions embedded in the malicious application will be processed and accepted by the targeted SaaS application and executed at the trusted user's privilege level.", "query_type": "nl"} | |
| {"_id": "cwe_q_000430", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack targets command-line utilities available in a number of shells. An adversary can leverage a vulnerability found in a command-line utility to escalate privilege to root.", "query_type": "nl"} | |
| {"_id": "cwe_q_000431", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary leverages a firmware weakness within the Thunderbolt protocol, on a computing device to manipulate Thunderbolt controller firmware in order to exploit vulnerabilities in the implementation of authorization and verification schemes within Thunderbolt protection mechanisms. Upon gaining physical access to a target device, the adversary conducts high-level firmware manipulation of the victim Thunderbolt controller SPI (Serial Peripheral Interface) flash, through the use of a SPI Programing device and an external Thunderbolt device, typically as the target device is booting up. If successful, this allows the adversary to modify memory, subvert authentication mechanisms, spoof identities and content, and extract data and memory from the target device. Currently 7 major vulnerabilit", "query_type": "nl"} | |
| {"_id": "cwe_q_000432", "text": "Identify the underlying software weakness exploited by this attack behavior: In a the component attack, an adversary observes an unaware individual's keystrokes, screen content, or conversations with the goal of obtaining sensitive information. One motive for this attack is to obtain sensitive information about the target for financial, personal, political, or other gains. From an insider threat perspective, an additional motive could be to obtain system/application credentials or cryptographic keys. the component attacks are accomplished by observing the content \"over the victim's shoulder\", as implied by the name of this attack.", "query_type": "nl"} | |
| {"_id": "cwe_q_000433", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker obtains an authoritative or reputable signer's private signature key by theft and then uses this key to forge signatures from the original signer to mislead a victim into performing actions that benefit the attacker.", "query_type": "nl"} | |
| {"_id": "cwe_q_000434", "text": "Identify the underlying software weakness exploited by this attack behavior: The attacker induces a client to establish a session with the target software using a session identifier provided by the attacker. Once the user successfully authenticates to the target software, the attacker uses the (now privileged) session identifier in their own transactions. This attack leverages the fact that the target software either relies on client-generated session identifiers or maintains the same session identifiers after privilege elevation.", "query_type": "nl"} | |
| {"_id": "cwe_q_000435", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary utilizes a hash function extension/padding weakness, to modify the parameters passed to the web service requesting authentication by generating their own call in order to generate a legitimate signature hash (as described in the notes), without knowledge of the secret token sometimes provided by the web service.\n\nWhen web services require callees to authenticate, they sometimes issue a token / secret to the caller that the caller is to use to sign their web service calls. In one such scheme the caller, when constructing a request, would concatenate all of the parameters passed to the web service with the provided authentication token and then generate a hash of the concatenated string (e.g., MD5, SHA1, etc.). That hash then forms the signature that is passed to the web service", "query_type": "nl"} | |
| {"_id": "cwe_q_000436", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker undermines the integrity of a product, software, or technology at some stage of the distribution channel. The core threat of modification or the component arise from the many stages of distribution, as a product may traverse multiple suppliers and integrators as the final asset is delivered. Components and services provided from a manufacturer to a supplier may be tampered with during integration or packaging.", "query_type": "nl"} | |
| {"_id": "cwe_q_000437", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary obtains (i.e. steals or purchases) legitimate Kerberos credentials (e.g. Kerberos service account userID/password or Kerberos Tickets) with the goal of achieving authenticated access to additional systems, applications, or services within the domain.\n\nKerberos is the default authentication method for Windows domains and is also used across many operating systems. Attacks leveraging trusted Kerberos credentials can result in numerous consequences, depending on what Kerberos credential is stolen. For example, Kerberos service accounts are typically used to run services or scheduled tasks pertaining to authentication. However, these credentials are often weak and never expire, in addition to possessing local or domain administrator privileges. If an adversary is able to acquire t", "query_type": "nl"} | |
| {"_id": "cwe_q_000438", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker sends random, malformed, or otherwise unexpected messages to a target application and observes the application's log or error messages returned. The attacker does not initially know how a target will respond to individual messages but by attempting a large number of message variants they may find a variant that trigger's desired behavior. In this attack, the purpose of the fuzzing is to observe the application's log and error messages, although fuzzing a target can also sometimes cause the target to enter an unstable state, causing a crash.\n\nBy observing logs and error messages, the attacker can learn details about the configuration of the target application and might be able to cause the target to disclose sensitive information. In applications that return a stack trace along ", "query_type": "nl"} | |
| {"_id": "cwe_q_000440", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack targets the WSDL interface made available by a web service. The attacker may scan the WSDL interface to reveal sensitive information about invocation patterns, underlying technology implementations and associated vulnerabilities. This type of probing is carried out to perform more serious attacks (e.g. parameter tampering, malicious content injection, command injection, etc.). WSDL files provide detailed information about the services ports and bindings available to consumers. For instance, the attacker can submit special characters or malicious content to the Web service and can cause a denial of service condition or illegal access to database records. In addition, the attacker may try to guess other private methods by using the information provided in the WSDL files.", "query_type": "nl"} | |
| {"_id": "cwe_q_000442", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker supplies the target software with input data that contains sequences of special characters designed to bypass input validation logic. This exploit relies on the target making multiples passes over the input data and processing a \"layer\" of special characters with each pass. In this manner, the attacker can disguise input that would otherwise be rejected as invalid by concealing it with layers of special/escape characters that are stripped off by subsequent processing steps. The goal is to first discover cases where the input validation layer executes before one or more parsing layers. That is, user input may go through the following logic in an application: <parser1> --> <input validator> --> <parser2>. In such cases, the attacker will need to provide input that will pass throu", "query_type": "nl"} | |
| {"_id": "cwe_q_000444", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary targets mobile phone users with a phishing attack for the purpose of soliciting account passwords or sensitive information from the user. the component is a variation of the Phishing social engineering technique where the attack is initiated via a text or SMS message, rather than email. The user is enticed to provide information or visit a compromised web site via this message. Apart from the manner in which the attack is initiated, the attack proceeds as a standard Phishing attack.", "query_type": "nl"} | |
| {"_id": "cwe_q_000445", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker, with control of a Cellular Rogue Base Station or through cooperation with a Malicious Mobile Network Operator can force the mobile device (e.g., the retransmission device) to use no encryption (A5/0 mode) or to use easily breakable encryption (A5/1 or A5/2 mode).", "query_type": "nl"} | |
| {"_id": "cwe_q_000447", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack relies on the use of HTTP Cookies to store credentials, state information and other critical data on client systems. There are several different forms of this attack. The first form of this attack involves accessing HTTP Cookies to mine for potentially sensitive data contained therein. The second form involves intercepting this data as it is transmitted from client to server. This intercepted information is then used by the adversary to impersonate the remote user/session. The third form is when the cookie's content is modified by the adversary before it is sent back to the server. Here the adversary seeks to convince the target server to operate on this falsified information.", "query_type": "nl"} | |
| {"_id": "cwe_q_000450", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker performs flooding at the HTTP level to bring down only a particular web application rather than anything listening on a TCP/IP connection. This denial of service attack requires substantially fewer packets to be sent which makes DoS harder to detect. This is an equivalent of SYN flood in HTTP. The idea is to keep the HTTP session alive indefinitely and then repeat that hundreds of times. This attack targets resource depletion weaknesses in web server software. The web server will wait to attacker's responses on the initiated HTTP sessions while the connection threads are being exhausted.", "query_type": "nl"} | |
| {"_id": "cwe_q_000451", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary manipulates an application's interaction with a buffer in an attempt to read or modify data they shouldn't have access to. Buffer attacks are distinguished in that it is the buffer space itself that is the target of the attack rather than any code responsible for interpreting the content of the buffer. In virtually all buffer attacks the content that is placed in the buffer is immaterial. Instead, most buffer attacks involve retrieving or providing more input than can be stored in the allocated buffer, resulting in the reading or overwriting of other unintended program memory.", "query_type": "nl"} | |
| {"_id": "cwe_q_000452", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary directly installs or tricks a user into installing a malicious extension into existing trusted software, with the goal of achieving a variety of negative technical impacts.\n\nMany software applications allow users to install third-party software extensions/plugins that provide additional features and functionality. Adversaries can take advantage of this behavior to install malware on a system with relative ease. This may require the adversary compromising a system and then installing the malicious extension themself. An alternate approach entails masquerading the malicious extension as a legitimate extension. The adversary then convinces users to install the malicious component, via means such as social engineering, or simply waits for victims to unknowingly install the malware", "query_type": "nl"} | |
| {"_id": "cwe_q_000453", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary examines a target application's cache, or a browser cache, for sensitive information. Many applications that communicate with remote entities or which perform intensive calculations utilize caches to improve efficiency. However, if the application computes or receives sensitive information and the cache is not appropriately protected, an attacker can browse the cache and retrieve this information. This can result in the disclosure of sensitive information.", "query_type": "nl"} | |
| {"_id": "cwe_q_000454", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary modifies content to make it contain something other than what the original content producer intended while keeping the apparent source of the content unchanged. The term the component is most often used to describe modification of web pages hosted by a target to display the adversary's content instead of the owner's content. However, any content can be spoofed, including the content of email messages, file transfers, or the content of other network communication protocols. Content can be modified at the source (e.g. modifying the source file for a web page) or in transit (e.g. intercepting and modifying a message between the sender and recipient). Usually, the adversary will attempt to hide the fact that the content has been modified, but in some cases, such as with web site d", "query_type": "nl"} | |
| {"_id": "cwe_q_000456", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary may execute a flooding attack using the HTTP protocol with the intent to deny legitimate users access to a service by consuming resources at the application layer such as web services and their infrastructure. These attacks use legitimate session-based HTTP GET requests designed to consume large amounts of a server's resources. Since these are legitimate sessions this attack is very difficult to detect.", "query_type": "nl"} | |
| {"_id": "cwe_q_000457", "text": "Identify the underlying software weakness exploited by this attack behavior: Some APIs support scripting instructions as arguments. Methods that take scripted instructions (or references to scripted instructions) can be very flexible and powerful. However, if an attacker can specify the script that serves as input to these methods they can gain access to a great deal of functionality. For example, HTML pages support <script> tags that allow scripting languages to be embedded in the page and then interpreted by the receiving web browser. If the content provider is malicious, these scripts can compromise the client application. Some applications may even execute the scripts under their own identity (rather than the identity of the user providing the script) which can allow attackers to perform activities that would otherwise be denied to them.", "query_type": "nl"} | |
| {"_id": "cwe_q_000458", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary intercepts traffic and intentionally drops DNS requests based on content in the request. In this way, the adversary can deny the availability of specific services or content to the user even if the IP address is changed.", "query_type": "nl"} | |
| {"_id": "cwe_q_000459", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker makes use of Cascading Style Sheets (CSS) injection to steal data cross domain from the victim's browser. The attack works by abusing the standards relating to loading of CSS: 1. Send cookies on any load of CSS (including cross-domain) 2. When parsing returned CSS ignore all data that does not make sense before a valid CSS descriptor is found by the CSS parser.\n\nBy having control of some text in the victim's domain, the attacker is able to inject a seemingly valid CSS string. It does not matter if this CSS string is preceded by other data. The CSS parser will still locate the CSS string. If the attacker is able to control two injection points, one before the cross domain data that the attacker is interested in receiving and the other one after, the attacker can use this attack ", "query_type": "nl"} | |
| {"_id": "cwe_q_000462", "text": "Identify the underlying software weakness exploited by this attack behavior: Many languages use code signing facilities to vouch for code's identity and to thus tie code to its assigned privileges within an environment. Subverting this mechanism can be instrumental in an attacker escalating privilege. Any means of subverting the way that a virtual machine enforces code signing classifies for this style of attack.", "query_type": "nl"} | |
| {"_id": "cwe_q_000463", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary manipulates and injects malicious content, in the form of secret unauthorized HTTP responses, into a single HTTP response from a vulnerable or compromised back-end HTTP agent (e.g., web server) or into an already spoofed HTTP response from an adversary controlled domain/site. See CanPrecede relationships for possible consequences.\n\nMalicious user input is injected into various standard and/or user defined HTTP headers within a HTTP Response through use of Carriage Return (CR), Line Feed (LF), Horizontal Tab (HT), Space (SP) characters as well as other valid/RFC compliant special characters, and unique character encoding. A single HTTP response ends up being split as two or more HTTP responses by the targeted client HTTP agent parsing the original maliciously manipulated HTTP r", "query_type": "nl"} | |
| {"_id": "cwe_q_000464", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary guesses or obtains (i.e. steals or purchases) legitimate Windows administrator credentials (e.g. userID/password) to access Windows Admin Shares on a local machine or within a Windows domain.\n\nWindows systems within the Windows NT family contain hidden network shares that are only accessible to system administrators. These shares allow administrators to remotely access all disk volumes on a network-connected system and further allow for files to be copied, written, and executed, along with other administrative actions. Example network shares include: C$, ADMIN$ and IPC$. If an adversary is able to obtain legitimate Windows credentials, the hidden shares can be accessed remotely, via server message block (SMB) or the Net utility, to transfer files and execute code. It is also p", "query_type": "nl"} | |
| {"_id": "cwe_q_000465", "text": "Identify the underlying software weakness exploited by this attack behavior: Adversaries implant malicious code in open source software (OSS) libraries to have it widely distributed, as OSS is commonly downloaded by developers and other users to incorporate into software development projects. The adversary can have a particular system in mind to target, or the implantation can be the first stage of follow-on attacks on many systems.", "query_type": "nl"} | |
| {"_id": "cwe_q_000466", "text": "Identify the underlying software weakness exploited by this attack behavior: The adversary uses disruptive signals or events, or alters the physical environment a device operates in, to cause faulty behavior in electronic devices. This can include electromagnetic pulses, laser pulses, clock glitches, ambient temperature extremes, and more. When performed in a controlled manner on devices performing cryptographic operations, this faulty behavior can be exploited to derive secret key information.", "query_type": "nl"} | |
| {"_id": "cwe_q_000467", "text": "Identify the underlying software weakness exploited by this attack behavior: The attacker injects, manipulates, deletes, or forges malicious log entries into the log file, in an attempt to mislead an audit of the log file or cover tracks of an attack. Due to either insufficient access controls of the log files or the logging mechanism, the attacker is able to perform such actions.", "query_type": "nl"} | |
| {"_id": "cwe_q_000469", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker may take advantage of the application feature to help users recover their forgotten passwords in order to gain access into the system with the same privileges as the original user. Generally password recovery schemes tend to be weak and insecure.\n\nMost of them use only one security question. For instance, mother's maiden name tends to be a fairly popular one. Unfortunately in many cases this information is not very hard to find, especially if the attacker knows the legitimate user. These generic security questions are also re-used across many applications, thus making them even more insecure. An attacker could for instance overhear a coworker talking to a bank representative at the work place and supplying their mother's maiden name for verification purposes. An attacker can th", "query_type": "nl"} | |
| {"_id": "cwe_q_000470", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker obtains unauthorized access to an application, service or device either through knowledge of the inherent weaknesses of an authentication mechanism, or by exploiting a flaw in the authentication scheme's implementation. In such an attack an authentication mechanism is functioning but a carefully controlled sequence of events causes the mechanism to grant access to the attacker.\n\nThis attack may exploit assumptions made by the target's authentication procedures, such as assumptions regarding trust relationships or assumptions regarding the generation of secret values. This attack differs from Authentication Bypass attacks in that the component allows the attacker to be certified as a valid user through illegitimate means, while Authentication Bypass allows the user to access pro", "query_type": "nl"} | |
| {"_id": "cwe_q_000474", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a hardware design flaw in a CPU implementation of transient instruction execution in which a faulting or assisted load instruction transiently forwards adversary-controlled data from microarchitectural buffers. By inducing a page fault or microcode assist during victim execution, an adversary can force legitimate victim execution to operate on the adversary-controlled data which is stored in the microarchitectural buffers. The adversary can then use existing code gadgets and side channel analysis to discover victim secrets that have not yet been flushed from microarchitectural state or hijack the system control flow.\n\nThis attack is a mix of techniques used in traditional Meltdown and Spectre attacks. It uses microarchitectural data leakage combined with code gadget a", "query_type": "nl"} | |
| {"_id": "cwe_q_000475", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker removes or modifies the logic on a client associated with monetary calculations resulting in incorrect information being sent to the server. A server may rely on a client to correctly compute monetary information. For example, a server might supply a price for an item and then rely on the client to correctly compute the total cost of a purchase given the number of items the user is buying. If the attacker can remove or modify the logic that controls these calculations, they can return incorrect values to the server. The attacker can use this to make purchases for a fraction of the legitimate cost or otherwise avoid correct billing for activities.", "query_type": "nl"} | |
| {"_id": "cwe_q_000477", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary inserts commands to perform cross-site scripting (XSS) actions in HTML attributes. Many filters do not adequately sanitize attributes against the presence of potentially dangerous commands even if they adequately sanitize tags. For example, dangerous expressions could be inserted into a style attribute in an anchor tag, resulting in the execution of malicious code when the resulting page is rendered. If a victim is tricked into viewing the rendered page the attack proceeds like a normal XSS attack, possibly resulting in the loss of sensitive cookies or other malicious activities.", "query_type": "nl"} | |
| {"_id": "cwe_q_000478", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker manipulates either egress or ingress data from a client within an application framework in order to change the content of messages. Performing this attack allows the attacker to manipulate content in such a way as to produce messages or content that look authentic but may contain deceptive links, spam-like content, or links to the attackers' code. In general, content-spoofing within an application API can be employed to stage many different types of attacks varied based on the attackers' intent. The techniques require use of specialized software that allow the attacker to use adversary-in-the-middle (this attack pattern) communications between the web browser and the remote system.", "query_type": "nl"} | |
| {"_id": "cwe_q_000479", "text": "Identify the underlying software weakness exploited by this attack behavior: Adversaries know that certain binaries will be regularly executed as part of normal processing. If these binaries are not protected with the appropriate file system permissions, it could be possible to replace them with malware. This malware might be executed at higher system permission levels. A variation of this pattern is to discover self-extracting installation packages that unpack binaries to directories with weak file permissions which it does not clean up appropriately. These binaries can be replaced by malware, which can then be executed.", "query_type": "nl"} | |
| {"_id": "cwe_q_000481", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary with access to file system resources, either directly or via application logic, will use various file absolute paths and navigation mechanisms such as \"..\" to extend their range of access to inappropriate areas of the file system. The goal of the adversary is to access directories and files that are intended to be restricted from their access.", "query_type": "nl"} | |
| {"_id": "cwe_q_000483", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker exploits the functionality of cache technologies to cause specific data to be cached that aids the attackers' objectives. This describes any attack whereby an attacker places incorrect or harmful material in cache. The targeted cache can be an application's cache (e.g. a web browser cache) or a public cache (e.g. a DNS or ARP cache). Until the cache is refreshed, most applications or clients will treat the corrupted cache value as valid. This can lead to a wide range of exploits including redirecting web browsers towards sites that install malware and repeatedly incorrect calculations based on the incorrect value.", "query_type": "nl"} | |
| {"_id": "cwe_q_000484", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary is able to efficiently decrypt data without knowing the decryption key if a target system leaks data on whether or not a padding error happened while decrypting the ciphertext. A target system that leaks this type of information becomes the padding oracle and an adversary is able to make use of that oracle to efficiently decrypt data without knowing the decryption key by issuing on average 128*b calls to the padding oracle (where b is the number of bytes in the ciphertext block). In addition to performing decryption, an adversary is also able to produce valid ciphertexts (i.e., perform encryption) by using the padding oracle, all without knowing the encryption key.\n\nAny cryptosystem can be vulnerable to padding oracle attacks if the encrypted messages are not authenticated to ", "query_type": "nl"} | |
| {"_id": "cwe_q_000486", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits well-known locations for resources for the purposes of undermining the security of the target. In many, if not most systems, files and resources are organized in a default tree structure. This can be useful for adversaries because they often know where to look for resources or files that are necessary for attacks. Even when the precise location of a targeted resource may not be known, naming conventions may indicate a small area of the target machine's file tree where the resources are typically located. For example, configuration files are normally stored in the /etc director on Unix systems. Adversaries can take advantage of this to commit other types of attacks.", "query_type": "nl"} | |
| {"_id": "cwe_q_000487", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker leverages a weakness present in the database access layer code generated with an Object Relational Mapping (ORM) tool or a weakness in the way that a developer used a persistence framework to inject their own SQL commands to be executed against the underlying database. The attack here is similar to plain SQL injection, except that the application does not use JDBC to directly talk to the database, but instead it uses a data access layer generated by an ORM tool or framework (e.g. Hibernate). While most of the time code generated by an ORM tool contains safe access methods that are immune to SQL injection, sometimes either due to some weakness in the generated code or due to the fact that the developer failed to use the generated access methods properly, SQL injection is still p", "query_type": "nl"} | |
| {"_id": "cwe_q_000488", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack pattern involves an adversary manipulating a pointer within a target application resulting in the application accessing an unintended memory location. This can result in the crashing of the application or, for certain pointer values, access to data that would not normally be possible or the execution of arbitrary code. Since pointers are simply integer variables, Integer Attacks may often be used in Pointer Attacks.", "query_type": "nl"} | |
| {"_id": "cwe_q_000489", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary manipulates the use or processing of an interface (e.g. Application Programming Interface (API) or System-on-Chip (SoC)) resulting in an adverse impact upon the security of the system implementing the interface. This can allow the adversary to bypass access control and/or execute functionality not intended by the interface implementation, possibly compromising the system which integrates the interface. the component can take on a number of forms including forcing the unexpected use of an interface or the use of an interface in an unintended way.", "query_type": "nl"} | |
| {"_id": "cwe_q_000490", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker may provide a Unicode string to a system component that is not Unicode aware and use that to circumvent the filter or cause the classifying mechanism to fail to properly understanding the request. That may allow the attacker to slip malicious data past the content filter and/or possibly cause the application to route the request incorrectly.", "query_type": "nl"} | |
| {"_id": "cwe_q_000491", "text": "Identify the underlying software weakness exploited by this attack behavior: This pattern of attack sees an adversary load a malicious resource into a program's standard path so that when a known command is executed then the system instead executes the malicious component. The adversary can either modify the search path a program uses, like a PATH variable or classpath, or they can manipulate resources on the path to point to their malicious components. J2EE applications and other component based applications that are built from multiple binaries can have very long list of dependencies to execute. If one of these libraries and/or references is controllable by the attacker then application controls can be circumvented by the attacker.", "query_type": "nl"} | |
| {"_id": "cwe_q_000492", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker manipulates either egress or ingress data from a client within an application framework in order to change the destination and/or content of links/buttons displayed to a user within API messages. Performing this attack allows the attacker to manipulate content in such a way as to produce messages or content that looks authentic but contains links/buttons that point to an attacker controlled destination. Some applications make navigation remapping more difficult to detect because the actual HREF values of images, profile elements, and links/buttons are masked. One example would be to place an image in a user's photo gallery that when clicked upon redirected the user to an off-site location. Also, traditional web vulnerabilities (such as CSRF) can be constructed with remapped but", "query_type": "nl"} | |
| {"_id": "cwe_q_000494", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary utilizes a resource leak on the target to deplete the quantity of the resource available to service legitimate requests.\n\nResource leaks most often come in the form of memory leaks where memory is allocated but never released after it has served its purpose, however, theoretically, any other resource that can be reserved can be targeted if the target fails to release the reservation when the reserved resource block is no longer needed. In this attack, the adversary determines what activity results in leaked resources and then triggers that activity on the target. Since some leaks may be small, this may require a large number of requests by the adversary. However, this attack differs from a flooding attack in that the rate of requests is generally not significant. This is becau", "query_type": "nl"} | |
| {"_id": "cwe_q_000495", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker creates a very persistent cookie that stays present even after the user thinks it has been removed. The cookie is stored on the victim's machine in over ten places. When the victim clears the cookie cache via traditional means inside the browser, that operation removes the cookie from certain places but not others. The malicious code then replicates the cookie from all of the places where it was not deleted to all of the possible storage locations once again. So the victim again has the cookie in all of the original storage locations. In other words, failure to delete the cookie in even one location will result in the cookie's resurrection everywhere. The evercookie will also persist across different browsers because certain stores (e.g., Local Shared Objects) are shared betwee", "query_type": "nl"} | |
| {"_id": "cwe_q_000496", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary leverages the possibility to encode potentially harmful input or content used by applications such that the applications are ineffective at validating this encoding standard.", "query_type": "nl"} | |
| {"_id": "cwe_q_000497", "text": "Identify the underlying software weakness exploited by this attack behavior: Through the exploitation of how service accounts leverage Kerberos authentication with Service Principal Names (SPNs), the adversary obtains and subsequently cracks the hashed credentials of a service account target to exploit its privileges. The Kerberos authentication protocol centers around a ticketing system which is used to request/grant access to services and to then access the requested services. As an authenticated user, the adversary may request Active Directory and obtain a service ticket with portions encrypted via RC4 with the private key of the authenticated account. By extracting the local ticket and saving it disk, the adversary can brute force the hashed value to reveal the target account credentials.", "query_type": "nl"} | |
| {"_id": "cwe_q_000498", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack is a specific variation on leveraging alternate encodings to bypass validation logic. This attack leverages the possibility to encode potentially harmful input in UTF-8 and submit it to applications not expecting or effective at validating this encoding standard making input filtering difficult. UTF-8 (8-bit UCS/Unicode Transformation Format) is a variable-length character encoding for Unicode. Legal UTF-8 characters are one to four bytes long. However, early version of the UTF-8 specification got some entries wrong (in some cases it permitted overlong characters). UTF-8 encoders are supposed to use the \"shortest possible\" encoding, but naive decoders may accept encodings that are longer than necessary. According to the RFC 3629, a particularly subtle form of this attack can be", "query_type": "nl"} | |
| {"_id": "cwe_q_000499", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary embeds malicious script code in the parameters of an HTTP query string and convinces a victim to submit the HTTP request that contains the query string to a vulnerable web application. The web application then procedes to use the values parameters without properly validation them first and generates the HTML code that will be executed by the victim's browser.", "query_type": "nl"} | |
| {"_id": "cwe_q_000500", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary can exploit a flaw in Bluetooth key negotiation allowing them to decrypt information sent between two devices communicating via Bluetooth. The adversary uses an Adversary in the Middle setup to modify packets sent between the two devices during the authentication process, specifically the entropy bits. Knowledge of the number of entropy bits will allow the attacker to easily decrypt information passing over the line of communication.", "query_type": "nl"} | |
| {"_id": "cwe_q_000502", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker modifies the parameters of the SOAP message that is sent from the service consumer to the service provider to initiate a SQL injection attack. On the service provider side, the SOAP message is parsed and parameters are not properly validated before being used to access a database in a way that does not use parameter binding, thus enabling the attacker to control the structure of the executed SQL query. This pattern describes a SQL injection attack with the delivery mechanism being a SOAP message.", "query_type": "nl"} | |
| {"_id": "cwe_q_000503", "text": "Identify the underlying software weakness exploited by this attack behavior: Phishing is a social engineering technique where an attacker masquerades as a legitimate entity with which the victim might do business in order to prompt the user to reveal some confidential information (very frequently authentication credentials) that can later be used by an attacker. Phishing is essentially a form of information gathering or \"fishing\" for information.", "query_type": "nl"} | |
| {"_id": "cwe_q_000504", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a weakness in input validation on the target to inject new code into that which is currently executing. This differs from code inclusion in that code inclusion 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_000505", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker changes the behavior or state of a targeted application through injecting data or command syntax through the targets use of non-validated and non-filtered arguments of exposed services or methods.", "query_type": "nl"} | |
| {"_id": "cwe_q_000506", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary can abuse an authentication protocol susceptible to reflection attack in order to defeat it. Doing so allows the adversary illegitimate access to the target system, without possessing the requisite credentials. Reflection attacks are of great concern to authentication protocols that rely on a challenge-handshake or similar mechanism. An adversary can impersonate a legitimate user and can gain illegitimate access to the system by successfully mounting a reflection attack during authentication.", "query_type": "nl"} | |
| {"_id": "cwe_q_000508", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary who is authorized or has the ability to search known system resources, does so with the intention of gathering useful information. System resources include files, memory, and other aspects of the target system. In this pattern of attack, the adversary does not necessarily know what they are going to find when they start pulling data. This is different than this attack pattern where the adversary knows what they are looking for due to the common location.", "query_type": "nl"} | |
| {"_id": "cwe_q_000509", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary actively probes the target in a manner that is designed to solicit information that could be leveraged for malicious purposes.\n\nThis is achieved by exploring the target via ordinary interactions for the purpose of gathering intelligence about the target, or by sending data that is syntactically invalid or non-standard in an attempt to produce a response that contains the desired data. As a result of these interactions, the adversary is able to obtain information from the target that aids the attacker in making inferences about its security, configuration, or potential vulnerabilities. Examplar exchanges with the target may trigger unhandled exceptions or verbose error messages that reveal information like stack traces, configuration information, path information, or database d", "query_type": "nl"} | |
| {"_id": "cwe_q_000510", "text": "Identify the underlying software weakness exploited by this attack behavior: This pattern of attack is defined by the selection of messages distributed via multicast or public information channels that are intended for another client by determining the parameter value assigned to that client. This attack allows the adversary to gain access to potentially privileged information, and to possibly perpetrate other attacks through the distribution means by impersonation. If the channel/message being manipulated is an input rather than output mechanism for the system, (such as a command bus), this style of attack could be used to change the adversary's identifier to more a privileged one.", "query_type": "nl"} | |
| {"_id": "cwe_q_000511", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary crafts a request to a target that results in the target listing/indexing the content of a directory as output. One common method of triggering directory contents as output is to construct a request containing a path that terminates in a directory name rather than a file name since many applications are configured to provide a list of the directory's contents when such a request is received. An adversary can use this to explore the directory tree on a target as well as learn the names of files. This can often end up revealing test files, backup files, temporary files, hidden files, configuration files, user accounts, script contents, as well as naming conventions, all of which can be used by an attacker to mount additional attacks.", "query_type": "nl"} | |
| {"_id": "cwe_q_000513", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker manipulates either egress or ingress data from a client within an application framework in order to change the destination and/or content of buttons displayed to a user within API messages. Performing this attack allows the attacker to manipulate content in such a way as to produce messages or content that looks authentic but contains buttons that point to an attacker controlled destination.", "query_type": "nl"} | |
| {"_id": "cwe_q_000514", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary monitors data streams to or from the target for information gathering purposes. This attack may be undertaken to solely gather sensitive information or to support a further attack against the target. This attack pattern can involve sniffing network traffic as well as other types of data streams (e.g. radio). The adversary can attempt to initiate the establishment of a data stream or passively observe the communications as they unfold. In all variants of this attack, the adversary is not the intended recipient of the data stream. In contrast to other means of gathering information (e.g., targeting data leaks), the adversary must actively position themself so as to observe explicit data channels (e.g. network traffic) and read the content. However, this attack differs from a Adv", "query_type": "nl"} | |
| {"_id": "cwe_q_000515", "text": "Identify the underlying software weakness exploited by this attack behavior: An attack of this type exploits a system's configuration that allows an adversary to either directly access an executable file, for example through shell access; or in a possible worst case allows an adversary to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.", "query_type": "nl"} | |
| {"_id": "cwe_q_000516", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary manipulates a web service related protocol to cause a web application or service to react differently than intended. This can either be performed through the manipulation of call parameters to include unexpected values, or by changing the called function to one that should normally be restricted or limited. By leveraging this pattern of attack, the adversary is able to gain access to data or resources normally restricted, or to cause the application or service to crash.", "query_type": "nl"} | |
| {"_id": "cwe_q_000517", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker manipulates an existing credential in order to gain access to a target application. Session credentials allow users to identify themselves to a service after an initial authentication without needing to resend the authentication information (usually a username and password) with every message. An attacker may be able to manipulate a credential sniffed from an existing connection in order to gain access to a target server.\n\nFor example, a credential in the form of a web cookie might have a field that indicates the access rights of a user. By manually tweaking this cookie, a user might be able to increase their access rights to the server. Alternately an attacker may be able to manipulate an existing credential to appear as a different user. This attack differs from falsification", "query_type": "nl"} | |
| {"_id": "cwe_q_000518", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker manipulates files or settings external to a target application which affect the behavior of that application. For example, many applications use external configuration files and libraries - modification of these entities or otherwise affecting the application's ability to use them would constitute a the component attack.", "query_type": "nl"} | |
| {"_id": "cwe_q_000519", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary guesses or obtains (i.e. steals or purchases) legitimate credentials (e.g. userID/password) to achieve authentication and to perform authorized actions under the guise of an authenticated user or service.\n\nAttacks leveraging trusted credentials typically result in the adversary laterally moving within the local network, since users are often allowed to login to systems/applications within the network using the same password. This further allows the adversary to obtain sensitive data, download/install malware on the system, pose as a legitimate user for social engineering purposes, and more. Attacks on known passwords generally rely on the primary fact that users often reuse the same username/password combination for a variety of systems, applications, and services, coupled wit", "query_type": "nl"} | |
| {"_id": "cwe_q_000520", "text": "Identify the underlying software weakness exploited by this attack behavior: The attacker forces an application to load arbitrary code files from a remote location. The attacker could use this to try to load old versions of library files that have known vulnerabilities, to load malicious files that the attacker placed on the remote machine, or to otherwise change the functionality of the targeted application in unexpected ways.", "query_type": "nl"} | |
| {"_id": "cwe_q_000521", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary guesses or obtains (i.e. steals or purchases) legitimate operating system credentials (e.g. userID/password) to achieve authentication and to perform authorized actions on the system, under the guise of an authenticated user or service. This applies to any Operating System.\n\nThis attack can be extremely harmful when the operating system credentials used are for a root or admin user. Once an adversary gains access using credentials with elevated privileges, they are free to alter important system files which can effect other users who may use the system or other users on the system's network.", "query_type": "nl"} | |
| {"_id": "cwe_q_000523", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits weaknesses in input validation by manipulating resource identifiers enabling the unintended modification or specification of a resource.", "query_type": "nl"} | |
| {"_id": "cwe_q_000524", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary, through a previously installed malicious application, injects code into the context of a web page displayed by a WebView component. Through the injected code, an adversary is able to manipulate the DOM tree and cookies of the page, expose sensitive information, and can launch attacks against the web application from within the web page.", "query_type": "nl"} | |
| {"_id": "cwe_q_000525", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary takes advantage of missing or incorrectly configured access control within memory to read/write data or inject malicious code into said memory.\n\nHardware product designs often need to implement memory protection features to prevent users from reading and modifying memory reserved for security operations such as secure booting, authenticating code, device attestation, and more. However, these protection features may be missing if not configured by developers. For example, this can occur if the developers assume these features are configured elsewhere. Additionally, developers often attempt to impose proper protection features, but may incorrectly configure these controls. One such example would be setting controls with insufficient granularity for protected address regions. If ", "query_type": "nl"} | |
| {"_id": "cwe_q_000526", "text": "Identify the underlying software weakness exploited by this attack behavior: An attack of this type exploits a programs' vulnerabilities that allows an attacker's commands to be concatenated onto a legitimate command with the intent of targeting other resources such as the file system or database. The system that uses a filter or denylist input validation, as opposed to allowlist validation is vulnerable to an attacker who predicts delimiters (or combinations of delimiters) not present in the filter or denylist. As with other injection attacks, the attacker uses the command delimiter payload as an entry point to tunnel through the application and activate additional attacks through SQL queries, shell commands, network scanning, and so on.", "query_type": "nl"} | |
| {"_id": "cwe_q_000527", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary obtains unauthorized information due to improperly protected files. If an application stores sensitive information in a file that is not protected by proper access control, then an adversary can access the file and search for sensitive information.", "query_type": "nl"} | |
| {"_id": "cwe_q_000528", "text": "Identify the underlying software weakness exploited by this attack behavior: A pharming attack occurs when the victim is fooled into entering sensitive data into supposedly trusted locations, such as an online bank site or a trading platform. An attacker can impersonate these supposedly trusted sites and have the victim be directed to their site rather than the originally intended one. Pharming does not require script injection or clicking on malicious links for the attack to succeed.", "query_type": "nl"} | |
| {"_id": "cwe_q_000530", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary submits data to a target application which contains nested the component to produce excessively large output. Many data format languages allow the definition of macro-like structures that can be used to simplify the creation of complex structures. However, this capability can be abused to create excessive demands on a processor's CPU and memory. A small number of nested expansions can result in an exponential growth in demands on memory.", "query_type": "nl"} | |
| {"_id": "cwe_q_000531", "text": "Identify the underlying software weakness exploited by this attack behavior: Adversaries can provide contradictory destinations when sending messages. Traffic is routed in networks using the domain names in various headers available at different levels of the OSI model. In a Content Delivery Network (CDN) multiple domains might be available, and if there are contradictory domain names provided it is possible to route traffic to an inappropriate destination. The technique, called Domain Fronting, involves using different domain names in the SNI field of the TLS header and the Host field of the HTTP header. An alternative technique, called Domainless Fronting, is similar, but the SNI field is left blank.", "query_type": "nl"} | |
| {"_id": "cwe_q_000532", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary creates a serialized data file (e.g. XML, YAML, etc...) that contains an external data reference. Because serialized data parsers may not validate documents with external references, there may be no checks on the nature of the reference in the external data. This can allow an adversary to open arbitrary files or connections, which may further lead to the adversary gaining access to information on the system that they would normally be unable to obtain.", "query_type": "nl"} | |
| {"_id": "cwe_q_000533", "text": "Identify the underlying software weakness exploited by this attack behavior: An attack of this type exploits vulnerabilities in client/server communication channel authentication and data integrity. It leverages the implicit trust a server places in the client, or more importantly, that which the server believes is the client. An attacker executes this type of attack by communicating directly with the server where the server believes it is communicating only with a valid client. There are numerous variations of this type of attack.", "query_type": "nl"} | |
| {"_id": "cwe_q_000534", "text": "Identify the underlying software weakness exploited by this attack behavior: In this attack scenario, the attacker passively listens for WiFi messages and logs the associated Media Access Control (MAC) addresses. These addresses are intended to be unique to each wireless device (although they can be configured and changed by software). Once the attacker is able to associate a MAC address with a particular user or set of users (for example, when attending a public event), the attacker can then scan for that MAC address to track that user in the future.", "query_type": "nl"} | |
| {"_id": "cwe_q_000535", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary tampers with a DLL and embeds a computer virus into gaps between legitimate machine instructions. These gaps may be the result of compiler optimizations that pad memory blocks for performance gains. The embedded virus then attempts to infect any machine which interfaces with the product, and possibly steal private data or eavesdrop.", "query_type": "nl"} | |
| {"_id": "cwe_q_000536", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits a hardware design flaw in a CPU implementation of transient instruction execution to expose sensitive data and bypass/subvert access control over restricted resources. Typically, the adversary conducts a covert channel attack to target non-discarded microarchitectural changes caused by transient executions such as speculative execution, branch prediction, instruction pipelining, and/or out-of-order execution. The transient execution results in a series of instructions (gadgets) which construct covert channel and access/transfer the secret data.", "query_type": "nl"} | |
| {"_id": "cwe_q_000537", "text": "Identify the underlying software weakness exploited by this attack behavior: In applications, particularly web applications, access to functionality is mitigated by an authorization framework. This framework maps Access Control Lists (ACLs) to elements of the application's functionality; particularly URL's for web apps. In the case that the administrator failed to specify an ACL for a particular element, an attacker may be able to access it with impunity. An attacker with the ability to access functionality not properly constrained by ACLs can obtain sensitive information and possibly compromise the entire application. Such an attacker can access resources that must be available only to users at a higher privilege level, can access management sections of the application, or can run queries for data that they otherwise not supposed to.", "query_type": "nl"} | |
| {"_id": "cwe_q_000538", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary registers a domain name containing a homoglyph, leading the registered domain to appear the same as a trusted domain. A homograph attack leverages the fact that different characters among various character sets look the same to the user. Homograph attacks must generally be combined with other attacks, such as phishing attacks, in order to direct Internet traffic to the adversary-controlled destinations.", "query_type": "nl"} | |
| {"_id": "cwe_q_000539", "text": "Identify the underlying software weakness exploited by this attack behavior: This type of attack is a form of Cross-Site Scripting (XSS) where a malicious script is \"reflected\" off a vulnerable web application and then executed by a victim's browser. The process starts with an adversary delivering a malicious script to a victim and convincing the victim to send the script to the vulnerable web application.\n\nThe most common method of this is through a phishing email where the adversary embeds the malicious script with a URL that the victim then clicks on. In processing the subsequent request, the vulnerable web application incorrectly considers the malicious script as valid input and uses it to creates a reposnse that is then sent back to the victim. To launch a successful the component attack, an adversary looks for places where user-input is used directly in the g", "query_type": "nl"} | |
| {"_id": "cwe_q_000540", "text": "Identify the underlying software weakness exploited by this attack behavior: the component is a process of finding weaknesses in cryptographic algorithms and using these weaknesses to decipher the ciphertext without knowing the secret key (instance deduction). Sometimes the weakness is not in the cryptographic algorithm itself, but rather in how it is applied that makes the component successful. An attacker may have other goals as well, such as: Total Break (finding the secret key), Global Deduction (finding a functionally equivalent algorithm for encryption and decryption that does not require knowledge of the secret key), Information Deduction (gaining some information about plaintexts or ciphertexts that was not previously known) and Distinguishing Algorithm (the attacker has the ability to distinguish the output of the encryption (ciphertext) from a random perm", "query_type": "nl"} | |
| {"_id": "cwe_q_000543", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack exploits terminal devices that allow themselves to be written to by other users. The attacker sends command strings to the target terminal device hoping that the target user will hit enter and thereby execute the malicious command with their privileges. The attacker can send the results (such as copying /etc/passwd) to a known directory and collect once the attack has succeeded.", "query_type": "nl"} | |
| {"_id": "cwe_q_000544", "text": "Identify the underlying software weakness exploited by this attack behavior: An application typically makes calls to functions that are a part of libraries external to the application. These libraries may be part of the operating system or they may be third party libraries. It is possible that the application does not handle situations properly where access to these libraries has been blocked. Depending on the error handling within the application, blocked access to libraries may leave the system in an insecure state that could be leveraged by an attacker.", "query_type": "nl"} | |
| {"_id": "cwe_q_000545", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack targets the encoding of the URL combined with the encoding of the slash characters. An attacker can take advantage of the multiple ways of encoding a URL and abuse the interpretation of the URL. A URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An attacker will try to craft an URL with a sequenc", "query_type": "nl"} | |
| {"_id": "cwe_q_000546", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary manipulates and injects malicious content in the form of secret unauthorized HTTP responses, into a single HTTP response from a vulnerable or compromised back-end HTTP agent (e.g., server). See CanPrecede relationships for possible consequences.\n\nIn the maliciously manipulated HTTP response, an adversary can add duplicate header fields that HTTP agents interpret as belonging to separate responses. The combined HTTP response ends up being parsed or interpreted as two or more HTTP responses by the targeted client HTTP agent. This allows malicious HTTP responses to bypass security controls. This is performed by the abuse of interpretation and parsing discrepancies in different intermediary HTTP agents (e.g., load balancer, reverse proxy, web caching proxies, application firewalls", "query_type": "nl"} | |
| {"_id": "cwe_q_000548", "text": "Identify the underlying software weakness exploited by this attack behavior: By exploiting insufficient permissions, it is possible to the component in such a way that it can be executed remotely. This shell can have various capabilities, thereby acting as a \"gateway\" to the underlying web server. The shell might execute at the higher permission level of the web server, providing the ability the execute malicious code at elevated levels.", "query_type": "nl"} | |
| {"_id": "cwe_q_000549", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary disguises the MAC address of their Bluetooth enabled device to one for which there exists an active and trusted connection and authenticates successfully. The adversary can then perform malicious actions on the target Bluetooth device depending on the target’s capabilities.", "query_type": "nl"} | |
| {"_id": "cwe_q_000550", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker subverts an intermediate system used to process XML content and forces the intermediate to modify and/or re-route the processing of the content. the component are Adversary in the Middle type attacks (this attack pattern). The attacker compromises or inserts an intermediate system in the processing of the XML message. For example, WS-Routing can be used to specify a series of nodes or intermediaries through which content is passed. If any of the intermediate nodes in this route are compromised by an attacker they could be used for a routing detour attack. From the compromised system the attacker is able to route the XML process to other nodes of their choice and modify the responses so that the normal chain of processing is unaware of the interception. This system can forward t", "query_type": "nl"} | |
| {"_id": "cwe_q_000551", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary leverages a legitimate capability of an application in such a way as to achieve a negative technical impact. The system functionality is not altered or modified but used in a way that was not intended. This is often accomplished through the overuse of a specific functionality or by leveraging functionality with design flaws that enables the adversary to gain access to unauthorized, sensitive data.", "query_type": "nl"} | |
| {"_id": "cwe_q_000552", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack utilizes XQuery to probe and attack server systems; in a similar manner that SQL Injection allows an attacker to exploit SQL calls to RDBMS, the component uses improperly validated data that is passed to XQuery commands to traverse and execute commands that the XQuery routines have access to. the component can be used to enumerate elements on the victim's environment, inject commands to the local host, or execute queries to remote files and data sources.", "query_type": "nl"} | |
| {"_id": "cwe_q_000555", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary injects traffic into the target's network connection. The adversary is therefore able to degrade or disrupt the connection, and potentially modify the content. This is not a flooding attack, as the adversary is not focusing on exhausting resources. Instead, the adversary is crafting a specific input to affect the system in a particular way.", "query_type": "nl"} | |
| {"_id": "cwe_q_000556", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker obtains an authoritative or reputable signer's private signature key by exploiting a cryptographic weakness in the signature algorithm or pseudorandom number generation and then uses this key to forge signatures from the original signer to mislead a victim into performing actions that benefit the attacker.", "query_type": "nl"} | |
| {"_id": "cwe_q_000557", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker tries each of the words in a dictionary as passwords to gain access to the system via some user's account. If the password chosen by the user was a word within the dictionary, this attack will be successful (in the absence of other mitigations). This is a specific instance of the password brute forcing attack pattern. Dictionary Attacks differ from similar attacks such as Password Spraying (this attack pattern) and Credential Stuffing (this attack pattern), since they leverage unknown username/password combinations and don't care about inducing account lockouts.", "query_type": "nl"} | |
| {"_id": "cwe_q_000558", "text": "Identify the underlying software weakness exploited by this attack behavior: The adversary triggers and exploits a deadlock condition in the target software to cause a denial of service. A deadlock can occur when two or more competing actions are waiting for each other to finish, and thus neither ever does. Deadlock conditions can be difficult to detect.", "query_type": "nl"} | |
| {"_id": "cwe_q_000559", "text": "Identify the underlying software weakness exploited by this attack behavior: In this attack, the target software is given input that the adversary knows will be modified and expanded in size during processing. This attack relies on the target software failing to anticipate that the expanded data may exceed some internal limit, thereby creating a buffer overflow.", "query_type": "nl"} | |
| {"_id": "cwe_q_000562", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary obtains (i.e. steals or purchases) legitimate Windows domain credential hash values to access systems within the domain that leverage the Lan Man (LM) and/or NT Lan Man (NTLM) authentication protocols.\n\nWhen authenticating via LM or NTLM, an authenticating account's plaintext credentials are not required by the protocols for successful authentication. Instead, the hashed credentials are used to determine if an authentication attempt is valid. If an adversary can obtain an account's hashed credentials, the hash values can then be passed to a system or service to authenticate, without needing to brute-force the hashes to obtain their cleartext values. Successful Pass The Hash attacks result in the adversary fully authenticating as the targeted account, which can further allow th", "query_type": "nl"} | |
| {"_id": "cwe_q_000563", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary guesses, obtains, or \"rides\" a trusted identifier (e.g. session ID, resource ID, cookie, etc.) to perform authorized actions under the guise of an authenticated user or service.\n\nAttacks leveraging trusted identifiers typically result in the adversary laterally moving within the local network, since users are often allowed to authenticate to systems/applications within the network using the same identifier. This allows the adversary to obtain sensitive data, download/install malware on the system, pose as a legitimate user for social engineering purposes, and more. Attacks on trusted identifiers take advantage of the fact that some software accepts user input without verifying its authenticity. Many server side processes are vulnerable to these attacks because the server to se", "query_type": "nl"} | |
| {"_id": "cwe_q_000564", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker exploits file location algorithms in an operating system or application by creating a file with the same name as a protected or privileged file. The attacker could manipulate the system if the attacker-created file is trusted by the operating system or an application component that attempts to load the original file. Applications often load or include external files, such as libraries or configuration files. These files should be protected against malicious manipulation. However, if the application only uses the name of the file when locating it, an attacker may be able to create a file with the same name and place it in a directory that the application will search before the directory with the legitimate file is searched. Because the attackers' file is discovered first, it wou", "query_type": "nl"} | |
| {"_id": "cwe_q_000565", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary creates a file with scripting content but where the specified MIME type of the file is such that scripting is not expected. The adversary tricks the victim into accessing a URL that responds with the script file. Some browsers will detect that the specified MIME type of the file does not match the actual type of its content and will automatically switch to using an interpreter for the real content type. If the browser does not invoke script filters before doing this, the adversary's script may run on the target unsanitized, possibly revealing the victim's cookies or executing arbitrary script in their browser.", "query_type": "nl"} | |
| {"_id": "cwe_q_000568", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary passively sniffs network communications and captures application code bound for an authorized client. Once obtained, they can use it as-is, or through reverse-engineering glean sensitive information or exploit the trust relationship between the client and server. Such code may belong to a dynamic update to the client, a patch being applied to a client component or any such interaction where the client is authorized to communicate with the server.", "query_type": "nl"} | |
| {"_id": "cwe_q_000570", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary is able to exploit features of the target that should be reserved for privileged users or administrators but are exposed to use by lower or non-privileged accounts. Access to sensitive information and functionality must be controlled to ensure that only authorized users are able to access these resources.\n\nIf access control mechanisms are absent or misconfigured, a user may be able to access resources that are intended only for higher level users. An adversary may be able to exploit this to utilize a less trusted account to gain information and perform activities reserved for more trusted accounts. This attack differs from privilege escalation and other privilege stealing attacks in that the adversary never actually escalates their privileges but instead is able to use a lesse", "query_type": "nl"} | |
| {"_id": "cwe_q_000571", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary searches a targeted web site for web pages that have not been publicized. In doing this, the adversary may be able to gain access to information that the targeted site did not intend to make public.", "query_type": "nl"} | |
| {"_id": "cwe_q_000573", "text": "Identify the underlying software weakness exploited by this attack behavior: An attack of this type involves an adversary inserting malicious characters (such as a XSS redirection) into a filename, directly or indirectly that is then used by the target software to generate HTML text or other potentially executable content. Many websites rely on user-generated content and dynamically build resources like files, filenames, and URL links directly from user supplied data. In this attack pattern, the attacker uploads code that can execute in the client browser and/or redirect the client browser to a site that the attacker owns. All XSS attack payload variants can be used to pass and exploit these vulnerabilities.", "query_type": "nl"} | |
| {"_id": "cwe_q_000574", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary exploits web applications that generate web content, such as links in a HTML page, based on unvalidated or improperly validated data submitted by other actors. XSS in HTTP Headers attacks target the HTTP headers which are hidden from most users and may not be validated by web applications.", "query_type": "nl"} | |
| {"_id": "cwe_q_000575", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker can use the component to send code to a web application that then gets executed by the web server. Doing so enables the attacker to achieve similar results to Cross Site Scripting, viz., arbitrary code execution and information disclosure, albeit on a more limited scale, since the SSI directives are nowhere near as powerful as a full-fledged scripting language. Nonetheless, the attacker can conveniently gain access to sensitive files, such as password files, and execute shell commands.", "query_type": "nl"} | |
| {"_id": "cwe_q_000577", "text": "Identify the underlying software weakness exploited by this attack behavior: The adversary exploits an application that allows for the copying of sensitive data or information by collecting information copied to the clipboard. Data copied to the clipboard can be accessed by other applications, such as malware built to exfiltrate or log clipboard contents on a periodic basis. In this way, the adversary aims to garner information to which they are unauthorized.", "query_type": "nl"} | |
| {"_id": "cwe_q_000579", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker attempts to invoke all common switches and options in the target application for the purpose of discovering weaknesses in the target. For example, in some applications, adding a --debug switch causes debugging information to be displayed, which can sometimes reveal sensitive processing or configuration information to an attacker. This attack differs from other forms of API abuse in that the attacker is indiscriminately attempting to invoke options in the hope that one of them will work rather than specifically targeting a known option. Nonetheless, even if the attacker is familiar with the published options of a targeted application this attack method may still be fruitful as it might discover unpublicized functionality.", "query_type": "nl"} | |
| {"_id": "cwe_q_000580", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary obtains unauthorized information due to insecure or the component. If a cloud provider fails to completely delete storage and data from former cloud tenants' systems/resources, once these resources are allocated to new, potentially malicious tenants, the latter can probe the provided resources for sensitive information still there.", "query_type": "nl"} | |
| {"_id": "cwe_q_000581", "text": "Identify the underlying software weakness exploited by this attack behavior: If a string is passed through a filter of some kind, then a terminal NULL may not be valid. Using alternate representation of NULL allows an adversary to embed the NULL mid-string while postfixing the proper data so that the filter is avoided. One example is a filter that looks for a trailing slash character. If a string insertion is possible, but the slash must exist, an alternate encoding of NULL in mid-string may be used.", "query_type": "nl"} | |
| {"_id": "cwe_q_000583", "text": "Identify the underlying software weakness exploited by this attack behavior: Cellular traffic for voice and data from mobile devices and retransmission devices can be intercepted via numerous methods. Malicious actors can deploy their own cellular tower equipment and intercept cellular traffic surreptitiously. Additionally, government agencies of adversaries and malicious actors can intercept cellular traffic via the telecommunications backbone over which mobile traffic is transmitted.", "query_type": "nl"} | |
| {"_id": "cwe_q_000584", "text": "Identify the underlying software weakness exploited by this attack behavior: This attack forces an integer variable to go out of range. The integer variable is often used as an offset such as size of memory allocation or similarly. The attacker would typically control the value of such variable and try to get it out of range. For instance the integer in question is incremented past the maximum possible value, it may wrap to become a very small, or negative number, therefore providing a very incorrect value which can lead to unexpected behavior. At worst the attacker can execute arbitrary code.", "query_type": "nl"} | |
| {"_id": "cwe_q_000585", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary attempts to deny legitimate users access to a resource by continually engaging a specific resource in an attempt to keep the resource tied up as long as possible. The adversary's primary goal is not to crash or flood the target, which would alert defenders; rather it is to repeatedly perform actions or abuse algorithmic flaws such that a given resource is tied up and not available to a legitimate user. By carefully crafting a requests that keep the resource engaged through what is seemingly benign requests, legitimate users are limited or completely denied access to the resource.\n\nThe degree to which the attack is successful depends upon the adversary's ability to sustain resource requests over time with a volume that exceeds the normal usage by legitimate users, as well as ot", "query_type": "nl"} | |
| {"_id": "cwe_q_000586", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary discovers the structure, function, and composition of an object, resource, or system by using a variety of analysis techniques to effectively determine how the analyzed entity was constructed or operates. The goal of the component is often to duplicate the function, or a part of the function, of an object in order to duplicate or \"back engineer\" some aspect of its functioning. the component techniques can be applied to mechanical objects, electronic devices, or software, although the methodology and techniques involved in each type of analysis differ widely.", "query_type": "nl"} | |
| {"_id": "cwe_q_000587", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary attacks a system by bypassing some or all functionality intended to protect it. Often, a system user will think that protection is in place, but the functionality behind those protections has been disabled by the adversary.", "query_type": "nl"} | |
| {"_id": "cwe_q_000588", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary manipulates a setting or parameter on communications channel in order to compromise its security. This can result in information exposure, insertion/removal of information from the communications stream, and/or potentially system compromise.", "query_type": "nl"} | |
| {"_id": "cwe_q_000590", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary takes advantage of improper data validation to inject malicious global parameters into a Flash file embedded within an HTML document. Flash files can leverage user-submitted data to configure the Flash document and access the embedding HTML document.\n\nThese 'FlashVars' are most often passed to the Flash file via URL arguments or from the Object or Embed tag within the embedding HTML document. If these FlashVars are not properly sanitized, an adversary may be able to embed malicious content (such as scripts) into the HTML document. The injected parameters can also provide the adversary control over other objects within the Flash file as well as full control over the parent document's DOM model. As such, this is a form of HTTP parameter injection, but the abilities granted to th", "query_type": "nl"} | |
| {"_id": "cwe_q_000592", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary targets the communication between two components (typically client and server), in order to alter or obtain data from transactions. A general approach entails the adversary placing themself within the communication channel between the two components.\n\nWhenever one component attempts to communicate with the other (data flow, authentication challenges, etc.), the data first flows through the adversary, who has the opportunity to observe or alter it, before being passed on to the intended recipient as if it was never observed. This interposition is transparent leaving the two compromised components unaware of the potential corruption or leakage of their communications. The potential for these attacks yields an implicit lack of trust in communication or identify between two compon", "query_type": "nl"} | |
| {"_id": "cwe_q_000593", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary sends a UDP packet to a closed port on the target machine to solicit an IP Header's total length field value within the echoed 'Port Unreachable\" error message. This type of behavior is useful for building a signature-base of operating system responses, particularly when error messages contain other types of information that is useful identifying specific operating system responses.\n\nRFC1122 specifies that the Header of the request must be echoed back when an error is sent in response, but some operating systems and firmware alter the integrity of the original header. Non-standard ICMP/IP implementations result in response that are useful for individuating remote operating system or router firmware versions. There are four general response types that can be used to distinguish", "query_type": "nl"} | |
| {"_id": "cwe_q_000594", "text": "Identify the underlying software weakness exploited by this attack behavior: An adversary targets software that constructs NoSQL statements based on user input or with parameters vulnerable to operator replacement in order to achieve a variety of technical impacts such as escalating privileges, bypassing authentication, and/or executing code.\n\nNoSQL database calls are written in an application's programming language, via a custom API call, or formatted in a common convention (e.g., JSON, XML, etc.), any of which the adversary can exploit to achieve the aforementioned goals. NoSQL attacks usually result from improper sanitization and validation of data that originates from a user, either via special character or JavaScript injection. In both cases, the adversary crafts input strings so that when the target software constructs NoSQL statements based on the input, the", "query_type": "nl"} | |
| {"_id": "cwe_q_000596", "text": "Identify the underlying software weakness exploited by this attack behavior: The attacker may submit malicious code of another language to obtain access to privileges that were not intentionally exposed by the sandbox, thus escaping the sandbox. For instance, Java code cannot perform unsafe operations, such as modifying arbitrary memory locations, due to restrictions placed on it by the Byte code Verifier and the JVM. If allowed, Java code can call directly into native C code, which may perform unsafe operations, such as call system calls and modify arbitrary memory locations on their behalf. To provide isolation, Java does not grant untrusted code with unmediated access to native C code. Instead, the sandboxed code is typically allowed to call some subset of the pre-existing native code that is part of standard libraries.", "query_type": "nl"} | |
| {"_id": "cwe_q_000597", "text": "Identify the underlying software weakness exploited by this attack behavior: An attacker examines a target system to find sensitive data that has been embedded within it. This information can reveal confidential contents, such as account numbers or individual keys/credentials that can be used as an intermediate step in a larger attack.", "query_type": "nl"} | |
| {"_id": "cwe_q_000599", "text": "Identify the underlying software weakness exploited by this attack behavior: The adversary directly or indirectly modifies environment variables used by or controlling the target software. The adversary's goal is to cause the target software to deviate from its expected operation in a manner that benefits the adversary.", "query_type": "nl"} | |
| {"_id": "cwe_q_000600", "text": "Identify the underlying software weakness exploited by this attack behavior: the component takes advantage of an unencrypted communication channel between a victim and target system. The attacker sniffs traffic on a network looking for session tokens in unencrypted traffic. Once a session token is captured, the attacker performs malicious actions by using the stolen token with the targeted application to impersonate the victim. This attack is a specific method of session hijacking, which is exploiting a valid session token to gain unauthorized access to a target system or information. Other methods to perform a session hijacking are session fixation, cross-site scripting, or compromising a user or server machine and stealing the session token.", "query_type": "nl"} | |