# GHSA-J4PJ-2XG4-35F6: TLS query parameters (sslmode, ssl) in clientUrl are ignored, so the connection is not encrypted

- Database: GitHub
- Severity: CVSS 7.4 (High)
- Published: 2026-11-27
- Modified: 2026-11-27

## Affected versions

- @mikro-orm/postgresql (npm): from 7.0.0, through 7.2.12
- @mikro-orm/postgresql (npm): through 6.6.19
- @mikro-orm/mysql (npm): from 7.0.0, through 7.2.12
- @mikro-orm/mysql (npm): through 6.6.19
- @mikro-orm/mariadb (npm): from 7.0.0, through 7.2.12
- @mikro-orm/mariadb (npm): through 6.6.19

## Description

### Impact

The `clientUrl` option (also set via `MIKRO_ORM_CLIENT_URL`) is split into separate connection options (host, port, user, password, database) in the PostgreSQL, MySQL and MariaDB drivers. The query string was not processed apart from the `schema` parameter, so TLS parameters such as `sslmode`, `sslrootcert` or `ssl` had no effect.

A URL like `postgresql://user:password@db.example.com:5432/app?sslmode=verify-full` therefore opened an unencrypted connection, without any warning or error, as long as the database server accepted one. An attacker able to intercept the traffic between the application and the database could read or modify it, including the credentials sent during authentication.

Applications are affected only if all of the following apply:

- the connection is configured via `clientUrl` with TLS parameters in its query string,
- TLS is not configured via `driverOptions`,
- the database server accepts unencrypted connections.

Servers that enforce TLS reject such a connection, so the misconfiguration is visible there right away. The MongoDB and Oracle drivers pass the `clientUrl` to the client as is and are not affected.

### Patches

Fixed in 7.2.13 and 6.6.20. The TLS parameters from `clientUrl` are now mapped to the `ssl` option of the database client: `sslmode`, `ssl`, `sslcert`, `sslkey` and `sslrootcert` in PostgreSQL, and `ssl` in MySQL and MariaDB. In MySQL and MariaDB, the unsupported `sslmode` parameter now throws an error.

After upgrading, a connection that used to be established without encryption will negotiate TLS, and will fail if the server does not support it.

### Workarounds

Configure TLS via `driverOptions`, which takes precedence over the URL:

```ts
MikroORM.init({
  clientUrl: 'postgresql://user:password@db.example.com:5432/app',
  driverOptions: { ssl: true }, // `{ connection: { ssl: true } }` in v6
});
```

Enforcing TLS on the database server also prevents the unencrypted connection.

## References

- https://github.com/mikro-orm/mikro-orm/security/advisories/GHSA-j4pj-2xg4-35f6

Page: https://cve.now/GHSA-J4PJ-2XG4-35F6

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
