Hacking our way into internal DBs with hardcoded authentication keys
On-premise OpenMetadata deployments with SSO often used the default hardcoded JWT private/public key pair instead of a custom one. An attacker could generate a valid admin JWT and access sensitive data such as database credentials and profiler ingestions.
Published on ophionsecurity.com
Security Disclosures
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
OpenMetadata is an open source metadata platform that supports several authentication formats. Alongside Single-Sign-On (SSO) providers such as Azure, Google and Okta, it supports general authentication and, for bot users such as those used in ingestion pipelines, the generation of API keys. Those API keys are JWTs, signed by a private key. The private key can either be supplied by the company during deployment or be the one packaged by default in the deployment.
To let clients verify those tokens, OpenMetadata publishes the public key for the signing private key through a JSON Web Key (JWK) endpoint at api/v1/config/jwks. A JWK is an industry standard format for telling an audience, tools and so on about the cryptographic key used in an application. Three fields matter most in a JWK: kty, alg and use, which tell a reader the use case of a given key.
The write-up concerns on-premise production deployments of OpenMetadata that use SSO but were not deployed with a custom private/public key pair for JWT validation. One of the vulnerable companies was a significant e-commerce vendor. The vulnerability was reported to that company on 11 January 2023 and fixed on 12 January 2023.
Setup
The researchers deployed a Docker version of OpenMetadata locally. That local deployment is the baseline: it uses a hardcoded private and public key, and its JWK response is what the researchers later compared production instances against. No other tooling, account setup or version information is given in the report.
Finding it
When the researchers deployed the Docker version of OpenMetadata, the JWK endpoint returned the following document:
{"keys":[{"kty":"RSA","kid":"Gb389a-9f76-gdjs-a92j-0242bk94356","n":"[redacted]-N1e6EII9xBabVskXdEOsWY7H-[redacted]-[redacted]-Y3av_CKj-[redacted]-tSjlUc8qMlG1e_kz2_pV-[redacted]=","e":"AQAB","alg":"RS256","use":"sig"}]}
The returned JWK contains information about the public key used to verify the signature in basic authentication's JWT. Reading through the JSON Web Algorithm (JWA) specification, an RSA key is required to carry details such as the N and E parameters. E is the exponent parameter and is returned as a Base64urlUInt value. N is the modulus parameter and contains the modulus value of the RSA public key.
The important observation is that this key pair is hardcoded in a local deployment. OpenMetadata's security documentation recommends using a custom private/public key pair in a production environment, precisely to prevent unauthorised users from generating a session or API token on behalf of the bot users. The default key pair is hardcoded in a local deployment, and OpenMetadata's security documentation recommends replacing it in production.
Exploitation
Step 1: Compare a production JWK with the default one
The researchers investigated a production deployment, the internal instance of an e-commerce project. They requested the same endpoint, api/v1/config/jwks, and found that it returned an identical response to their local deployment. The N modulus parameter, which represents the public key used to verify JWT authentication, was similar to theirs. That means the server was using the default public/private key pair.
Step 2: Forge an admin JWT
Because the private half of that default pair is known, the researchers used the private key pair to generate a valid JWT for the admin user. No request or script for this step is shown in the report; the scanner described below is the public tooling released for it.
Step 3: Use the token
With the JWT, they could log in and access sensitive information such as the database credentials. They could also create profiler ingestions to download sample data, described in the report as #X rows of data, from the database.
Root cause
OpenMetadata ships a default private/public key pair, and the JWK endpoint publishes the matching public key. The security documentation recommends replacing that pair with a custom one in production, but the recommendation is not enforced. When an operator leaves the default in place, the private key is effectively public, so anyone can sign a JWT that the server will accept. The report frames this as a misconfiguration rather than a vulnerability in OpenMetadata itself.
SSO does not mitigate it. Even though the affected on-premise deployments used SSO for authentication, the private/public key pair had not been changed, so it was possible to authenticate and access the API endpoints as an admin. Even though the affected on-premise deployments used SSO, the key pair had not been changed, so it was possible to authenticate and access the API endpoints as an admin.
Impact
An attacker who can reach the JWK endpoint of an instance running the default key pair can forge an admin JWT and act as an administrator through the API. In the observed case that meant reading database credentials and creating profiler ingestions that download sample rows from the database.
The researchers performed a quick analysis of public deployments of OpenMetadata by major companies, comparing the response of api/v1/config/jwks to the default response. They identified that 90% of the on-premise deployments were deployed with the default private and public key pair. In the observed deployments, the key pair had not been replaced, so the default pair was in use.
Fix
The affected e-commerce company fixed the issue on 12 January 2023, one day after the report. The report does not describe the change they made. The general remediation implied by the write-up is to deploy production instances with a custom private/public key pair instead of the packaged default, as OpenMetadata's security documentation already recommends. The researchers also reached out to OpenMetadata and disclosed their findings; OpenMetadata responded quickly and alerted their community about the misconfiguration and the impact of deploying with a default public/private key pair.
Variants to test
The researchers open sourced a simple script that generates a JWT for the admin user and lists the user for a vulnerable instance, available at their public scanners repository. The project is stated to be for educational and security purposes only, with no responsibility accepted for malicious use of the script.

Concrete things to try elsewhere:
- Request the JWK endpoint of a target and compare the returned
n,e,kidandalgvalues against the defaults published with the product's Docker image. A positive result is a modulus matching the default response. - Where the default private key is known, sign a token for a privileged user such as
adminand call an authenticated API endpoint. - Repeat the comparison across many deployments of the same product, as the researchers did, to estimate how widespread the default configuration is.
- Check whether SSO being enabled changes anything about token validation.
What happened, in plain words
A company called OpenMetadata makes a piece of software that organisations install on their own servers. It is a catalogue for data: it keeps track of where databases, tables and other data live, who owns them, and how they are described. Think of it as the index card cabinet for a company's data, rather than the data itself.
People and automated programs need to log in to that catalogue. OpenMetadata offers several ways to do that, including Single Sign-On (SSO), where you log in through a company account such as Azure, Google or Okta, and ordinary username and password login. It also lets automated programs, called bot users, get an API key so they can talk to the software without a human typing a password. Those API keys are a kind of token called a JWT.
A JWT is a small string of text that the server hands out and later checks. The server checks it by looking at a signature on the token. The signature is made with a secret private key, and the server verifies it with a matching public key. If the signature checks out, the server believes the token is genuine and lets the holder in.
Here is the problem. OpenMetadata ships with a default private and public key pair built into the software. OpenMetadata ships with a default private and public key pair built into the software, and its security documentation says organisations should replace it before running in production. The product's own security documentation says organisations should replace this default pair with their own custom pair before running it in production. Many organisations did not.
The researchers found that on real production systems, the public key the server published was the same as the default one. Since they also knew the matching private key, they could create their own tokens that the server would accept, including a token claiming to be the admin user. With that, they could log in as an administrator and reach sensitive information such as database credentials, and they could set up jobs that pull sample rows out of the database.
One of the affected companies was a significant e-commerce vendor. The researchers reported the issue to that company on 11 January 2023, and it was fixed on 12 January 2023. The researchers also told OpenMetadata, which responded quickly and warned its community.
Background: what OpenMetadata is and how login works
OpenMetadata is an open source metadata platform. "Open source" means the underlying code is publicly available for anyone to read and use. "Metadata" means data about data: not the customer records themselves, but the description of which database holds them, what the columns are called, and so on.
To use the platform, you have to prove who you are. OpenMetadata supports several authentication formats:
- Single Sign-On (SSO) through providers such as Azure, Google and Okta. With SSO, you log in once with an account you already have, and that provider vouches for you.
- General authentication, the ordinary kind where the platform itself checks your credentials.
- API keys for bot users, used by automated ingestion pipelines. An ingestion pipeline is a program that regularly pulls information into the catalogue, for example to keep the list of tables up to date. Such a program cannot sit at a keyboard and type a password, so it is given a key instead.
Those API keys are JWTs. A JWT (JSON Web Token) is a compact string that carries some claims, such as "this is the admin user", together with a signature. The signature is produced with a private key. Anyone holding the matching public key can check that the signature is genuine, without being able to produce new signatures themselves.
The private key can either be supplied by the company during deployment, or be the one that comes packaged by default with the software. That choice is the heart of this story.
The endpoint that hands out the public key
For other programs to be able to check tokens, OpenMetadata publishes the public key at a web address, an endpoint, at api/v1/config/jwks. An endpoint is simply a URL that a program can call to get or send something, much like a page you open in a browser, except the answer is usually data rather than a web page.
The format used there is called JWK, JSON Web Key. It is an industry standard way of describing a cryptographic key so that other software can understand it. A JWK document contains fields, and three of them matter most:
kty: the type of key, for example RSA.alg: the algorithm the key is meant to be used with.use: what the key is for, for example signing.
These fields tell a reader what a given key is used for in the application.
Setting up a local copy to compare against
The researchers installed a Docker version of OpenMetadata on their own machine. Docker is a way of packaging software so it runs the same way everywhere, like a shipping container for programs. Running it locally gave them a known baseline: a fresh installation with the default settings, including the hardcoded private and public key.
That baseline is the whole point of the exercise. If you know what a default installation looks like, you can later compare a real company's installation against it and see whether anything was changed. The report does not mention any other tooling, account setup or version numbers.
What the default installation returned
When the researchers opened the JWK endpoint on their local Docker deployment, it returned this document:
{"keys":[{"kty":"RSA","kid":"Gb389a-9f76-gdjs-a92j-0242bk94356","n":"[redacted]-N1e6EII9xBabVskXdEOsWY7H-[redacted]-[redacted]-Y3av_CKj-[redacted]-tSjlUc8qMlG1e_kz2_pV-[redacted]=","e":"AQAB","alg":"RS256","use":"sig"}]}
Line by line, in plain words:
- The outer braces
{ }hold a JSON object, a way of writing structured data as text. JSON is the format most web APIs use to send answers. "keys"is a list, shown by the square brackets[ ]. A server can publish several keys; here there is exactly one."kty":"RSA"says the key type is RSA, a widely used family of cryptographic keys built on large numbers."kid":"Gb389a-9f76-gdjs-a92j-0242bk94356"is the key ID, a label so tools can refer to this particular key."n":"ANl0x260..."is the modulus, a very long number written in a text-safe encoding. It is the main body of the public key."e":"AQAB"is the exponent, a much smaller number that works together with the modulus.AQABis the encoded form of the number 65537, a common choice."alg":"RS256"says the key is meant for the RS256 signing algorithm."use":"sig"says the key is for signatures.
According to the JSON Web Algorithm (JWA) specification, an RSA key must carry details such as the N and E parameters. E is the exponent parameter and is returned as a Base64urlUInt value, a way of writing a number using only characters that are safe inside text and URLs. N is the modulus parameter and contains the modulus value of the RSA public key.
The key observation is that this pair is hardcoded in a local deployment. OpenMetadata's security documentation recommends using a custom private and public key pair in a production environment, precisely to stop unauthorised people from generating a session or API token on behalf of the bot users. Because the default key ships with the software, it is effectively public knowledge: anyone who deploys the Docker image can read it.
Comparing a real company's installation with the default
The researchers then looked at a production deployment: the internal instance of an e-commerce project. "Production" means the system a company actually uses for real work, as opposed to a test copy. They requested the same endpoint, api/v1/config/jwks, and got back an identical response to their local deployment.
Why does that matter? The N modulus parameter represents the public key used to verify JWT authentication. If it is the same as the one from a fresh default installation, then the server is using the default public and private key pair. The company never replaced it.
Creating an admin token
Because the private half of that default pair is known, the researchers could use it to generate a valid JWT for the admin user. In everyday terms: the server checks signatures with a stamp that everyone can see, but the stamp itself is also lying around in the box, so anyone can press it onto a piece of paper and the server will accept it as genuine.
The report does not show a request or script for this step. The scanner described further down is the public tooling that was released for it.
Using the token
With the JWT in hand, the researchers could log in and reach sensitive information such as the database credentials. Credentials here means the usernames and passwords the platform uses to connect to the databases it catalogues. They could also create profiler ingestions to download sample data from the database, described in the report as #X rows of data. A profiler ingestion is a job that inspects a data source and pulls back a sample so the catalogue can describe it.
Why this works at all
OpenMetadata ships a default private and public key pair, and the JWK endpoint publishes the matching public key. The security documentation recommends replacing that pair with a custom one in production, but nothing enforces the recommendation. When an operator leaves the default in place, the private key is effectively public, so anyone can sign a JWT that the server will accept. The report frames this as a misconfiguration, a setting left in an unsafe state, rather than a vulnerability in OpenMetadata itself.
SSO does not help here. Even though the affected on-premise deployments used SSO for authentication, the private and public key pair had not been changed, so it was possible to authenticate and access the API endpoints as an admin. Even though the affected on-premise deployments used SSO for authentication, the key pair had not been changed, so it was possible to authenticate and access the API endpoints as an admin.
How bad it is
An attacker who can reach the JWK endpoint of an instance running the default key pair can forge an admin JWT and act as an administrator through the API. An API is the set of addresses a program can call to read or change things on a server, as opposed to the pages a person clicks through in a browser. In the observed case, that meant reading database credentials and creating profiler ingestions that download sample rows from the database.
The researchers performed a quick analysis of public deployments of OpenMetadata by major companies, comparing the response of api/v1/config/jwks to the default response. They found that 90% of the on-premise deployments were deployed with the default private and public key pair. In the observed deployments, the key pair had not been replaced, so the default pair was in use.
The fix and the disclosure
The affected e-commerce company fixed the issue on 12 January 2023, one day after the report. The general remediation implied by the write-up is to deploy production instances with a custom private and public key pair instead of the packaged default, which is what OpenMetadata's security documentation already recommends.
The researchers also reached out to OpenMetadata and disclosed their findings. OpenMetadata responded quickly and alerted its community about the misconfiguration and the impact of deploying with a default public and private key pair.
A scanner you can look at
The researchers open sourced a simple script that generates a JWT for the admin user and lists the user for a vulnerable instance. It is available at their public scanners repository. The project is stated to be for educational and security purposes only, with no responsibility accepted for malicious use of the script.

Things to try on other systems
- Request the JWK endpoint of a target and compare the returned
n,e,kidandalgvalues against the defaults published with the product's Docker image. A positive result is a modulus matching the default response. - Where the default private key is known, sign a token for a privileged user such as
adminand call an authenticated API endpoint. - Repeat the comparison across many deployments of the same product, as the researchers did, to estimate how widespread the default configuration is.
- Check whether SSO being enabled changes anything about token validation.
Glossary
- API: the set of addresses and rules a program uses to talk to a server, as opposed to the pages a person clicks in a browser.
- API key: a string a program presents to prove its identity, used instead of a password for automated users.
- Authentication: the process of proving who you are to a system.
- Base64urlUInt: a way of writing a number as text using only characters that are safe in URLs and documents.
- Bot user: an account meant for an automated program rather than a person.
- Credentials: the usernames and passwords used to connect to a system or database.
- Docker: a way of packaging software so it runs the same way on any machine.
- Endpoint: a URL that a program can call to get or send data.
- Exponent (E): a small number that, together with the modulus, forms an RSA public key.
- Ingestion pipeline: an automated job that regularly pulls information into a catalogue.
- JWA (JSON Web Algorithm): a specification describing which algorithms and key details are used with JWTs.
- JWK (JSON Web Key): a standard text format for describing a cryptographic key.
- JWKS: a set of JWKs published together, usually at a well-known endpoint.
- JWT (JSON Web Token): a compact signed string carrying claims about who the holder is.
- Misconfiguration: a setting left in an unsafe state, as opposed to a flaw in the code itself.
- Modulus (N): the large number that forms the main body of an RSA public key.
- On-premise: software installed and run on a company's own servers rather than rented from a cloud provider.
- Open source: software whose code is publicly available to read and use.
- Private key: the secret half of a key pair, used to create signatures.
- Production: the system a company actually uses for real work, as opposed to a test copy.
- Profiler ingestion: a job that inspects a data source and pulls back a sample of its data.
- Public key: the shareable half of a key pair, used to check signatures made with the private key.
- RSA: a widely used family of cryptographic keys based on large numbers.
- RS256: a signing algorithm that uses RSA keys together with SHA-256 hashing.
- Signature: a value attached to data that proves it was produced by the holder of a private key.
- Single Sign-On (SSO): logging in once through a provider such as Azure, Google or Okta, which then vouches for you to other systems.
- Token: a string a server issues and later checks to recognise who is making a request.