\n`\n}"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-79"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"},"description":{"kind":"string","value":"The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/79.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31830,"cells":{"code":{"kind":"string","value":"function bufferSlice(buf, start, end) {\n if (end === undefined)\n end = buf.length;\n return new FastBuffer(buf.buffer, buf.byteOffset + start, end - start);\n}"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-78"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"},"description":{"kind":"string","value":"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/78.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31831,"cells":{"code":{"kind":"string","value":" new Promise((resolve, reject) => {"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"NVD-CWE-noinfo"},"cwe_name":{"kind":"null"},"description":{"kind":"null"},"url":{"kind":"null"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31832,"cells":{"code":{"kind":"string","value":"function collideObjects(obj1: any, obj2: any, path: string, modifiers?: ICollideModifiers): any {\n if (!isObject(obj2)) {\n throw new Error(`Unable to collide. Collide value at path ${path} is not an object.`);\n }\n\n if (modifiers && modifiers[path]) {\n return modifiers[path](obj1, obj2);\n }\n\n for (const key of Object.keys(obj2)) {\n const subPath = path + '.' + key;\n\n if (obj1[key] === undefined) {\n obj1[key] = obj2[key];\n } else {\n if (modifiers && modifiers[subPath]) {\n obj1[key] = modifiers[subPath](obj1[key], obj2[key]);\n } else {\n obj1[key] = collideUnsafe(obj1[key], obj2[key], modifiers, subPath);\n }\n }\n }\n\n return obj1;\n}"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"NVD-CWE-Other"},"cwe_name":{"kind":"string","value":"Other"},"description":{"kind":"string","value":"NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset."},"url":{"kind":"string","value":"https://nvd.nist.gov/vuln/categories"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31833,"cells":{"code":{"kind":"string","value":" schemaTypeOptions = {...schemaTypeOptions, type: getSchema(propertyMetadata.type)};\n }\n\n schemaTypeOptions = cleanObject({...schemaTypeOptions, ...rawMongooseSchema});\n\n if (propertyMetadata.isCollection) {\n if (propertyMetadata.isArray) {\n schemaTypeOptions = [schemaTypeOptions];\n } else {\n // Can be a Map or a Set;\n // Mongoose implements only Map;\n if (propertyMetadata.collectionType !== Map) {\n throw new Error(`Invalid collection type. ${propertyMetadata.collectionName} is not supported.`);\n }\n\n schemaTypeOptions = {type: Map, of: schemaTypeOptions};\n }\n }\n\n return schemaTypeOptions;\n}"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-915"},"cwe_name":{"kind":"string","value":"Improperly Controlled Modification of Dynamically-Determined Object Attributes"},"description":{"kind":"string","value":"The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/915.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31834,"cells":{"code":{"kind":"string","value":" scroll_to_bottom_key: common.has_mac_keyboard()\n ? \"Fn + →\"\n : \"End\",\n }),\n );\n $(`.enter_sends_${user_settings.enter_sends}`).show();\n common.adjust_mac_shortcuts(\".enter_sends kbd\");\n}"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-79"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"},"description":{"kind":"string","value":"The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/79.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31835,"cells":{"code":{"kind":"string","value":" message: new MockBuilder(\n {\n from: 'test@valid.sender',\n to: '-d0.1a@example.com'\n },\n 'message\\r\\nline 2'\n )\n },\n function (err, data) {\n expect(err).to.exist;\n expect(data).to.not.exist;\n expect(output).to.equal('');\n client._spawn.restore();\n done();\n }\n );\n });"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-88"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')"},"description":{"kind":"string","value":"The software constructs a string for a command to executed by a separate component\nin another control sphere, but it does not properly delimit the\nintended arguments, options, or switches within that command string."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/88.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31836,"cells":{"code":{"kind":"string","value":"function validateBaseUrl(url: string) {\n // from this MIT-licensed gist: https://gist.github.com/dperini/729294\n return /^(?:(?:(?:https?|ftp):)?\\/\\/)(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))?)(?::\\d{2,5})?(?:[/?#]\\S*)?$/i.test("},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"NVD-CWE-noinfo"},"cwe_name":{"kind":"null"},"description":{"kind":"null"},"url":{"kind":"null"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31837,"cells":{"code":{"kind":"string","value":" encrypt(packet) {\n // `packet` === unencrypted packet\n\n if (this._dead)\n return;\n\n this._onWrite(packet);\n\n this.outSeqno = (this.outSeqno + 1) >>> 0;\n }"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-78"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"},"description":{"kind":"string","value":"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/78.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31838,"cells":{"code":{"kind":"string","value":" get lokadIdHex() { return \"534c5000\" }"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-20"},"cwe_name":{"kind":"string","value":"Improper Input Validation"},"description":{"kind":"string","value":"The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n properties that are required to process the data safely and\n correctly."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/20.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31839,"cells":{"code":{"kind":"string","value":" function check_response(err: Error | null, response: any) {\n should.not.exist(err);\n //xx debugLog(response.toString());\n response.responseHeader.serviceResult.should.eql(StatusCodes.BadInvalidArgument);\n }"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-400"},"cwe_name":{"kind":"string","value":"Uncontrolled Resource Consumption"},"description":{"kind":"string","value":"The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/400.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31840,"cells":{"code":{"kind":"string","value":" objectKeys(data).forEach((key) => {\n obj.add(ctx.next(data[key]));\n });"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-915"},"cwe_name":{"kind":"string","value":"Improperly Controlled Modification of Dynamically-Determined Object Attributes"},"description":{"kind":"string","value":"The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/915.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31841,"cells":{"code":{"kind":"string","value":"TEST_F(AsStringGraphTest, FillWithZero) {\n TF_ASSERT_OK(Init(DT_INT64, /*fill=*/\"0\", /*width=*/4));\n\n AddInputFromArray(TensorShape({3}), {-42, 0, 42});\n TF_ASSERT_OK(RunOpKernel());\n Tensor expected(allocator(), DT_STRING, TensorShape({3}));\n test::FillValues(&expected, {\"-042\", \"0000\", \"0042\"});\n test::ExpectTensorEqual(expected, *GetOutput(0));\n}"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-134"},"cwe_name":{"kind":"string","value":"Use of Externally-Controlled Format String"},"description":{"kind":"string","value":"The software uses a function that accepts a format string as an argument, but the format string originates from an external source."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/134.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31842,"cells":{"code":{"kind":"string","value":" connect() {\n this.emit('connect');\n }"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-78"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"},"description":{"kind":"string","value":"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/78.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31843,"cells":{"code":{"kind":"string","value":" .catch(error => {\n // There was an error with the session token\n const result = {};\n if (error && error.code === Parse.Error.INVALID_SESSION_TOKEN) {\n // Store a resolved promise with the error for 10 minutes\n result.error = error;\n this.authCache.set(\n sessionToken,\n Promise.resolve(result),\n 60 * 10 * 1000\n );\n } else {"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-672"},"cwe_name":{"kind":"string","value":"Operation on a Resource after Expiration or Release"},"description":{"kind":"string","value":"The software uses, accesses, or otherwise operates on a resource after that resource has been expired, released, or revoked."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/672.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31844,"cells":{"code":{"kind":"string","value":" constructor(config) {\n const enc = config.outbound;\n this.outSeqno = enc.seqno;\n this._onWrite = enc.onWrite;\n this._encKeyMain = enc.cipherKey.slice(0, 32);\n this._encKeyPktLen = enc.cipherKey.slice(32);\n this._dead = false;\n }"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-78"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"},"description":{"kind":"string","value":"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/78.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31845,"cells":{"code":{"kind":"string","value":"export function exportVariable(name: string, val: any): void {\n const convertedVal = toCommandValue(val)\n process.env[name] = convertedVal\n\n const filePath = process.env['GITHUB_ENV'] || ''\n if (filePath) {\n const delimiter = '_GitHubActionsFileCommandDelimeter_'\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`\n issueFileCommand('ENV', commandValue)\n } else {\n issueCommand('set-env', {name}, convertedVal)\n }\n}"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-74"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')"},"description":{"kind":"string","value":"The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/74.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31846,"cells":{"code":{"kind":"string","value":" static buildMintOpReturn(config: configBuildMintOpReturn, type = 0x01) {\n return SlpTokenType1.buildMintOpReturn(\n config.tokenIdHex,\n config.batonVout,\n config.mintQuantity, \n type\n )\n }"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-20"},"cwe_name":{"kind":"string","value":"Improper Input Validation"},"description":{"kind":"string","value":"The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n properties that are required to process the data safely and\n correctly."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/20.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31847,"cells":{"code":{"kind":"string","value":" ctx.prompt(prompt, function retryPrompt(answers) {\n if (answers.length === 0)\n return ctx.reject(['keyboard-interactive']);\n nick = answers[0];\n if (nick.length > MAX_NAME_LEN) {\n return ctx.prompt(`That nickname is too long.\\n${PROMPT_NAME}`,\n retryPrompt);\n } else if (nick.length === 0) {\n return ctx.prompt(`A nickname is required.\\n${PROMPT_NAME}`,\n retryPrompt);\n }\n lowered = nick.toLowerCase();\n for (const user of users) {\n if (user.name.toLowerCase() === lowered) {\n return ctx.prompt(`That nickname is already in use.\\n${PROMPT_NAME}`,\n retryPrompt);\n }\n }\n name = nick;\n ctx.accept();\n });"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-78"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"},"description":{"kind":"string","value":"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/78.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31848,"cells":{"code":{"kind":"string","value":"export const showWarningDialog = (message: string): void => {\n const options: MessageBoxSyncOptions = {\n buttons: ['OK'],\n message,\n title: 'Warning',\n type: 'warning',\n };\n dialog.showMessageBoxSync(options);\n};"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-20"},"cwe_name":{"kind":"string","value":"Improper Input Validation"},"description":{"kind":"string","value":"The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n properties that are required to process the data safely and\n correctly."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/20.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31849,"cells":{"code":{"kind":"string","value":"async function proxyServer (t, backendURL, backendPath, proxyOptions, wrapperOptions) {\n const frontend = Fastify({ logger: { level } })\n const registerProxy = async fastify => {\n fastify.register(proxy, {\n upstream: backendURL + backendPath,\n ...proxyOptions\n })\n }\n\n t.comment('starting proxy to ' + backendURL + backendPath)\n\n if (wrapperOptions) {\n await frontend.register(registerProxy, wrapperOptions)\n } else {\n await registerProxy(frontend)\n }\n\n return [frontend, await frontend.listen(0)]\n}"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-20"},"cwe_name":{"kind":"string","value":"Improper Input Validation"},"description":{"kind":"string","value":"The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n properties that are required to process the data safely and\n correctly."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/20.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31850,"cells":{"code":{"kind":"string","value":"function genOpenSSLECDSAPub(oid, Q) {\n const asnWriter = new Ber.Writer();\n asnWriter.startSequence();\n // algorithm\n asnWriter.startSequence();\n asnWriter.writeOID('1.2.840.10045.2.1'); // id-ecPublicKey\n // algorithm parameters (namedCurve)\n asnWriter.writeOID(oid);\n asnWriter.endSequence();\n\n // subjectPublicKey\n asnWriter.startSequence(Ber.BitString);\n asnWriter.writeByte(0x00);\n // XXX: hack to write a raw buffer without a tag -- yuck\n asnWriter._ensure(Q.length);\n asnWriter._buf.set(Q, asnWriter._offset);\n asnWriter._offset += Q.length;\n // end hack\n asnWriter.endSequence();\n asnWriter.endSequence();\n return makePEM('PUBLIC', asnWriter.buffer);\n}"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-78"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"},"description":{"kind":"string","value":"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/78.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31851,"cells":{"code":{"kind":"string","value":" objectKeys(data).forEach((key) => {\n obj.set(key, ctx.next(data[key]) as T);\n });"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-915"},"cwe_name":{"kind":"string","value":"Improperly Controlled Modification of Dynamically-Determined Object Attributes"},"description":{"kind":"string","value":"The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/915.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31852,"cells":{"code":{"kind":"string","value":" writeUInt32LE: (buf, value, offset) => {\n buf[offset++] = value;\n buf[offset++] = (value >>> 8);\n buf[offset++] = (value >>> 16);\n buf[offset++] = (value >>> 24);\n return offset;\n },"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-78"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"},"description":{"kind":"string","value":"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/78.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31853,"cells":{"code":{"kind":"string","value":" constructor() { }"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-295"},"cwe_name":{"kind":"string","value":"Improper Certificate Validation"},"description":{"kind":"string","value":"The software does not validate, or incorrectly validates, a certificate."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/295.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31854,"cells":{"code":{"kind":"string","value":" onUpdate: function(username, accessToken) {\n users[username] = accessToken;\n }"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-88"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')"},"description":{"kind":"string","value":"The software constructs a string for a command to executed by a separate component\nin another control sphere, but it does not properly delimit the\nintended arguments, options, or switches within that command string."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/88.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31855,"cells":{"code":{"kind":"string","value":" constructor(options?: { signatureLength?: number }) {\n super();\n\n this.id = \"\";\n\n this._tick0 = 0;\n this._tick1 = 0;\n this._hasReceivedError = false;\n this.blocks = [];\n this.messageChunks = [];\n this._expectedChannelId = 0;\n\n options = options || {};\n\n this.signatureLength = options.signatureLength || 0;\n\n this.options = options;\n\n this._packetAssembler = new PacketAssembler({\n minimumSizeInBytes: 0,\n readMessageFunc: readRawMessageHeader\n });\n\n this._packetAssembler.on(\"message\", (messageChunk) => this._feed_messageChunk(messageChunk));\n\n this._packetAssembler.on(\"newMessage\", (info, data) => {\n if (doPerfMonitoring) {\n // record tick 0: when the first data is received\n this._tick0 = get_clock_tick();\n }\n /**\n *\n * notify the observers that a new message is being built\n * @event start_chunk\n * @param info\n * @param data\n */\n this.emit(\"start_chunk\", info, data);\n });\n\n this._securityDefeated = false;\n this.totalBodySize = 0;\n this.totalMessageSize = 0;\n this.channelId = 0;\n this.offsetBodyStart = 0;\n this.sequenceHeader = null;\n this._init_new();\n }"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-400"},"cwe_name":{"kind":"string","value":"Uncontrolled Resource Consumption"},"description":{"kind":"string","value":"The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/400.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31856,"cells":{"code":{"kind":"string","value":" calculateMintCost(mintOpReturnLength: number, inputUtxoSize: number, batonAddress: string|null, bchChangeAddress?: string, feeRate = 1) {\n return this.calculateMintOrGenesisCost(mintOpReturnLength, inputUtxoSize, batonAddress, bchChangeAddress, feeRate);\n }"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-20"},"cwe_name":{"kind":"string","value":"Improper Input Validation"},"description":{"kind":"string","value":"The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n properties that are required to process the data safely and\n correctly."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/20.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31857,"cells":{"code":{"kind":"string","value":" public static IESParameterSpec guessParameterSpec(BufferedBlockCipher iesBlockCipher, byte[] nonce)\n {\n if (iesBlockCipher == null)\n {\n return new IESParameterSpec(null, null, 128);\n }\n else\n {\n BlockCipher underlyingCipher = iesBlockCipher.getUnderlyingCipher();\n\n if (underlyingCipher.getAlgorithmName().equals(\"DES\") ||\n underlyingCipher.getAlgorithmName().equals(\"RC2\") ||\n underlyingCipher.getAlgorithmName().equals(\"RC5-32\") ||\n underlyingCipher.getAlgorithmName().equals(\"RC5-64\"))\n {\n return new IESParameterSpec(null, null, 64, 64, nonce);\n }\n else if (underlyingCipher.getAlgorithmName().equals(\"SKIPJACK\"))\n {\n return new IESParameterSpec(null, null, 80, 80, nonce);\n }\n else if (underlyingCipher.getAlgorithmName().equals(\"GOST28147\"))\n {\n return new IESParameterSpec(null, null, 256, 256, nonce);\n }\n\n return new IESParameterSpec(null, null, 128, 128, nonce);\n }\n }"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-310"},"cwe_name":{"kind":"string","value":"Cryptographic Issues"},"description":{"kind":"string","value":"Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not addressed."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/310.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31858,"cells":{"code":{"kind":"string","value":"const renderContent = (content: string | any) => {\n if (typeof content === 'string') {\n return renderHTML(content);\n }\n return content;\n};"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-79"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"},"description":{"kind":"string","value":"The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/79.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31859,"cells":{"code":{"kind":"string","value":" .on(\"finished\", () => {\n if (doTraceChunk) {\n // tslint:disable-next-line: no-console\n warningLog(\n timestamp(),\n \" <$$ \",\n msgType,\n \"nbChunk = \" + nbChunks.toString().padStart(3),\n \"totalLength = \" + totalSize.toString().padStart(8),\n \"l=\",\n binSize.toString().padStart(6)\n );\n }\n if (totalSize > this.maxMessageSize) {\n errorLog(`[NODE-OPCUA-E55] message size ${totalSize} exceeds the negotiated message size ${this.maxMessageSize} nb chunks ${nbChunks}`);\n }\n messageChunkCallback(null);\n });"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-400"},"cwe_name":{"kind":"string","value":"Uncontrolled Resource Consumption"},"description":{"kind":"string","value":"The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/400.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31860,"cells":{"code":{"kind":"string","value":" static async getAsset(assetPath, res) {\n try {\n const fileInfo = assetHelper.getPathInfo(assetPath)\n const fileHash = assetHelper.generateHash(assetPath)\n const cachePath = path.resolve(WIKI.ROOTPATH, WIKI.config.dataPath, `cache/${fileHash}.dat`)\n\n // Force unsafe extensions to download\n if (WIKI.config.uploads.forceDownload && !['.png', '.apng', '.jpg', '.jpeg', '.gif', '.bmp', '.webp', '.svg'].includes(fileInfo.ext)) {\n res.set('Content-disposition', 'attachment; filename=' + fileInfo.base)\n }\n\n if (await WIKI.models.assets.getAssetFromCache(assetPath, cachePath, res)) {\n return\n }\n if (await WIKI.models.assets.getAssetFromStorage(assetPath, res)) {\n return\n }\n await WIKI.models.assets.getAssetFromDb(assetPath, fileHash, cachePath, res)\n } catch (err) {\n if (err.code === `ECONNABORTED` || err.code === `EPIPE`) {\n return\n }\n WIKI.logger.error(err)\n res.sendStatus(500)\n }\n }"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-79"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"},"description":{"kind":"string","value":"The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/79.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31861,"cells":{"code":{"kind":"string","value":" schemaTypeOptions = {...schemaTypeOptions, type: getSchema(propertyMetadata.type)};\n }\n\n schemaTypeOptions = cleanProps({...schemaTypeOptions, ...rawMongooseSchema});\n\n if (propertyMetadata.isCollection) {\n if (propertyMetadata.isArray) {\n schemaTypeOptions = [schemaTypeOptions];\n } else {\n // Can be a Map or a Set;\n // Mongoose implements only Map;\n if (propertyMetadata.collectionType !== Map) {\n throw new Error(`Invalid collection type. ${propertyMetadata.collectionName} is not supported.`);\n }\n\n schemaTypeOptions = {type: Map, of: schemaTypeOptions};\n }\n }\n\n return schemaTypeOptions;\n}"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-915"},"cwe_name":{"kind":"string","value":"Improperly Controlled Modification of Dynamically-Determined Object Attributes"},"description":{"kind":"string","value":"The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/915.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31862,"cells":{"code":{"kind":"string","value":"function showTooltip(target: HTMLElement): () => void {\n const tooltip = document.createElement(\"div\");\n const isHidden = target.classList.contains(\"hidden\");\n if (isHidden) {\n target.classList.remove(\"hidden\");\n }\n tooltip.className = \"keyboard-tooltip\";\n tooltip.innerHTML = target.getAttribute(\"data-key\") || \"\";\n document.body.appendChild(tooltip);\n const parentCoords = target.getBoundingClientRect();\n // Padded 10px to the left if there is space or centered otherwise\n const left =\n parentCoords.left +\n Math.min((target.offsetWidth - tooltip.offsetWidth) / 2, 10);\n const top =\n parentCoords.top + (target.offsetHeight - tooltip.offsetHeight) / 2;\n tooltip.style.left = `${left}px`;\n tooltip.style.top = `${top + window.pageYOffset}px`;\n return (): void => {\n tooltip.remove();\n if (isHidden) {\n target.classList.add(\"hidden\");\n }\n };\n}"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-79"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"},"description":{"kind":"string","value":"The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/79.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31863,"cells":{"code":{"kind":"string","value":"function userBroadcast(msg, source) {\n var sourceMsg = '> ' + msg;\n var name = '{cyan-fg}{bold}' + source.name + '{/}';\n msg = ': ' + msg;\n for (var i = 0; i < users.length; ++i) {\n var user = users[i];\n var output = user.output;\n if (source === user)\n output.add(sourceMsg);\n else\n output.add(formatMessage(name, output) + msg);\n }\n}"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-78"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"},"description":{"kind":"string","value":"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/78.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31864,"cells":{"code":{"kind":"string","value":" getDownloadUrl(id, accessToken) {\n return this.importExport.getDownloadUrl(id, accessToken);\n },"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-639"},"cwe_name":{"kind":"string","value":"Authorization Bypass Through User-Controlled Key"},"description":{"kind":"string","value":"The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/639.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31865,"cells":{"code":{"kind":"string","value":"export async function execRequest(routes: Routers, ctx: AppContext) {\n\tconst match = findMatchingRoute(ctx.path, routes);\n\tif (!match) throw new ErrorNotFound();\n\n\tconst endPoint = match.route.findEndPoint(ctx.request.method as HttpMethod, match.subPath.schema);\n\tif (ctx.URL && !isValidOrigin(ctx.URL.origin, baseUrl(endPoint.type), endPoint.type)) throw new ErrorNotFound(`Invalid origin: ${ctx.URL.origin}`, 'invalidOrigin');\n\n\t// This is a generic catch-all for all private end points - if we\n\t// couldn't get a valid session, we exit now. Individual end points\n\t// might have additional permission checks depending on the action.\n\tif (!match.route.isPublic(match.subPath.schema) && !ctx.joplin.owner) throw new ErrorForbidden();\n\n\treturn endPoint.handler(match.subPath, ctx);\n}"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-352"},"cwe_name":{"kind":"string","value":"Cross-Site Request Forgery (CSRF)"},"description":{"kind":"string","value":"The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/352.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31866,"cells":{"code":{"kind":"string","value":" private _buildData(data: Buffer) {\n if (data && this._stack.length === 0) {\n return data;\n }\n if (!data && this._stack.length === 1) {\n data = this._stack[0];\n this._stack.length = 0; // empty stack array\n return data;\n }\n this._stack.push(data);\n data = Buffer.concat(this._stack);\n this._stack.length = 0;\n return data;\n }"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-400"},"cwe_name":{"kind":"string","value":"Uncontrolled Resource Consumption"},"description":{"kind":"string","value":"The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/400.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31867,"cells":{"code":{"kind":"string","value":" handleVote: debounce(handleVote, 500, { leading: true, trailing: false }),\n };\n};"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"NVD-CWE-noinfo"},"cwe_name":{"kind":"null"},"description":{"kind":"null"},"url":{"kind":"null"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31868,"cells":{"code":{"kind":"string","value":" const buildCDNUrl = (packageName: string, suffix: string) => filter(`${cdnUrl}/${packageName}/${version ? `@${version}/` : ''}${suffix}` || '')\n return `"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-79"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"},"description":{"kind":"string","value":"The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/79.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31869,"cells":{"code":{"kind":"string","value":" \"click .save\"(evt) {\n const instance = Template.instance();\n const newIpBlacklist = instance.ipBlacklist.get();\n\n instance.formState.set({\n state: \"submitting\",\n message: \"\",\n });\n\n Meteor.call(\"setSetting\", undefined, \"ipBlacklist\", newIpBlacklist, (err) => {\n if (err) {\n instance.formState.set({\n state: \"error\",\n message: err.message,\n });\n } else {\n instance.originalIpBlacklist = newIpBlacklist;\n instance.formState.set({\n state: \"success\",\n message: \"Saved changes.\",\n });\n }\n });\n },"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-918"},"cwe_name":{"kind":"string","value":"Server-Side Request Forgery (SSRF)"},"description":{"kind":"string","value":"The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/918.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31870,"cells":{"code":{"kind":"string","value":"export default function isSafeRedirect(url: string): boolean {\n if (typeof url !== 'string') {\n throw new TypeError(`Invalid url: ${url}`);\n }\n\n // Prevent open redirects using the //foo.com format (double forward slash).\n if (/\\/\\//.test(url)) {\n return false;\n }\n\n return !/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.test(url);\n}"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-601"},"cwe_name":{"kind":"string","value":"URL Redirection to Untrusted Site ('Open Redirect')"},"description":{"kind":"string","value":"A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/601.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31871,"cells":{"code":{"kind":"string","value":" constructor({asset, message, onClick}: Params, element: HTMLElement) {\n super(message);\n this.asset = asset;\n this.message = message;\n this.isVisible = ko.observable(false);\n this.onClick = (_data, event) => onClick(message, event);\n\n this.dummyImageUrl = `data:image/svg+xml;utf8,`;\n\n this.imageUrl = ko.observable();\n\n this.isIdle = () => this.uploadProgress() === -1 && !this.asset.resource() && !this.message.isObfuscated();\n\n ko.computed(\n () => {\n if (this.isVisible() && asset.resource()) {\n this.assetRepository\n .load(asset.resource())\n .then(blob => {\n this.imageUrl(window.URL.createObjectURL(blob));\n })\n .catch(error => console.error(error));\n }\n },\n {disposeWhenNodeIsRemoved: element},\n );\n\n this.container = element;\n viewportObserver.onElementInViewport(this.container, () => this.isVisible(true));\n }"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-79"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"},"description":{"kind":"string","value":"The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/79.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31872,"cells":{"code":{"kind":"string","value":" ctx.prompt(prompt, function retryPrompt(answers) {\n if (answers.length === 0)\n return ctx.reject(['keyboard-interactive']);\n nick = answers[0];\n if (nick.length > MAX_NAME_LEN) {\n return ctx.prompt('That nickname is too long.\\n' + PROMPT_NAME,\n retryPrompt);\n } else if (nick.length === 0) {\n return ctx.prompt('A nickname is required.\\n' + PROMPT_NAME,\n retryPrompt);\n }\n lowered = nick.toLowerCase();\n for (var i = 0; i < users.length; ++i) {\n if (users[i].name.toLowerCase() === lowered) {\n return ctx.prompt('That nickname is already in use.\\n' + PROMPT_NAME,\n retryPrompt);\n }\n }\n name = nick;\n ctx.accept();\n });"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-78"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"},"description":{"kind":"string","value":"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/78.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31873,"cells":{"code":{"kind":"string","value":" function genRSAASN1Buf(n, e, d, p, q, dmp1, dmq1, iqmp) {\n const asnWriter = new Ber.Writer();\n asnWriter.startSequence();\n asnWriter.writeInt(0x00, Ber.Integer);\n asnWriter.writeBuffer(n, Ber.Integer);\n asnWriter.writeBuffer(e, Ber.Integer);\n asnWriter.writeBuffer(d, Ber.Integer);\n asnWriter.writeBuffer(p, Ber.Integer);\n asnWriter.writeBuffer(q, Ber.Integer);\n asnWriter.writeBuffer(dmp1, Ber.Integer);\n asnWriter.writeBuffer(dmq1, Ber.Integer);\n asnWriter.writeBuffer(iqmp, Ber.Integer);\n asnWriter.endSequence();\n return asnWriter.buffer;\n }"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-78"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"},"description":{"kind":"string","value":"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/78.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31874,"cells":{"code":{"kind":"string","value":" this.transport.init(socket, (err?: Error) => {\n if (err) {\n callback(err);\n } else {\n this._rememberClientAddressAndPort();\n\n this.messageChunker.maxMessageSize = this.transport.maxMessageSize;\n\n // bind low level TCP transport to messageBuilder\n this.transport.on(\"message\", (messageChunk: Buffer) => {\n assert(this.messageBuilder);\n this.messageBuilder.feed(messageChunk);\n });\n debugLog(\"ServerSecureChannelLayer : Transport layer has been initialized\");\n debugLog(\"... now waiting for OpenSecureChannelRequest...\");\n\n ServerSecureChannelLayer.registry.register(this);\n\n this._wait_for_open_secure_channel_request(callback, this.timeout);\n }\n });"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-400"},"cwe_name":{"kind":"string","value":"Uncontrolled Resource Consumption"},"description":{"kind":"string","value":"The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/400.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31875,"cells":{"code":{"kind":"string","value":"function extend(...args) {\n const to = Object(args[0]);\n for (let i = 1; i < args.length; i += 1) {\n const nextSource = args[i];\n if (nextSource !== undefined && nextSource !== null) {\n const keysArray = Object.keys(Object(nextSource));\n for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {\n const nextKey = keysArray[nextIndex];\n const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n if (desc !== undefined && desc.enumerable) {\n if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {\n extend(to[nextKey], nextSource[nextKey]);\n } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {\n to[nextKey] = {};\n extend(to[nextKey], nextSource[nextKey]);\n } else {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n }\n return to;\n}"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"NVD-CWE-noinfo"},"cwe_name":{"kind":"null"},"description":{"kind":"null"},"url":{"kind":"null"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31876,"cells":{"code":{"kind":"string","value":"function OpenSSH_Old_Private(type, comment, privPEM, pubPEM, pubSSH, algo,\n decrypted) {\n this.type = type;\n this.comment = comment;\n this[SYM_PRIV_PEM] = privPEM;\n this[SYM_PUB_PEM] = pubPEM;\n this[SYM_PUB_SSH] = pubSSH;\n this[SYM_HASH_ALGO] = algo;\n this[SYM_DECRYPTED] = decrypted;\n}"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-78"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"},"description":{"kind":"string","value":"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/78.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31877,"cells":{"code":{"kind":"string","value":" objectKeys(obj).forEach((propertyName: string) => {\n const propertyMetadata = ConverterService.getPropertyMetadata(properties, propertyName);\n\n return this.convertProperty(obj, instance, propertyName, propertyMetadata, options);\n });"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-915"},"cwe_name":{"kind":"string","value":"Improperly Controlled Modification of Dynamically-Determined Object Attributes"},"description":{"kind":"string","value":"The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/915.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31878,"cells":{"code":{"kind":"string","value":"function spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)\n list[i] = list[k];\n list.pop();\n}"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-78"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"},"description":{"kind":"string","value":"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/78.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31879,"cells":{"code":{"kind":"string","value":" constructor() {\n this._zlib = new Zlib(INFLATE);\n }"},"label":{"kind":"number","value":1,"string":"1"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-78"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')"},"description":{"kind":"string","value":"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/78.html"},"label_name":{"kind":"string","value":"safe"}}},{"rowIdx":31880,"cells":{"code":{"kind":"string","value":" link: new ApolloLink((operation, forward) => {\n return forward(operation).map((response) => {\n const context = operation.getContext();\n const {\n response: { headers },\n } = context;\n expect(headers.get('access-control-allow-origin')).toEqual('*');\n checked = true;\n return response;\n });\n }).concat(\n createHttpLink({\n uri: 'http://localhost:13377/graphql',\n fetch,\n headers: {\n ...headers,\n Origin: 'http://someorigin.com',\n },\n })\n ),\n cache: new InMemoryCache(),\n });"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-863"},"cwe_name":{"kind":"string","value":"Incorrect Authorization"},"description":{"kind":"string","value":"The software performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/863.html"},"label_name":{"kind":"string","value":"vulnerable"}}},{"rowIdx":31881,"cells":{"code":{"kind":"string","value":"export function orderLinks(links: T[]) {\n const [provided, unknown] = partition(links, isProvided);\n return [\n ...sortBy(provided, link => PROVIDED_TYPES.indexOf(link.type)),\n ...sortBy(unknown, link => link.name!.toLowerCase())\n ];\n}"},"label":{"kind":"number","value":0,"string":"0"},"programming_language":{"kind":"string","value":"TypeScript"},"cwe_id":{"kind":"string","value":"CWE-79"},"cwe_name":{"kind":"string","value":"Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"},"description":{"kind":"string","value":"The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users."},"url":{"kind":"string","value":"https://cwe.mitre.org/data/definitions/79.html"},"label_name":{"kind":"string","value":"vulnerable"}}}],"truncated":false,"partial":false},"paginationData":{"pageIndex":318,"numItemsPerPage":100,"numTotalItems":31882,"offset":31800,"length":100}},"jwt":"eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sImlhdCI6MTc2NjA3OTM0Mywic3ViIjoiL2RhdGFzZXRzL21jYW5vZ2x1L2RlZmVjdC1kZXRlY3Rpb24iLCJleHAiOjE3NjYwODI5NDMsImlzcyI6Imh0dHBzOi8vaHVnZ2luZ2ZhY2UuY28ifQ.4j0sXiAJBt94gWy9ONs7MalndlgmgkePHrY2HpgeV5r-fAb7icDhcnr0m6Qoi88yyxXpEozcvSz22RnpMDeACg","displayUrls":true,"splitSizeSummaries":[{"config":"default","split":"train","numRows":31882,"numBytesParquet":10356293},{"config":"default","split":"validation","numRows":3984,"numBytesParquet":1289831},{"config":"default","split":"test","numRows":3984,"numBytesParquet":1249797}]},"discussionsStats":{"closed":1,"open":2,"total":3},"fullWidth":true,"hasGatedAccess":true,"hasFullAccess":true,"isEmbedded":false,"savedQueries":{"community":[],"user":[]}}">
function genOpenSSHDSAPub(p, q, g, y) {
const publicKey = Buffer.allocUnsafe(
4 + 7 + 4 + p.length + 4 + q.length + 4 + g.length + 4 + y.length
);
writeUInt32BE(publicKey, 7, 0);
publicKey.utf8Write('ssh-dss', 4, 7);
let i = 4 + 7;
writeUInt32BE(publicKey, p.length, i);
publicKey.set(p, i += 4);
writeUInt32BE(publicKey, q.length, i += p.length);
publicKey.set(q, i += 4);
writeUInt32BE(publicKey, g.length, i += q.length);
publicKey.set(g, i += 4);
writeUInt32BE(publicKey, y.length, i += g.length);
publicKey.set(y, i + 4);
return publicKey;
}
1
TypeScript
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
function exportBranch(req, res) {
const {branchId, type, format, version, taskId} = req.params;
const branch = becca.getBranch(branchId);
if (!branch) {
const message = `Cannot export branch ${branchId} since it does not exist.`;
log.error(message);
res.status(500).send(message);
return;
}
const taskContext = new TaskContext(taskId, 'export');
try {
if (type === 'subtree' && (format === 'html' || format === 'markdown')) {
zipExportService.exportToZip(taskContext, branch, format, res);
}
else if (type === 'single') {
singleExportService.exportSingleNote(taskContext, branch, format, res);
}
else if (format === 'opml') {
opmlExportService.exportToOpml(taskContext, branch, version, res);
}
else {
return [404, "Unrecognized export format " + format];
}
}
catch (e) {
const message = "Export failed with following error: '" + e.message + "'. More details might be in the logs.";
taskContext.reportError(message);
log.error(message + e.stack);
res.status(500).send(message);
}
}
0
TypeScript
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
https://cwe.mitre.org/data/definitions/20.html
safe
async showExportDialogEvent({notePath, defaultType}) {
// each opening of the dialog resets the taskId, so we don't associate it with previous exports anymore
this.taskId = '';
this.$exportButton.removeAttr("disabled");
if (defaultType === 'subtree') {
this.$subtreeType.prop("checked", true).trigger('change');
// to show/hide OPML versions
this.$widget.find("input[name=export-subtree-format]:checked").trigger('change');
}
else if (defaultType === 'single') {
this.$singleType.prop("checked", true).trigger('change');
}
else {
throw new Error("Unrecognized type " + defaultType);
}
this.$widget.find(".opml-v2").prop("checked", true); // setting default
utils.openDialog(this.$widget);
const {noteId, parentNoteId} = treeService.getNoteIdAndParentIdFromNotePath(notePath);
this.branchId = await froca.getBranchId(parentNoteId, noteId);
const noteTitle = await treeService.getNoteTitle(noteId);
this.$noteTitle.html(noteTitle);
}
0
TypeScript
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
module.exports = function (url, options) {
return fetch(url, options);
};
1
TypeScript
CWE-88
Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
The software constructs a string for a command to executed by a separate component
in another control sphere, but it does not properly delimit the
intended arguments, options, or switches within that command string.
Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
The software constructs a string for a command to executed by a separate component
in another control sphere, but it does not properly delimit the
intended arguments, options, or switches within that command string.
https://cwe.mitre.org/data/definitions/88.html
vulnerable
function getHomeDir(): string {
const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${sep}` } = process.env;
if (HOME) return HOME;
if (USERPROFILE) return USERPROFILE;
if (HOMEPATH) return `${HOMEDRIVE}${HOMEPATH}`;
return homedir();
}
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
The software performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions.
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
The software uses a function that accepts a format string as an argument, but the format string originates from an external source.
https://cwe.mitre.org/data/definitions/134.html
safe
function indexer(set) {
return function (obj, i) {
"use strict";
try {
if (obj && i && obj.hasOwnProperty(i)) {
return obj[i];
} else if (obj && i && set) {
obj[i] = {};
return obj[i];
}
return;
} catch (ex) {
console.error(ex);
return;
}
};
}
1
TypeScript
CWE-915
Improperly Controlled Modification of Dynamically-Determined Object Attributes
The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.
].forEach((testCase) => {
let errorChecks = testCase[1];
if (!Array.isArray(errorChecks))
errorChecks = [errorChecks[0], errorChecks[0]];
for (const input of testCase[0]) {
assert.throws(() => createCipher(input), errorChecks[0]);
assert.throws(() => createDecipher(input), errorChecks[1]);
}
});
1
TypeScript
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/78.html
safe
function stringifySnapshots (snapshots: any, pretty = false) {
return JSON.stringify(snapshots, (key, value) => {
if (['sender', 'webContents'].includes(key)) {
return '[WebContents]';
}
if (key === 'openerId' && typeof value === 'number') {
return 'placeholder-opener-id';
}
if (key === 'processId' && typeof value === 'number') {
return 'placeholder-process-id';
}
if (key === 'returnValue') {
return 'placeholder-guest-contents-id';
}
return value;
}, pretty ? 2 : undefined);
}
1
TypeScript
CWE-668
Exposure of Resource to Wrong Sphere
The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
The software does not preserve permissions or incorrectly preserves permissions when copying, restoring, or sharing objects, which can cause them to have less restrictive permissions than intended.
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
function bufferSlice(buf, start, end) {
if (end === undefined)
end = buf.length;
return new FastBuffer(buf.buffer, buf.byteOffset + start, end - start);
}
1
TypeScript
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/78.html
safe
new Promise((resolve, reject) => {
1
TypeScript
NVD-CWE-noinfo
null
null
null
safe
function collideObjects(obj1: any, obj2: any, path: string, modifiers?: ICollideModifiers): any {
if (!isObject(obj2)) {
throw new Error(`Unable to collide. Collide value at path ${path} is not an object.`);
}
if (modifiers && modifiers[path]) {
return modifiers[path](obj1, obj2);
}
for (const key of Object.keys(obj2)) {
const subPath = path + '.' + key;
if (obj1[key] === undefined) {
obj1[key] = obj2[key];
} else {
if (modifiers && modifiers[subPath]) {
obj1[key] = modifiers[subPath](obj1[key], obj2[key]);
} else {
obj1[key] = collideUnsafe(obj1[key], obj2[key], modifiers, subPath);
}
}
}
return obj1;
}
0
TypeScript
NVD-CWE-Other
Other
NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
https://nvd.nist.gov/vuln/categories
vulnerable
schemaTypeOptions = {...schemaTypeOptions, type: getSchema(propertyMetadata.type)};
}
schemaTypeOptions = cleanObject({...schemaTypeOptions, ...rawMongooseSchema});
if (propertyMetadata.isCollection) {
if (propertyMetadata.isArray) {
schemaTypeOptions = [schemaTypeOptions];
} else {
// Can be a Map or a Set;
// Mongoose implements only Map;
if (propertyMetadata.collectionType !== Map) {
throw new Error(`Invalid collection type. ${propertyMetadata.collectionName} is not supported.`);
}
schemaTypeOptions = {type: Map, of: schemaTypeOptions};
}
}
return schemaTypeOptions;
}
1
TypeScript
CWE-915
Improperly Controlled Modification of Dynamically-Determined Object Attributes
The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
message: new MockBuilder(
{
from: '[email protected]',
to: '[email protected]'
},
'message\r\nline 2'
)
},
function (err, data) {
expect(err).to.exist;
expect(data).to.not.exist;
expect(output).to.equal('');
client._spawn.restore();
done();
}
);
});
1
TypeScript
CWE-88
Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
The software constructs a string for a command to executed by a separate component
in another control sphere, but it does not properly delimit the
intended arguments, options, or switches within that command string.
https://cwe.mitre.org/data/definitions/88.html
safe
function validateBaseUrl(url: string) {
// from this MIT-licensed gist: https://gist.github.com/dperini/729294
return /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/78.html
safe
get lokadIdHex() { return "534c5000" }
0
TypeScript
CWE-20
Improper Input Validation
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
Improperly Controlled Modification of Dynamically-Determined Object Attributes
The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.
The software uses a function that accepts a format string as an argument, but the format string originates from an external source.
https://cwe.mitre.org/data/definitions/134.html
safe
connect() {
this.emit('connect');
}
1
TypeScript
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/78.html
safe
.catch(error => {
// There was an error with the session token
const result = {};
if (error && error.code === Parse.Error.INVALID_SESSION_TOKEN) {
// Store a resolved promise with the error for 10 minutes
result.error = error;
this.authCache.set(
sessionToken,
Promise.resolve(result),
60 * 10 * 1000
);
} else {
0
TypeScript
CWE-672
Operation on a Resource after Expiration or Release
The software uses, accesses, or otherwise operates on a resource after that resource has been expired, released, or revoked.
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
vulnerable
static buildMintOpReturn(config: configBuildMintOpReturn, type = 0x01) {
return SlpTokenType1.buildMintOpReturn(
config.tokenIdHex,
config.batonVout,
config.mintQuantity,
type
)
}
0
TypeScript
CWE-20
Improper Input Validation
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
https://cwe.mitre.org/data/definitions/20.html
vulnerable
ctx.prompt(prompt, function retryPrompt(answers) {
if (answers.length === 0)
return ctx.reject(['keyboard-interactive']);
nick = answers[0];
if (nick.length > MAX_NAME_LEN) {
return ctx.prompt(`That nickname is too long.\n${PROMPT_NAME}`,
retryPrompt);
} else if (nick.length === 0) {
return ctx.prompt(`A nickname is required.\n${PROMPT_NAME}`,
retryPrompt);
}
lowered = nick.toLowerCase();
for (const user of users) {
if (user.name.toLowerCase() === lowered) {
return ctx.prompt(`That nickname is already in use.\n${PROMPT_NAME}`,
retryPrompt);
}
}
name = nick;
ctx.accept();
});
1
TypeScript
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
https://cwe.mitre.org/data/definitions/20.html
safe
function genOpenSSLECDSAPub(oid, Q) {
const asnWriter = new Ber.Writer();
asnWriter.startSequence();
// algorithm
asnWriter.startSequence();
asnWriter.writeOID('1.2.840.10045.2.1'); // id-ecPublicKey
// algorithm parameters (namedCurve)
asnWriter.writeOID(oid);
asnWriter.endSequence();
// subjectPublicKey
asnWriter.startSequence(Ber.BitString);
asnWriter.writeByte(0x00);
// XXX: hack to write a raw buffer without a tag -- yuck
asnWriter._ensure(Q.length);
asnWriter._buf.set(Q, asnWriter._offset);
asnWriter._offset += Q.length;
// end hack
asnWriter.endSequence();
asnWriter.endSequence();
return makePEM('PUBLIC', asnWriter.buffer);
}
1
TypeScript
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/78.html
safe
objectKeys(data).forEach((key) => {
obj.set(key, ctx.next(data[key]) as T);
});
1
TypeScript
CWE-915
Improperly Controlled Modification of Dynamically-Determined Object Attributes
The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/78.html
safe
constructor() { }
1
TypeScript
CWE-295
Improper Certificate Validation
The software does not validate, or incorrectly validates, a certificate.
Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
The software constructs a string for a command to executed by a separate component
in another control sphere, but it does not properly delimit the
intended arguments, options, or switches within that command string.
https://cwe.mitre.org/data/definitions/88.html
vulnerable
constructor(options?: { signatureLength?: number }) {
super();
this.id = "";
this._tick0 = 0;
this._tick1 = 0;
this._hasReceivedError = false;
this.blocks = [];
this.messageChunks = [];
this._expectedChannelId = 0;
options = options || {};
this.signatureLength = options.signatureLength || 0;
this.options = options;
this._packetAssembler = new PacketAssembler({
minimumSizeInBytes: 0,
readMessageFunc: readRawMessageHeader
});
this._packetAssembler.on("message", (messageChunk) => this._feed_messageChunk(messageChunk));
this._packetAssembler.on("newMessage", (info, data) => {
if (doPerfMonitoring) {
// record tick 0: when the first data is received
this._tick0 = get_clock_tick();
}
/**
*
* notify the observers that a new message is being built
* @event start_chunk
* @param info
* @param data
*/
this.emit("start_chunk", info, data);
});
this._securityDefeated = false;
this.totalBodySize = 0;
this.totalMessageSize = 0;
this.channelId = 0;
this.offsetBodyStart = 0;
this.sequenceHeader = null;
this._init_new();
}
0
TypeScript
CWE-400
Uncontrolled Resource Consumption
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly.
https://cwe.mitre.org/data/definitions/20.html
vulnerable
public static IESParameterSpec guessParameterSpec(BufferedBlockCipher iesBlockCipher, byte[] nonce)
{
if (iesBlockCipher == null)
{
return new IESParameterSpec(null, null, 128);
}
else
{
BlockCipher underlyingCipher = iesBlockCipher.getUnderlyingCipher();
if (underlyingCipher.getAlgorithmName().equals("DES") ||
underlyingCipher.getAlgorithmName().equals("RC2") ||
underlyingCipher.getAlgorithmName().equals("RC5-32") ||
underlyingCipher.getAlgorithmName().equals("RC5-64"))
{
return new IESParameterSpec(null, null, 64, 64, nonce);
}
else if (underlyingCipher.getAlgorithmName().equals("SKIPJACK"))
{
return new IESParameterSpec(null, null, 80, 80, nonce);
}
else if (underlyingCipher.getAlgorithmName().equals("GOST28147"))
{
return new IESParameterSpec(null, null, 256, 256, nonce);
}
return new IESParameterSpec(null, null, 128, 128, nonce);
}
}
1
TypeScript
CWE-310
Cryptographic Issues
Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not addressed.
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
safe
schemaTypeOptions = {...schemaTypeOptions, type: getSchema(propertyMetadata.type)};
}
schemaTypeOptions = cleanProps({...schemaTypeOptions, ...rawMongooseSchema});
if (propertyMetadata.isCollection) {
if (propertyMetadata.isArray) {
schemaTypeOptions = [schemaTypeOptions];
} else {
// Can be a Map or a Set;
// Mongoose implements only Map;
if (propertyMetadata.collectionType !== Map) {
throw new Error(`Invalid collection type. ${propertyMetadata.collectionName} is not supported.`);
}
schemaTypeOptions = {type: Map, of: schemaTypeOptions};
}
}
return schemaTypeOptions;
}
0
TypeScript
CWE-915
Improperly Controlled Modification of Dynamically-Determined Object Attributes
The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.
https://cwe.mitre.org/data/definitions/915.html
vulnerable
function showTooltip(target: HTMLElement): () => void {
const tooltip = document.createElement("div");
const isHidden = target.classList.contains("hidden");
if (isHidden) {
target.classList.remove("hidden");
}
tooltip.className = "keyboard-tooltip";
tooltip.innerHTML = target.getAttribute("data-key") || "";
document.body.appendChild(tooltip);
const parentCoords = target.getBoundingClientRect();
// Padded 10px to the left if there is space or centered otherwise
const left =
parentCoords.left +
Math.min((target.offsetWidth - tooltip.offsetWidth) / 2, 10);
const top =
parentCoords.top + (target.offsetHeight - tooltip.offsetHeight) / 2;
tooltip.style.left = `${left}px`;
tooltip.style.top = `${top + window.pageYOffset}px`;
return (): void => {
tooltip.remove();
if (isHidden) {
target.classList.add("hidden");
}
};
}
0
TypeScript
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
function userBroadcast(msg, source) {
var sourceMsg = '> ' + msg;
var name = '{cyan-fg}{bold}' + source.name + '{/}';
msg = ': ' + msg;
for (var i = 0; i < users.length; ++i) {
var user = users[i];
var output = user.output;
if (source === user)
output.add(sourceMsg);
else
output.add(formatMessage(name, output) + msg);
}
}
0
TypeScript
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.
https://cwe.mitre.org/data/definitions/639.html
vulnerable
export async function execRequest(routes: Routers, ctx: AppContext) {
const match = findMatchingRoute(ctx.path, routes);
if (!match) throw new ErrorNotFound();
const endPoint = match.route.findEndPoint(ctx.request.method as HttpMethod, match.subPath.schema);
if (ctx.URL && !isValidOrigin(ctx.URL.origin, baseUrl(endPoint.type), endPoint.type)) throw new ErrorNotFound(`Invalid origin: ${ctx.URL.origin}`, 'invalidOrigin');
// This is a generic catch-all for all private end points - if we
// couldn't get a valid session, we exit now. Individual end points
// might have additional permission checks depending on the action.
if (!match.route.isPublic(match.subPath.schema) && !ctx.joplin.owner) throw new ErrorForbidden();
return endPoint.handler(match.subPath, ctx);
}
0
TypeScript
CWE-352
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
https://cwe.mitre.org/data/definitions/918.html
safe
export default function isSafeRedirect(url: string): boolean {
if (typeof url !== 'string') {
throw new TypeError(`Invalid url: ${url}`);
}
// Prevent open redirects using the //foo.com format (double forward slash).
if (/\/\//.test(url)) {
return false;
}
return !/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(url);
}
0
TypeScript
CWE-601
URL Redirection to Untrusted Site ('Open Redirect')
A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks.
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
ctx.prompt(prompt, function retryPrompt(answers) {
if (answers.length === 0)
return ctx.reject(['keyboard-interactive']);
nick = answers[0];
if (nick.length > MAX_NAME_LEN) {
return ctx.prompt('That nickname is too long.\n' + PROMPT_NAME,
retryPrompt);
} else if (nick.length === 0) {
return ctx.prompt('A nickname is required.\n' + PROMPT_NAME,
retryPrompt);
}
lowered = nick.toLowerCase();
for (var i = 0; i < users.length; ++i) {
if (users[i].name.toLowerCase() === lowered) {
return ctx.prompt('That nickname is already in use.\n' + PROMPT_NAME,
retryPrompt);
}
}
name = nick;
ctx.accept();
});
0
TypeScript
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/78.html
vulnerable
function genRSAASN1Buf(n, e, d, p, q, dmp1, dmq1, iqmp) {
const asnWriter = new Ber.Writer();
asnWriter.startSequence();
asnWriter.writeInt(0x00, Ber.Integer);
asnWriter.writeBuffer(n, Ber.Integer);
asnWriter.writeBuffer(e, Ber.Integer);
asnWriter.writeBuffer(d, Ber.Integer);
asnWriter.writeBuffer(p, Ber.Integer);
asnWriter.writeBuffer(q, Ber.Integer);
asnWriter.writeBuffer(dmp1, Ber.Integer);
asnWriter.writeBuffer(dmq1, Ber.Integer);
asnWriter.writeBuffer(iqmp, Ber.Integer);
asnWriter.endSequence();
return asnWriter.buffer;
}
1
TypeScript
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/78.html
safe
this.transport.init(socket, (err?: Error) => {
if (err) {
callback(err);
} else {
this._rememberClientAddressAndPort();
this.messageChunker.maxMessageSize = this.transport.maxMessageSize;
// bind low level TCP transport to messageBuilder
this.transport.on("message", (messageChunk: Buffer) => {
assert(this.messageBuilder);
this.messageBuilder.feed(messageChunk);
});
debugLog("ServerSecureChannelLayer : Transport layer has been initialized");
debugLog("... now waiting for OpenSecureChannelRequest...");
ServerSecureChannelLayer.registry.register(this);
this._wait_for_open_secure_channel_request(callback, this.timeout);
}
});
0
TypeScript
CWE-400
Uncontrolled Resource Consumption
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
https://cwe.mitre.org/data/definitions/400.html
vulnerable
function extend(...args) {
const to = Object(args[0]);
for (let i = 1; i < args.length; i += 1) {
const nextSource = args[i];
if (nextSource !== undefined && nextSource !== null) {
const keysArray = Object.keys(Object(nextSource));
for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
const nextKey = keysArray[nextIndex];
const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
if (desc !== undefined && desc.enumerable) {
if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
extend(to[nextKey], nextSource[nextKey]);
} else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
to[nextKey] = {};
extend(to[nextKey], nextSource[nextKey]);
} else {
to[nextKey] = nextSource[nextKey];
}
}
}
}
}
return to;
}
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
Improperly Controlled Modification of Dynamically-Determined Object Attributes
The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.
https://cwe.mitre.org/data/definitions/915.html
safe
function spliceOne(list, index) {
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
list[i] = list[k];
list.pop();
}
0
TypeScript
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/78.html
vulnerable
constructor() {
this._zlib = new Zlib(INFLATE);
}
1
TypeScript
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
The software performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions.
https://cwe.mitre.org/data/definitions/863.html
vulnerable
export function orderLinks<T extends NameAndType>(links: T[]) {
const [provided, unknown] = partition<T>(links, isProvided);
return [
...sortBy(provided, link => PROVIDED_TYPES.indexOf(link.type)),
...sortBy(unknown, link => link.name!.toLowerCase())
];
}
0
TypeScript
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.