Vulnerabilities |
8 via 34 paths |
|---|---|
Dependencies |
608 |
Source |
GitHub |
Find, fix and prevent vulnerabilities in your code.
critical severity
- Vulnerable module: @grpc/grpc-js
- Introduced through: firebase@13.4.0
Detailed paths
-
Introduced through: ndb-core@Aam-Digital/ndb-core › firebase@13.4.0 › @firebase/firestore@4.20.0 › @grpc/grpc-js@1.9.16
-
Introduced through: ndb-core@Aam-Digital/ndb-core › firebase@13.4.0 › @firebase/firestore-compat@0.4.18 › @firebase/firestore@4.20.0 › @grpc/grpc-js@1.9.16
Overview
@grpc/grpc-js is a gRPC Library for Node
Affected versions of this package are vulnerable to Improper Certificate Validation via getAuthContext() in server-interceptors.ts and the TLS session handling in transport.ts, where the authorized property of a TLS socket is not checked before treating the peer as authenticated. An attacker with an unauthorized or invalid TLS certificate can present it to the server and have it accepted as a valid authenticated peer, bypassing mutual TLS authentication and gaining unauthorized access to confidential data or the ability to perform unauthorized operations.
Remediation
Upgrade @grpc/grpc-js to version 1.13.6, 1.14.5 or higher.
References
high severity
- Vulnerable module: moment
- Introduced through: moment@2.29.4
Detailed paths
-
Introduced through: ndb-core@Aam-Digital/ndb-core › moment@2.29.4Remediation: Upgrade to moment@2.31.0.
Overview
moment is a lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates.
Affected versions of this package are vulnerable to Directory Traversal in the locale() function, whose locale name validation is circumvented by a non-string value, so an object can direct the load to an attacker-specified path. An attacker can cause a file to be loaded from a path of their choosing by supplying a non-string value that the application passes to moment.locale(). This requires the application to hand user-supplied non-string input directly to moment.locale(), plain strings are unaffected because the existing validation rejects those containing path separators, and only server-side npm consumers are in scope.
Note: This is a bypass of the fix for the vulnerability described in CVE-2022-24785.
Details
A Directory Traversal attack (also known as path traversal) aims to access files and directories that are stored outside the intended folder. By manipulating files with "dot-dot-slash (../)" sequences and its variations, or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system, including application source code, configuration, and other critical system files.
Directory Traversal vulnerabilities can be generally divided into two types:
- Information Disclosure: Allows the attacker to gain information about the folder structure or read the contents of sensitive files on the system.
st is a module for serving static files on web pages, and contains a vulnerability of this type. In our example, we will serve files from the public route.
If an attacker requests the following URL from our server, it will in turn leak the sensitive private key of the root user.
curl http://localhost:8080/public/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/root/.ssh/id_rsa
Note %2e is the URL encoded version of . (dot).
- Writing arbitrary files: Allows the attacker to create or replace existing files. This type of vulnerability is also known as
Zip-Slip.
One way to achieve this is by using a malicious zip archive that holds path traversal filenames. When each filename in the zip archive gets concatenated to the target extraction folder, without validation, the final path ends up outside 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 malicious 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
Upgrade moment to version 2.31.0 or higher.
References
medium severity
new
- Vulnerable module: minimatch
- Introduced through: serve@14.2.8 and exceljs@4.4.0
Detailed paths
-
Introduced through: ndb-core@Aam-Digital/ndb-core › serve@14.2.8 › serve-handler@6.1.7 › minimatch@3.1.5
-
Introduced through: ndb-core@Aam-Digital/ndb-core › exceljs@4.4.0 › archiver@5.3.2 › archiver-utils@2.1.0 › glob@7.2.3 › minimatch@3.1.5
-
Introduced through: ndb-core@Aam-Digital/ndb-core › exceljs@4.4.0 › archiver@5.3.2 › zip-stream@4.1.1 › archiver-utils@3.0.4 › glob@7.2.3 › minimatch@3.1.5
-
Introduced through: ndb-core@Aam-Digital/ndb-core › exceljs@4.4.0 › unzipper@0.10.14 › fstream@1.0.12 › rimraf@2.7.1 › glob@7.2.3 › minimatch@3.1.5
-
Introduced through: ndb-core@Aam-Digital/ndb-core › exceljs@4.4.0 › archiver@5.3.2 › readdir-glob@1.1.3 › minimatch@5.1.9
Overview
minimatch is a minimal matching utility.
Affected versions of this package are vulnerable to Asymmetric Resource Consumption (Amplification) in the firstPhasePreProcess method, where the **/.. transform clones a globParts entry and pushes the clone back onto the same array inside a do...while (didSomething) fixpoint loop. An attacker can exhaust CPU and memory by supplying a glob pattern whose **/.. sequences regenerate entries during preprocessing, which secondPhasePreProcess then compares in an O(n^2) pairwise partsMatch pass over the expanded set. Exploitation requires the pattern to be parsed with optimizationLevel set to 2 or higher.
Remediation
Upgrade minimatch to version 11.0.1 or higher.
References
medium severity
- Vulnerable module: @grpc/grpc-js
- Introduced through: firebase@13.4.0
Detailed paths
-
Introduced through: ndb-core@Aam-Digital/ndb-core › firebase@13.4.0 › @firebase/firestore@4.20.0 › @grpc/grpc-js@1.9.16
-
Introduced through: ndb-core@Aam-Digital/ndb-core › firebase@13.4.0 › @firebase/firestore-compat@0.4.18 › @firebase/firestore@4.20.0 › @grpc/grpc-js@1.9.16
Overview
@grpc/grpc-js is a gRPC Library for Node
Affected versions of this package are vulnerable to Server-generated Error Message Containing Sensitive Information via the server-side RPC error handler in server.ts, which unconditionally includes the raw exception message in the gRPC status details transmitted to clients. When a server method handler throws an unhandled error, the error message - which may contain internal state, file paths, or other sensitive data - is sent to the remote caller as part of the UNKNOWN status response across all four RPC call types (unary, client-streaming, server-streaming, and bidirectional streaming).
Remediation
Upgrade @grpc/grpc-js to version 1.13.6, 1.14.5 or higher.
References
medium severity
- Vulnerable module: uuid
- Introduced through: exceljs@4.4.0, pouchdb-browser@9.0.0 and others
Detailed paths
-
Introduced through: ndb-core@Aam-Digital/ndb-core › exceljs@4.4.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-browser@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-adapter-indexeddb@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-find@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-adapter-indexeddb@9.0.0 › pouchdb-merge@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-adapter-indexeddb@9.0.0 › pouchdb-adapter-utils@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-find@9.0.0 › pouchdb-selector-core@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-adapter-memory@9.0.0 › pouchdb-adapter-leveldb-core@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-find@9.0.0 › pouchdb-abstract-mapreduce@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-adapter-memory@9.0.0 › pouchdb-adapter-leveldb-core@9.0.0 › pouchdb-core@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-adapter-indexeddb@9.0.0 › pouchdb-adapter-utils@9.0.0 › pouchdb-merge@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-adapter-memory@9.0.0 › pouchdb-adapter-leveldb-core@9.0.0 › pouchdb-merge@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-adapter-memory@9.0.0 › pouchdb-adapter-leveldb-core@9.0.0 › pouchdb-adapter-utils@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-adapter-memory@9.0.0 › pouchdb-adapter-leveldb-core@9.0.0 › pouchdb-core@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-find@9.0.0 › pouchdb-abstract-mapreduce@9.0.0 › pouchdb-mapreduce-utils@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-adapter-memory@9.0.0 › pouchdb-adapter-leveldb-core@9.0.0 › pouchdb-adapter-utils@9.0.0 › pouchdb-merge@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-adapter-memory@9.0.0 › pouchdb-adapter-leveldb-core@9.0.0 › pouchdb-core@9.0.0 › pouchdb-merge@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-adapter-memory@9.0.0 › pouchdb-adapter-leveldb-core@9.0.0 › pouchdb-core@9.0.0 › pouchdb-changes-filter@9.0.0 › pouchdb-utils@9.0.0 › uuid@8.3.2
-
Introduced through: ndb-core@Aam-Digital/ndb-core › pouchdb-adapter-memory@9.0.0 › pouchdb-adapter-leveldb-core@9.0.0 › pouchdb-core@9.0.0 › pouchdb-changes-filter@9.0.0 › pouchdb-selector-core@9.0.0 › pouchdb-utils@9.0.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: exceljs@4.4.0
Detailed paths
-
Introduced through: ndb-core@Aam-Digital/ndb-core › exceljs@4.4.0 › archiver@5.3.2 › archiver-utils@2.1.0 › glob@7.2.3 › inflight@1.0.6
-
Introduced through: ndb-core@Aam-Digital/ndb-core › 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: ndb-core@Aam-Digital/ndb-core › 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
- Vulnerable module: leaflet
- Introduced through: leaflet@1.9.4
Detailed paths
-
Introduced through: ndb-core@Aam-Digital/ndb-core › leaflet@1.9.4
Overview
leaflet is a JavaScript library for mobile-friendly interactive maps
Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the bindPopup method. An attacker can execute arbitrary JavaScript code in the context of a user's browser session by injecting malicious event handler attributes into popup content.
Details
Cross-site scripting (or XSS) is a code vulnerability that occurs when an attacker “injects” a malicious script into an otherwise trusted website. The injected script gets downloaded and executed by the end user’s browser when the user interacts with the compromised website.
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as < and > can be coded as > in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.
The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
Types of attacks
There are a few methods by which XSS can be manipulated:
| Type | Origin | Description |
|---|---|---|
| Stored | Server | The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link. |
| Reflected | Server | The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser. |
| DOM-based | Client | The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data. |
| Mutated | The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters. |
Affected environments
The following environments are susceptible to an XSS attack:
- Web servers
- Application servers
- Web application environments
How to prevent
This section describes the top best practices designed to specifically protect your code:
- Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
- Convert special characters such as
?,&,/,<,>and spaces to their respective HTML or URL encoded equivalents. - Give users the option to disable client-side scripts.
- Redirect invalid requests.
- Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
- Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
- Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.
Remediation
There is no fixed version for leaflet.
References
medium severity
- Vulnerable module: unzipper
- Introduced through: exceljs@4.4.0
Detailed paths
-
Introduced through: ndb-core@Aam-Digital/ndb-core › 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
Upgrade unzipper to version 0.12.5 or higher.