Vulnerabilities |
19 via 28 paths |
|---|---|
Dependencies |
231 |
Source |
GitHub |
Find, fix and prevent vulnerabilities in your code.
critical severity
- Vulnerable module: multer
- Introduced through: multer@1.4.5-lts.2
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.0.1.
Overview
Affected versions of this package are vulnerable to Uncaught Exception in makeMiddleware, when processing a file upload request. An attacker can cause the application to crash by sending a request with a field name containing an empty string.
Remediation
Upgrade multer to version 2.0.1 or higher.
References
high severity
- Vulnerable module: @nestjs/core
- Introduced through: @nestjs/core@10.4.22
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › @nestjs/core@10.4.22Remediation: Upgrade to @nestjs/core@11.1.17.
Overview
@nestjs/core is a Nest - modern, fast, powerful node.js web framework (@core)
Affected versions of this package are vulnerable to Always-Incorrect Control Flow Implementation when handling a @nestjs/platform-fastify HEAD request. An attacker can bypass middleware logic by sending malicious requests, which are redirected to GET handlers by fastify by default.
Remediation
Upgrade @nestjs/core to version 11.1.17 or higher.
References
high severity
- Vulnerable module: file-type
- Introduced through: @nestjs/common@10.4.22
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › @nestjs/common@10.4.22 › file-type@20.4.1Remediation: Upgrade to @nestjs/common@11.0.0.
Overview
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the processing of ZIP-based file type detection via the fileTypeFromBuffer, fileTypeFromBlob, or fileTypeFromFile functions. An attacker can cause excessive memory consumption by submitting a large [Content_Types].xml entry.
Remediation
Upgrade file-type to version 21.3.2 or higher.
References
high severity
- Vulnerable module: multer
- Introduced through: @nestjs/platform-express@10.4.22 and multer@1.4.5-lts.2
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › @nestjs/platform-express@10.4.22 › multer@2.0.2Remediation: Upgrade to @nestjs/platform-express@11.1.15.
-
Introduced through: @numsy/numsy@shreesharma07/numsy › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.1.0.
Overview
Affected versions of this package are vulnerable to Incomplete Cleanup in the makeMiddleware() function in make-middleware.js. An attacker can cause resource exhaustion by sending malformed requests.
Details
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.
Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.
One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.
When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.
Two common types of DoS vulnerabilities:
High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.
Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm
wspackage
Remediation
Upgrade multer to version 2.1.0 or higher.
References
high severity
- Vulnerable module: multer
- Introduced through: multer@1.4.5-lts.2
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.0.0.
Overview
Affected versions of this package are vulnerable to Missing Release of Memory after Effective Lifetime due to improper handling of error events in HTTP request streams, which fails to close the internal busboy stream. An attacker can cause a denial of service by repeatedly triggering errors in file upload streams, leading to resource exhaustion and memory leaks.
Note:
This is only exploitable if the server is handling file uploads.
Remediation
Upgrade multer to version 2.0.0 or higher.
References
high severity
- Vulnerable module: multer
- Introduced through: @nestjs/platform-express@10.4.22 and multer@1.4.5-lts.2
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › @nestjs/platform-express@10.4.22 › multer@2.0.2Remediation: Upgrade to @nestjs/platform-express@11.1.15.
-
Introduced through: @numsy/numsy@shreesharma07/numsy › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.1.0.
Overview
Affected versions of this package are vulnerable to Missing Release of Resource after Effective Lifetime in the makeMiddleware() function, when dropping a connection during file upload. An attacker can cause resource exhaustion.
Details
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.
Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.
One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.
When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.
Two common types of DoS vulnerabilities:
High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.
Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm
wspackage
Remediation
Upgrade multer to version 2.1.0 or higher.
References
high severity
- Vulnerable module: multer
- Introduced through: multer@1.4.5-lts.2
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.0.0.
Overview
Affected versions of this package are vulnerable to Uncaught Exception due to an error event thrown by busboy. An attacker can cause a full nodejs application to crash by sending a specially crafted multi-part upload request.
PoC
const express = require('express')
const multer = require('multer')
const http = require('http')
const upload = multer({ dest: 'uploads/' })
const port = 8888
const app = express()
app.post('/upload', upload.single('file'), function (req, res) {
res.send({})
})
app.listen(port, () => {
console.log(`Listening on port ${port}`)
const boundary = 'AaB03x'
const body = [
'--' + boundary,
'Content-Disposition: form-data; name="file"; filename="test.txt"',
'Content-Type: text/plain',
'',
'test without end boundary'
].join('\r\n')
const options = {
hostname: 'localhost',
port,
path: '/upload',
method: 'POST',
headers: {
'content-type': 'multipart/form-data; boundary=' + boundary,
'content-length': body.length,
}
}
const req = http.request(options, (res) => {
console.log(res.statusCode)
})
req.on('error', (err) => {
console.error(err)
})
req.write(body)
req.end()
})
Remediation
Upgrade multer to version 2.0.0 or higher.
References
high severity
- Vulnerable module: multer
- Introduced through: multer@1.4.5-lts.2
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.0.2.
Overview
Affected versions of this package are vulnerable to Uncaught Exception due to improper handling of multipart requests. An attacker can cause the application to crash by sending a specially crafted malformed multi-part upload request that triggers an unhandled exception.
Remediation
Upgrade multer to version 2.0.2 or higher.
References
high severity
- Vulnerable module: multer
- Introduced through: @nestjs/platform-express@10.4.22 and multer@1.4.5-lts.2
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › @nestjs/platform-express@10.4.22 › multer@2.0.2Remediation: Upgrade to @nestjs/platform-express@11.1.16.
-
Introduced through: @numsy/numsy@shreesharma07/numsy › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.1.1.
Overview
Affected versions of this package are vulnerable to Uncontrolled Recursion. An attacker can cause the application to crash or become unresponsive by sending malformed requests that trigger uncontrolled recursion, potentially leading to a stack overflow.
Remediation
Upgrade multer to version 2.1.1 or higher.
References
high severity
- Vulnerable module: multer
- Introduced through: @nestjs/platform-express@10.4.22 and multer@1.4.5-lts.2
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › @nestjs/platform-express@10.4.22 › multer@2.0.2Remediation: Upgrade to @nestjs/platform-express@11.1.28.
-
Introduced through: @numsy/numsy@shreesharma07/numsy › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.2.0.
Overview
Affected versions of this package are vulnerable to Uncontrolled Recursion via deeply nested field names in multipart form data. An attacker can exhaust CPU and memory resources by sending a single HTTP request with a crafted multipart body containing excessively nested field names.
Workaround
This vulnerability can be mitigated by setting the limits.fields option to a reasonable value to reduce the number of fields an attacker can send per request. This does not fully mitigate the issue but limits the impact.
Remediation
Upgrade multer to version 2.2.0, 3.0.0-alpha.2 or higher.
References
medium severity
- Vulnerable module: file-type
- Introduced through: @nestjs/common@10.4.22
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › @nestjs/common@10.4.22 › file-type@20.4.1Remediation: Upgrade to @nestjs/common@11.0.0.
Overview
Affected versions of this package are vulnerable to Infinite loop in the FileTypeParser class. This is triggered when the ASF (WMV/WMA) parser receives input including an ASF sub-header with a size value of 0. An attacker can interrupt service with a 55-byte payload.
Remediation
Upgrade file-type to version 21.3.1 or higher.
References
medium severity
- Vulnerable module: multer
- Introduced through: @nestjs/platform-express@10.4.22
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › @nestjs/platform-express@10.4.22 › multer@2.0.2Remediation: Upgrade to @nestjs/platform-express@11.1.28.
Overview
Affected versions of this package are vulnerable to Incomplete Cleanup in the diskStorage function. An attacker can exhaust disk space by repeatedly initiating and aborting multipart uploads, causing orphaned partial files to accumulate on disk.
Remediation
Upgrade multer to version 2.2.0, 3.0.0-alpha.2 or higher.
References
medium severity
- Vulnerable module: path-to-regexp
- Introduced through: @nestjs/serve-static@4.0.2
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › @nestjs/serve-static@4.0.2 › path-to-regexp@0.2.5Remediation: Upgrade to @nestjs/serve-static@5.0.0.
Overview
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) when including multiple regular expression parameters in a single segment, which will produce the regular expression /^\/([^\/]+?)-([^\/]+?)\/?$/, if two parameters within a single segment are separated by a character other than a / or .. Poor performance will block the event loop and can lead to a DoS.
Note:
While the 8.0.0 release has completely eliminated the vulnerable functionality, prior versions that have received the patch to mitigate backtracking may still be vulnerable if custom regular expressions are used. So it is strongly recommended for regular expression input to be controlled to avoid malicious performance degradation in those versions. This behavior is enforced as of version 7.1.0 via the strict option, which returns an error if a dangerous regular expression is detected.
Workaround
This vulnerability can be avoided by using a custom regular expression for parameters after the first in a segment, which excludes - and /.
PoC
/a${'-a'.repeat(8_000)}/a
Details
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.
Let’s take the following regular expression as an example:
regex = /A(B|C+)+D/
This regular expression accomplishes the following:
AThe string must start with the letter 'A'(B|C+)+The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the+matches one or more times). The+at the end of this section states that we can look for one or more matches of this section.DFinally, we ensure this section of the string ends with a 'D'
The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD
It most cases, it doesn't take very long for a regex engine to find a match:
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
0.04s user 0.01s system 95% cpu 0.052 total
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
1.79s user 0.02s system 99% cpu 1.812 total
The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.
Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.
Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:
- CCC
- CC+C
- C+CC
- C+C+C.
The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.
From there, the number of steps the engine must use to validate a string just continues to grow.
| String | Number of C's | Number of steps |
|---|---|---|
| ACCCX | 3 | 38 |
| ACCCCX | 4 | 71 |
| ACCCCCX | 5 | 136 |
| ACCCCCCCCCCCCCCX | 14 | 65,553 |
By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.
Remediation
Upgrade path-to-regexp to version 0.1.10, 1.9.0, 3.3.0, 6.3.0, 8.0.0 or higher.
References
medium severity
- Vulnerable module: qs
- Introduced through: @nestjs/platform-express@10.4.22
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › @nestjs/platform-express@10.4.22 › body-parser@1.20.4 › qs@6.14.2Remediation: Upgrade to @nestjs/platform-express@11.0.2.
-
Introduced through: @numsy/numsy@shreesharma07/numsy › @nestjs/platform-express@10.4.22 › express@4.22.1 › qs@6.14.2Remediation: Upgrade to @nestjs/platform-express@11.0.13.
Overview
qs is a querystring parser that supports nesting and arrays, with a depth limit.
Affected versions of this package are vulnerable to NULL Pointer Dereference in the stringify() function, when processing arrays with the options arrayFormat: 'comma' and encodeValuesOnly: true that contain null or undefined elements. An attacker can cause errors by supplying mailcious input that results in these options being used with arrays containing null or undefined values. This only causes a crash if application code makes calls outside a request-handler error boundary (background jobs, startup paths, stream pipelines) or explicitly disables framework error handling.
PoC
const qs = require('qs');
qs.stringify({ a: [null, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true });
qs.stringify({ a: [undefined, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true });
qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true });
Remediation
Upgrade qs to version 6.15.2 or higher.
References
medium severity
- Vulnerable module: @nestjs/core
- Introduced through: @nestjs/core@10.4.22
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › @nestjs/core@10.4.22Remediation: Upgrade to @nestjs/core@11.1.18.
Overview
@nestjs/core is a Nest - modern, fast, powerful node.js web framework (@core)
Affected versions of this package are vulnerable to Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') via the SseStream._transform function. An attacker can inject arbitrary Server-Sent Events, spoof event types, and corrupt reconnection state by supplying specially crafted newline characters in upstream data that is mapped to the type or id fields.
Note:
This is only exploitable if user-influenced data is mapped to these fields by developer code.
Remediation
Upgrade @nestjs/core to version 11.1.18 or higher.
References
medium severity
- Vulnerable module: body-parser
- Introduced through: @nestjs/platform-express@10.4.22
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › @nestjs/platform-express@10.4.22 › body-parser@1.20.4Remediation: Upgrade to @nestjs/platform-express@11.0.2.
Overview
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling due to invalid limit option handling in normalizeOptions in lib/utils.js. An attacker can force oversized request bodies through by supplying an application configuration value for limit that parses to null, such as an unparseable string or NaN. When an app relies on limit to cap body size, the parser skips enforcement and accepts arbitrarily large payloads, driving excessive memory and CPU usage and degrading or crashing the service.
Remediation
Upgrade body-parser to version 1.20.6, 2.3.0 or higher.
References
medium severity
- Vulnerable module: uuid
- Introduced through: exceljs@4.4.0
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › exceljs@4.4.0 › uuid@8.3.2
Overview
uuid is a RFC4122 (v1, v4, and v5) compliant UUID library.
Affected versions of this package are vulnerable to Improper Validation of Specified Index, Position, or Offset in Input due to accepting external output buffers but not rejecting out-of-range writes (small buf or large offset). This inconsistency allows silent partial writes into caller-provided buffers.
PoC
cd /home/StrawHat/uuid
npm ci
npm run build
node --input-type=module -e "
import {v4,v5,v6} from './dist-node/index.js';
const ns='6ba7b810-9dad-11d1-80b4-00c04fd430c8';
for (const [name,fn] of [
['v4',()=>v4({},new Uint8Array(8),4)],
['v5',()=>v5('x',ns,new Uint8Array(8),4)],
['v6',()=>v6({},new Uint8Array(8),4)],
]) {
try { fn(); console.log(name,'NO_THROW'); }
catch(e){ console.log(name,'THREW',e.name); }
}"
Remediation
Upgrade uuid to version 11.1.1, 14.0.0 or higher.
References
medium severity
- Vulnerable module: inflight
- Introduced through: archiver@6.0.2 and exceljs@4.4.0
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › archiver@6.0.2 › archiver-utils@4.0.1 › glob@8.1.0 › inflight@1.0.6
-
Introduced through: @numsy/numsy@shreesharma07/numsy › archiver@6.0.2 › zip-stream@5.0.2 › archiver-utils@4.0.1 › glob@8.1.0 › inflight@1.0.6
-
Introduced through: @numsy/numsy@shreesharma07/numsy › exceljs@4.4.0 › archiver@5.3.2 › archiver-utils@2.1.0 › glob@7.2.3 › inflight@1.0.6
-
Introduced through: @numsy/numsy@shreesharma07/numsy › exceljs@4.4.0 › archiver@5.3.2 › zip-stream@4.1.1 › archiver-utils@3.0.4 › glob@7.2.3 › inflight@1.0.6
-
Introduced through: @numsy/numsy@shreesharma07/numsy › exceljs@4.4.0 › unzipper@0.10.14 › fstream@1.0.12 › rimraf@2.7.1 › glob@7.2.3 › inflight@1.0.6
Overview
Affected versions of this package are vulnerable to Missing Release of Resource after Effective Lifetime via the makeres function due to improperly deleting keys from the reqs object after execution of callbacks. This behavior causes the keys to remain in the reqs object, which leads to resource exhaustion.
Exploiting this vulnerability results in crashing the node process or in the application crash.
Note: This library is not maintained, and currently, there is no fix for this issue. To overcome this vulnerability, several dependent packages have eliminated the use of this library.
To trigger the memory leak, an attacker would need to have the ability to execute or influence the asynchronous operations that use the inflight module within the application. This typically requires access to the internal workings of the server or application, which is not commonly exposed to remote users. Therefore, “Attack vector” is marked as “Local”.
PoC
const inflight = require('inflight');
function testInflight() {
let i = 0;
function scheduleNext() {
let key = `key-${i++}`;
const callback = () => {
};
for (let j = 0; j < 1000000; j++) {
inflight(key, callback);
}
setImmediate(scheduleNext);
}
if (i % 100 === 0) {
console.log(process.memoryUsage());
}
scheduleNext();
}
testInflight();
Remediation
There is no fixed version for inflight.
References
medium severity
new
- Vulnerable module: unzipper
- Introduced through: exceljs@4.4.0
Detailed paths
-
Introduced through: @numsy/numsy@shreesharma07/numsy › exceljs@4.4.0 › unzipper@0.10.14
Overview
unzipper is a library for the Uzip cross-platform streaming AP.I
Affected versions of this package are vulnerable to Arbitrary File Write via Archive Extraction (Zip Slip) in the extraction path validation in lib/extract.js and lib/Open/directory.js, which check only that the resolved path begins with the destination string (extractPath.indexOf(opts.path) != 0) without enforcing a directory-separator boundary. An attacker can write files outside the intended extraction directory, enabling file overwrite or code execution, by supplying a ZIP archive whose entry resolves to a sibling path such as /tmp/dest-evil/escaped.txt that shares the destination's string prefix, which a victim then extracts. Exploitation requires the victim to extract an untrusted archive with unzipper, and it works through sibling-prefix paths since standard ../../ traversal remains blocked.
Note: This is a bypass of the fix for the vulnerability described in CVE-2018-1002203.
Details
It is exploited using a specially crafted zip archive, that holds path traversal filenames. When exploited, a filename in a malicious archive is concatenated to the target extraction directory, which results in the final path ending up outside of the target folder. For instance, a zip may hold a file with a "../../file.exe" location and thus break out of the target folder. If an executable or a configuration file is overwritten with a file containing malicious code, the problem can turn into an arbitrary code execution issue quite easily.
The following is an example of a zip archive with one benign file and one malicious file. Extracting the malicous file will result in traversing out of the target folder, ending up in /root/.ssh/ overwriting the authorized_keys file:
+2018-04-15 22:04:29 ..... 19 19 good.txt
+2018-04-15 22:04:42 ..... 20 20 ../../../../../../root/.ssh/authorized_keys
Remediation
There is no fixed version for unzipper.