code
stringlengths
12
2.05k
label
int64
0
1
programming_language
stringclasses
9 values
cwe_id
stringlengths
6
14
cwe_name
stringlengths
5
103
description
stringlengths
36
1.23k
url
stringlengths
36
48
label_name
stringclasses
2 values
get lokadIdHex() { return "534c5000"; }
1
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
safe
function buildBinary(isDownloaded) { var buildString = "node-gyp configure build --IBM_DB_HOME=\"$IBM_DB_HOME\""; if(isDownloaded) { buildString = buildString + " --IS_DOWNLOADED=true"; } else { buildString = buildString + " --IS_DOWNLOADED=false"; } ...
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 address...
https://cwe.mitre.org/data/definitions/310.html
safe
function addNumericalSeparator(val) { let res = ''; let i = val.length; const start = val[0] === '-' ? 1 : 0; for (; i >= start + 4; i -= 3) res = `_${val.slice(i - 3, i)}${res}`; return `${val.slice(0, i)}${res}`; }
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
constructor(options?: MessageChunkerOptions) { options = options || {}; this.sequenceNumberGenerator = new SequenceNumberGenerator(); this.maxMessageSize = options.maxMessageSize || 16 *1024*1024; this.update(options); }
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
closeSocket() { if (this.dataSocket) { const socket = this.dataSocket; this.dataSocket.end(() => socket && socket.destroy()); this.dataSocket = null; } }
1
TypeScript
CWE-918
Server-Side Request Forgery (SSRF)
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
getDownloadUrl(fileId, accessToken) { return `${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/` + `file/download?fileId=${fileId}&accessToken=${accessToken}`; }
0
TypeScript
CWE-639
Authorization Bypass Through User-Controlled Key
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
handler: function ({log} = {}) { if (!this.server.options.pasv_url) { return this.reply(502); } this.connector = new PassiveConnector(this); return this.connector.setupServer() .then((server) => { let address = this.server.options.pasv_url; // Allow connecting from local i...
0
TypeScript
CWE-918
Server-Side Request Forgery (SSRF)
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
vulnerable
postUrl = `${config().baseUrl}/users/${user.id}`; } const subscription = !isNew ? await ctx.joplin.models.subscription().byUserId(userId) : null; const view: View = defaultView('user', 'Profile'); view.content.user = user; view.content.isNew = isNew; view.content.buttonTitle = isNew ? 'Create user' : 'Update ...
1
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.
https://cwe.mitre.org/data/definitions/352.html
safe
let Q = async A => { A };
1
TypeScript
CWE-119
Improper Restriction of Operations within the Bounds of a Memory Buffer
The software performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer.
https://cwe.mitre.org/data/definitions/119.html
safe
readByte: () => { if (buffer && pos < buffer.length) return buffer[pos++]; },
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
getDownloadUrl(file) { return this.importExport.getDownloadUrl(file.id, file.accessToken); },
0
TypeScript
CWE-639
Authorization Bypass Through User-Controlled Key
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 function escape_attribute_value(value) { return typeof value === 'string' ? escape(value, true) : value; }
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 OpenSSH_Public(type, comment, pubPEM, pubSSH, algo) { this.type = type; this.comment = comment; this[SYM_PRIV_PEM] = null; this[SYM_PUB_PEM] = pubPEM; this[SYM_PUB_SSH] = pubSSH; this[SYM_HASH_ALGO] = algo; this[SYM_DECRYPTED] = false; }
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 genOpenSSLECDSAPriv(oid, pub, priv) { const asnWriter = new Ber.Writer(); asnWriter.startSequence(); // version asnWriter.writeInt(0x01, Ber.Integer); // privateKey asnWriter.writeBuffer(priv, Ber.OctetString); // parameters (optional) asnWriter.startSequence(0xA0); asnWriter....
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
([ key, value ]) => ({ [key]: spawn.bind(null, `show -s --format=%${value}`) }), ),
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
ivLen: (ivLen !== 0 || (flags & CIPHER_STREAM) ? ivLen : blockLen), authLen, discardLen, stream: !!(flags & CIPHER_STREAM), };
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
export async function recursiveReadDir(dir: string): Promise<string[]> { const subdirs = await readdir(dir); const files = await Promise.all( subdirs.map(async subdir => { const res = resolve(dir, subdir); return (await stat(res)).isDirectory() ? recursiveReadDir(res) : [res]; }), ); return ...
0
TypeScript
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
vulnerable
TEST_F(AsStringGraphTest, FillWithChar1) { TF_ASSERT_OK(Init(DT_INT64, /*fill=*/"-", /*width=*/4)); AddInputFromArray<int64>(TensorShape({3}), {-42, 0, 42}); TF_ASSERT_OK(RunOpKernel()); Tensor expected(allocator(), DT_STRING, TensorShape({3})); test::FillValues<tstring>(&expected, {"-42 ", "0 ", "42 "});...
1
TypeScript
CWE-134
Use of Externally-Controlled Format String
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
'hmac-sha2-512-96': info('sha512', 64, 12, false), }; })();
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 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; } ...
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
this.serversUpdatedListener = ({ servers }) => { // Update status log line with new `garden dashboard` server, if any for (const { host, command } of servers) { if (command === "dashboard") { this.showUrl(host) return } } // No active explicit dashboard p...
0
TypeScript
CWE-306
Missing Authentication for Critical Function
The software does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.
https://cwe.mitre.org/data/definitions/306.html
vulnerable
async function validateSPLTokenTransfer( message: Message, meta: ConfirmedTransactionMeta, recipient: Recipient, splToken: SPLToken ): Promise<[BigNumber, BigNumber]> { const recipientATA = await getAssociatedTokenAddress(splToken, recipient); const accountIndex = message.accountKeys.findIndex((...
0
TypeScript
CWE-670
Always-Incorrect Control Flow Implementation
The code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated.
https://cwe.mitre.org/data/definitions/670.html
vulnerable
return function sign(data, algo) { const pem = this[SYM_PRIV_PEM]; if (pem === null) return new Error('No private key available'); if (!algo || typeof algo !== 'string') algo = this[SYM_HASH_ALGO]; try { return sign_(algo, data, pem); } catch (...
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
return new Error(errMsg); } privPEM = makePEM('EC PRIVATE', privBlob); const pubBlob = genOpenSSLECDSAPubFromPriv(ecSSLName, ecPriv); pubPEM = genOpenSSLECDSAPub(ecOID, pubBlob); pubSSH = genOpenSSHECDSAPub(ecOID, pubBlob); break; } return new OpenSSH_O...
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
constructor(env?: NodeJS.ProcessEnv) { if (!env) { env = process.env; } // Enable config file if (env.config) { const configFile = path.resolve(process.cwd(), env.config); confinit.applyConfigFile(this, configFile); } // Enable environment variables confinit.applyEnvVariables(this, process.env,...
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.
https://cwe.mitre.org/data/definitions/915.html
safe
userPassword: bcrypt.hashSync(req.body.userPassword, 10), isAdmin: isAdmin }; // check for existing user db.users.findOne({'userEmail': req.body.userEmail}, (err, user) => { if(user){ // user already exists with that email address console.error(colors.red('Fa...
0
TypeScript
CWE-732
Incorrect Permission Assignment for Critical Resource
The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.
https://cwe.mitre.org/data/definitions/732.html
vulnerable
WebContents.prototype.sendToFrame = function (frame, channel, ...args) { if (typeof channel !== 'string') { throw new Error('Missing required channel argument'); } else if (!(typeof frame === 'number' || Array.isArray(frame))) { throw new Error('Missing required frame argument (must be number or array)'); ...
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.
https://cwe.mitre.org/data/definitions/668.html
safe
body: JSON.stringify({ ...keys, _method: 'POST', email: 'someemail@somedomain.com', }), }); await this.user.fetch({ useMasterKey: true }); const passwordResetResponse = await request({ url: `${serverURL}/apps/test/request_password_reset?username=so...
1
TypeScript
CWE-863
Incorrect Authorization
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
safe
function simulateOpenSecureChannel(callback: SimpleCallback) { clientChannel.create("fake://foobar:123", (err?: Error) => { if (param.shouldFailAtClientConnection) { if (!err) { return callback(new Error(" Shoul...
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
provisionCallback: (user, renew, cb) => { cb(null, 'zzz'); } }); xoauth2.getToken(false, function(err, accessToken) { expect(err).to.not.exist; expect(accessToken).to.equal('zzz'); done(); }); });
0
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
vulnerable
function bigIntFromBuffer(buf) { return BigInt(`0x${buf.hexSlice(0, buf.length)}`); }
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 _setPath(document, keyPath, value) { if (!document) { throw new Error('No document was provided.'); } let {indexOfDot, currentKey, remainingKeyPath} = computeStateInformation(keyPath); if (indexOfDot >= 0) { // If there is a '.' in the keyPath, recur on the subdoc and ... ...
1
TypeScript
NVD-CWE-noinfo
null
null
null
safe
readBool: () => { if (buffer && pos < buffer.length) return !!buffer[pos++]; },
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
const filter = obj => { if (!obj) { return; } let protectedFields = classLevelPermissions?.protectedFields || []; if (!client.hasMasterKey && !Array.isArray(protectedFields)) { protectedFields = getDatabaseController(this.config).addProtectedFields( classLevelPermis...
1
TypeScript
CWE-200
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
https://cwe.mitre.org/data/definitions/200.html
safe
const replaceCharactersWithSpaces = (text) => { const re = new RegExp(`[${settings.CHARACTERS_TO_REPLACE_WITH_SPACES}]`, 'g'); const newText = text.replace(re, ' ').trim(); return newText; };
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
export async function git(path: string): Promise<BlameResult> { const blamedLines: { [line: string]: BlamedLine } = {}; const pathToGit: string = await which('git'); const result = execa.sync(pathToGit, ['blame', '-w', path]); result.stdout.split('\n').forEach(line => { if (line !== '') { const blamed...
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 sendResponse(response1: Response) { try { assert(response1 instanceof ResponseClass); if (message.session) { const counterName = ResponseClass.name.replace("Response", ""); message.session.incrementRequestTotalCounter(c...
0
TypeScript
CWE-770
Allocation of Resources Without Limits or Throttling
The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor.
https://cwe.mitre.org/data/definitions/770.html
vulnerable
tooltipText: (c: FormatterContext, d: LineChartDatum) => string;
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
public void testUnwrapDoesntLeaveTarget() throws Exception { File file = File.createTempFile("temp", null); File tmpDir = file.getParentFile(); try { ZipUtil.iterate(badFileBackslashes, new ZipUtil.BackslashUnpacker(tmpDir)); fail(); } catch (ZipException e) { assertTrue(true); ...
1
TypeScript
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
safe
...new Set(utxos.filter((txOut) => { if (txOut.slpTransactionDetails && txOut.slpUtxoJudgement !== SlpUtxoJudgement.UNKNOWN && txOut.slpUtxoJudgement !== SlpUtxoJudgement.UNSUPPORTED_TYPE && txOut.slpUtxoJudgement !== SlpUtxoJudgeme...
1
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
safe
function buildBinary(isDownloaded) { var buildString = "node-gyp configure build --IBM_DB_HOME=\"$IBM_DB_HOME\""; if(isDownloaded) { buildString = buildString + " --IS_DOWNLOADED=true"; } else { buildString = buildString + " --IS_DOWNLOADED=false"; } ...
0
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 address...
https://cwe.mitre.org/data/definitions/310.html
vulnerable
testSplitMaliciousUriUsername() { const uri = 'https://malicious.com\\@test.google.com'; assertEquals('https', utils.getScheme(uri)); assertEquals('malicious.com', utils.getDomain(uri)); assertEquals('malicious.com', utils.getDomainEncoded(uri)); assertNull(utils.getPort(uri)); assertEquals('\...
1
TypeScript
NVD-CWE-noinfo
null
null
null
safe
link: new ApolloLink((operation, forward) => { return forward(operation).map(response => { const context = operation.getContext(); const { response: { headers }, } = context; expect(headers.get('access-control-allow-origin'))....
1
TypeScript
CWE-863
Incorrect Authorization
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
safe
from: db.getServerTitle() + " <" + db.getReturnAddress() + ">", subject: subject, text: text, }; sendEmail(sendOptions); };
0
TypeScript
CWE-287
Improper Authentication
When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct.
https://cwe.mitre.org/data/definitions/287.html
vulnerable
read(data) { return this._zlib.writeSync(data, false); }
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 escapeShellArg(arg) { return arg.replace(/'/g, `'\\''`); }
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
const {type, store = JsonEntityStore.from(type), ...next} = options; const propertiesMap = getPropertiesStores(store); let keys = Object.keys(src); const additionalProperties = propertiesMap.size ? !!store.schema.get("additionalProperties") || options.additionalProperties : true; const out: any = new type(sr...
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
export async function validateTransfer( connection: Connection, signature: TransactionSignature, { recipient, amount, splToken, reference, memo }: ValidateTransferFields, options?: { commitment?: Finality } ): Promise<TransactionResponse> { const response = await connection.getTransaction(signature,...
0
TypeScript
CWE-670
Always-Incorrect Control Flow Implementation
The code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated.
https://cwe.mitre.org/data/definitions/670.html
vulnerable
.catch(error => { // There was an error with the session token const result = {}; if (error && error.code === Parse.Error.INVALID_SESSION_TOKEN) { result.error = error; this.authCache.set( sessionToken, Promise.resolve(result), this.c...
1
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.
https://cwe.mitre.org/data/definitions/672.html
safe
Object.keys(data).forEach((key) => { obj.add(deserializer(data[key], baseType) as T); });
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
export declare function setDeepProperty(obj: { [key: string]: any; }, propertyPath: string, value: any): void; export declare function getDeepProperty(obj: any, propertyPath: string): any;
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.
https://cwe.mitre.org/data/definitions/915.html
safe
Server.loadMyself((anyMe: Me | NU, stuffForMe?: StuffForMe) => { // @ifdef DEBUG // Might happen if there was no weakSessionId, and also, no cookie. dieIf(!anyMe, 'TyE4032SMH57'); // @endif const newMe = anyMe as Me; if (isInSomeEmbCommentsIframe()) { // Tell the embedded comments or emb...
0
TypeScript
CWE-613
Insufficient Session Expiration
According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization."
https://cwe.mitre.org/data/definitions/613.html
vulnerable
function normalizeConfigFile(data: ParsedIniData): ParsedIniData { const map: ParsedIniData = {}; for (const key of Object.keys(data)) { let matches: Array<string> | null; if (key === "default") { map.default = data.default; } else if ((matches = profileKeyRegex.exec(key))) { // eslint-disab...
0
TypeScript
NVD-CWE-noinfo
null
null
null
vulnerable
skip: (n) => { if (buffer && n > 0) pos += n; },
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 bigIntToBuffer(bn) { let hex = bn.toString(16); if ((hex.length & 1) !== 0) { hex = `0${hex}`; } else { const sigbit = hex.charCodeAt(0); // BER/DER integers require leading zero byte to denote a positive value // when first byte >= 0x80 if (sigbit === 56 || (sigbit ...
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
export function addEmailAddresses(userId: UserId, emailAddress: string, success: UserAcctRespHandler) { postJsonSuccess('/-/add-email-address', success, { userId, emailAddress }); }
0
TypeScript
CWE-613
Insufficient Session Expiration
According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization."
https://cwe.mitre.org/data/definitions/613.html
vulnerable
html: html({ url, host, email }), }) },
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
constructor( private readonly ptarmiganService: PtarmiganService, private readonly bitcoinService: BitcoinService, private readonly cacheService: CacheService, private readonly invoicesGateway: InvoicesGateway ) { }
0
TypeScript
CWE-295
Improper Certificate Validation
The software does not validate, or incorrectly validates, a certificate.
https://cwe.mitre.org/data/definitions/295.html
vulnerable
function ivIncrement(iv) { ++iv[11] >>> 8 && ++iv[10] >>> 8 && ++iv[9] >>> 8 && ++iv[8] >>> 8 && ++iv[7] >>> 8 && ++iv[6] >>> 8 && ++iv[5] >>> 8 && ++iv[4] >>> 8; }
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
verifyEmail(req) { const { token, username } = req.query; const appId = req.params.appId; const config = Config.get(appId); if (!config) { this.invalidRequest(); } if (!config.publicServerURL) { return this.missingPublicServerURL(); } if (!token || !username) { ret...
0
TypeScript
CWE-863
Incorrect Authorization
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
function addSockListeners() { if (!accept && !reject) { sock.once('connect', onconnect); sock.on('data', ondata); sock.once('error', onerror); sock.once('close', onclose); } else { var chan; sock.once('connect', function() { chan = accept(); var isDone = fal...
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
func cssGogsMinCssMap() (*asset, error) { bytes, err := cssGogsMinCssMapBytes() if err != nil { return nil, err } info := bindataFileInfo{name: "css/gogs.min.css.map", size: 22926, mode: os.FileMode(0644), modTime: time.Unix(1584214336, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x46, 0x89, 0xb...
0
TypeScript
CWE-281
Improper Preservation of Permissions
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.
https://cwe.mitre.org/data/definitions/281.html
vulnerable
export async function loadFromGit(input: Input): Promise<string | never> { try { return await new Promise((resolve, reject) => { exec(createCommand(input), { encoding: 'utf-8', maxBuffer: 1024 * 1024 * 1024 }, (error, stdout) => { if (error) { reject(error); } else { reso...
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() { super(); this.proc = undefined; this.buffer = null; }
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
timingSafeEquals: (a, b) => { if (a.length !== b.length) { timingSafeEqual_(a, a); return false; } return timingSafeEqual_(a, b); },
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
export function cloneMirrorTask(repo: string | undefined, directory: string | undefined, customArgs: string[]): StringTask<string> { append(customArgs,'--mirror'); return cloneTask(repo, directory, customArgs); }
0
TypeScript
CWE-77
Improper Neutralization of Special Elements used in a Command ('Command Injection')
The software constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/77.html
vulnerable
html: html({ url, host, theme }), }) const failed = result.rejected.concat(result.pending).filter(Boolean) if (failed.length) { throw new Error(`Email(s) (${failed.join(", ")}) could not be sent`) } }, options, } }
0
TypeScript
CWE-863
Incorrect Authorization
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
session: session.fromPartition('about-window'), spellcheck: false, webviewTag: false, }, width: WINDOW_SIZE.WIDTH, }); aboutWindow.setMenuBarVisibility(false); // Prevent any kind of navigation // will-navigate is broken with sandboxed env, intercepting requests inst...
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
function onconnect() { var buf; if (isSigning) { /* byte SSH2_AGENTC_SIGN_REQUEST string key_blob string data uint32 flags */ var p = 9; buf = Buffer.allocUnsafe(4 + 1 + 4 + keylen + 4 + datalen + 4); writeUInt32BE(buf, buf.le...
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
use: path => { useCount++; expect(path).toEqual('somepath'); },
1
TypeScript
CWE-863
Incorrect Authorization
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
safe
static buildGenesisOpReturn(config: configBuildGenesisOpReturn, type = 0x01) { let hash; try { hash = config.hash!.toString('hex') } catch (_) { hash = null } return SlpTokenType1.buildGenesisOpReturn( config.ticker, config.name, ...
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
declare function getSetCookie(cookieName: string, value?: string, options?: any): string; // backw compat, later, do once per file instead (don't want a global 'r'). // // ReactDOMFactories looks like: // // var ReactDOMFactories = { // a: createDOMFactory('a'), // abbr: ... // // function createDOMFactory(type) ...
0
TypeScript
CWE-613
Insufficient Session Expiration
According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization."
https://cwe.mitre.org/data/definitions/613.html
vulnerable
var cleanUrl = function(url) { url = decodeURIComponent(url); while(url.indexOf('..') >= 0) { url = url.replace('..', ''); } return url; };
1
TypeScript
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
safe
_resolvePath(path = '.') { // Unix separators normalize nicer on both unix and win platforms const resolvedPath = path.replace(WIN_SEP_REGEX, '/'); // Join cwd with new path const joinedPath = nodePath.isAbsolute(resolvedPath) ? nodePath.normalize(resolvedPath) : nodePath.join('/', this.c...
1
TypeScript
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
safe
content: Buffer.concat(buffers), mimeType: resp.headers["content-type"] || null, }); });
0
TypeScript
CWE-918
Server-Side Request Forgery (SSRF)
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
vulnerable
([ key, value ]) => ({ [key]: exec.bind(null, value) }), ),
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
export function createCatalogWriteAction() { return createTemplateAction<{ name?: string; entity: Entity }>({ id: 'catalog:write', description: 'Writes the catalog-info.yaml for your template', schema: { input: { type: 'object', properties: { entity: { title: 'E...
0
TypeScript
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
vulnerable
use: (path) => { useCount++; expect(path).toEqual('somepath'); }, }) ).not.toThrow(); expect(useCount).toBeGreaterThan(0); });
0
TypeScript
CWE-863
Incorrect Authorization
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
async resolve(_source, _args, context, queryInfo) { try { const { config, info } = context; return await getUserFromSessionToken( config, info, queryInfo, 'user.', false ); } catch (e) { parseGraphQ...
0
TypeScript
CWE-863
Incorrect Authorization
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
function parseIni(iniData: string): ParsedIniData { const map: ParsedIniData = {}; let currentSection: string | undefined; for (let line of iniData.split(/\r?\n/)) { line = line.split(/(^|\s)[;#]/)[0]; // remove comments const section = line.match(/^\s*\[([^\[\]]+)]\s*$/); if (section) { current...
0
TypeScript
NVD-CWE-noinfo
null
null
null
vulnerable
function setPath(document, keyPath, value) { if (!document) { throw new Error('No document was provided.'); } let {indexOfDot, currentKey, remainingKeyPath} = computeStateInformation(keyPath); // if (currentKey === '__proto__' || currentKey === 'prototype' && Object.prototype.hasOwnProperty.ca...
0
TypeScript
NVD-CWE-noinfo
null
null
null
vulnerable
requestResetPassword(req) { const config = req.config; if (!config) { this.invalidRequest(); } if (!config.publicServerURL) { return this.missingPublicServerURL(); } const { username, token } = req.query; if (!username || !token) { return this.invalidLink(req); } ...
0
TypeScript
CWE-863
Incorrect Authorization
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
function detailedDataTableMapper(entry) { const project = Projects.findOne({ _id: entry.projectId }) const mapping = [project ? project.name : '', dayjs.utc(entry.date).format(getGlobalSetting('dateformat')), entry.task, projectUsers.findOne() ? projectUsers.findOne().users.find((elem) => elem._id === e...
0
TypeScript
CWE-1236
Improper Neutralization of Formula Elements in a CSV File
The software saves user-provided information into a Comma-Separated Value (CSV) file, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as a command when the file is opened by spreadsheet software.
https://cwe.mitre.org/data/definitions/1236.html
vulnerable
get: (path) => { useCount++; expect(path).toEqual('somepath'); },
0
TypeScript
CWE-863
Incorrect Authorization
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
on(eventName: "message", eventHandler: (message: Buffer) => void): this;
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
etsyApiFetch(endpoint, options) { this._assumeField('endpoint', endpoint); return new Promise((resolve, reject) => { const getQueryString = queryString.stringify(this.getOptions(options)); fetch(`${this.apiUrl}${endpoint}?${getQueryString}`) .then(response => EtsyClient._re...
0
TypeScript
CWE-200
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
https://cwe.mitre.org/data/definitions/200.html
vulnerable
var getDefaultObject = function () { return { nested: { thing: { foo: 'bar' }, is: { cool: true } }, dataUndefined: undefined, dataDate: now, dataNumber: 42, dataString: 'foo', dataNull: null, dataBoolean: true }; };
0
TypeScript
CWE-1321
Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
The software receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.
https://cwe.mitre.org/data/definitions/1321.html
vulnerable
export function parse(data: string, params?: IParseConfig): IIniObject { const { delimiter = '=', comment = ';', nothrow = false, autoTyping = true, dataSections = [], } = { ...params }; let typeParser: ICustomTyping; if (typeof autoTyping === 'function') { typeParser = autoTyping; } e...
0
TypeScript
CWE-1321
Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
The software receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.
https://cwe.mitre.org/data/definitions/1321.html
vulnerable
function foo() { var_dump(substr_compare("\x00", "\x00\x00\x00\x00\x00\x00\x00\x00", 0, 65535, false)); }
1
TypeScript
CWE-125
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
https://cwe.mitre.org/data/definitions/125.html
safe
constructor(connection, {root, cwd} = {}) { this.connection = connection; this.cwd = nodePath.normalize(cwd ? nodePath.join(nodePath.sep, cwd) : nodePath.sep); this._root = nodePath.resolve(root || process.cwd()); }
0
TypeScript
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
vulnerable
Object.keys(data).forEach((key) => { obj.set(key, ctx.next(data[key]) as T); });
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
text: () => string ): { destroy: () => void; update: (t: () => string) => void } {
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
@action gotoUrl = (_url) => { let url = (_url || this.nextUrl).trim().replace(/\/+$/, ''); if (!hasProtocol.test(url)) { url = `https://${url}`; } return this.generateToken(url).then(() => { transaction(() => { this.setNextUrl(url); this.setCurrentUrl(this.nextUrl); ...
1
TypeScript
CWE-346
Origin Validation Error
The software does not properly verify that the source of data or communication is valid.
https://cwe.mitre.org/data/definitions/346.html
safe
export function setByKeyPath(obj, keyPath, value) { if (!obj || keyPath === undefined) return; if ('isFrozen' in Object && Object.isFrozen(obj)) return; if (typeof keyPath !== 'string' && 'length' in keyPath) { assert(typeof value !== 'string' && 'length' in value); for (var i = 0, l = keyPa...
0
TypeScript
CWE-1321
Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
The software receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.
https://cwe.mitre.org/data/definitions/1321.html
vulnerable
function applyCommandArgs(configuration, argv) { if (!argv || !argv.length) { return; } argv = argv.slice(2); const parsedArgv = yargs(argv); const argvKeys = Object.keys(parsedArgv); if (!argvKeys.length) { return; } debug("Appling command arguments:", parsedArgv); i...
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 foo() { var_dump(substr_compare("\x00", "\x00\x00\x00\x00\x00\x00\x00\x00", 0, 65535, false)); }
1
TypeScript
CWE-190
Integer Overflow or Wraparound
The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control.
https://cwe.mitre.org/data/definitions/190.html
safe
alloc(payloadSize, force) { return Buffer.allocUnsafe(payloadSize); }
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
Object.keys(req.query as any).length ? validateOrReject(Object.assign(new Validators.Query(), req.query as any), validatorOptions) : null ])
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
function genOpenSSHECDSAPub(oid, Q) { let curveName; switch (oid) { case '1.2.840.10045.3.1.7': // prime256v1/secp256r1 curveName = 'nistp256'; break; case '1.3.132.0.34': // secp384r1 curveName = 'nistp384'; break; case '1.3.132.0.35': // secp521r1 curveN...
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
export function cloneTask(repo: string | undefined, directory: string | undefined, customArgs: string[]): StringTask<string> { const commands = ['clone', ...customArgs]; if (typeof repo === 'string') { commands.push(repo); } if (typeof directory === 'string') { commands.push(directory); } ...
0
TypeScript
CWE-77
Improper Neutralization of Special Elements used in a Command ('Command Injection')
The software constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/77.html
vulnerable