SSRF via DNS Rebinding (CVE-2022–4096)
The Appsmith application allowed server-side requests to arbitrary hosts, and a DNS rebinding technique bypassed the host allowlist to reach the AWS metadata endpoint. An attacker could retrieve AWS keys from the metadata service.
Published on basu-banakar.medium.com
Hello everyone myself Basavaraj , Today in this writeup I will explain about my 2nd CVE i.e CVE-2022–4096
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
Appsmith is an open-source platform for building, shipping and maintaining internal tools. The researcher had already found two SSRF issues in Appsmith using a server-side redirection method, and this write-up describes a bypass for those two initial SSRF findings. The bypass abuses DNS rebinding to get past the SSRF restrictions, and it was assigned CVE-2022-4096.

The image is captioned SSRF Overview and sits at the start of the write-up, before the description of the target.
The vulnerable features named in the report are Create new API and Elasticsearch. The report names both as the vulnerable functions.
Setup
The report does not describe accounts, roles or a test environment. The only precondition it states is the affected version range: Appsmith < v1.8.1. The tool used to build the rebinding hostname is the public service at https://lock.cmpxchg8b.com/rebinder.html, and the researcher confirms the resulting DNS answers with dig.
Finding it
The starting point is the two SSRF issues already found through server-side redirection. The report says only that this is a bypass of those two initial SSRF findings.
DNS rebinding is the classic way to do that. The write-up quotes the standard description: a malicious page causes visitors to run a client-side script that attacks machines elsewhere on the network; the same-origin policy is supposed to prevent this because scripts may only access content on the same host that served them, and comparing domain names is an essential part of enforcing that policy, so DNS rebinding circumvents the protection by abusing the Domain Name System.
In this case the same idea is applied to a server-side fetcher rather than a browser: a hostname that resolves to two different IP addresses lets the request pass a host-based restriction on one resolution and then reach an internal address on another.
Exploitation
Step 1: Generate a rebinding hostname
The researcher generates a hostname with the DNS rebinding service:
https://lock.cmpxchg8b.com/rebinder.html

The image is captioned DNS Rebinding and shows the generated hostname from the rebinding tool.
Step 2: Confirm the hostname has two addresses
A dig lookup shows that the generated hostname is assigned two different IP addresses.

The image is captioned Dig command and shows the two answers returned for the hostname. Having two addresses is what makes the bypass work: one resolution can pass the host check, and a later one can point at the internal target.
Step 3: Pick the vulnerable functions
The researcher identifies Create new API and Elasticsearch as the vulnerable functions.

The image is captioned Vulnerable Functions.
Step 4: First attempt is rejected
The generated hostname is put into the URL field of the function and Run is clicked. The response is host not allowed.

The image is captioned Host not allowed response.
Step 5: Run again and reach the metadata path
Running again, the researcher gets a response containing the AWS cloud metadata path.

The image is captioned aws metadata path and shows that response.
Step 6: Append the latest path and get a 404
The latest path is appended to the URL and Run is clicked again. This time the result is 404, because on this attempt the server hit the IP the researcher used in the DNS rebinding rather than the metadata endpoint.

The image is captioned 404 Response and shows that 404.
Step 7: Repeat until the keys come back
By continuous hit and trial, clicking Run again until a response comes back and appending the paths seen in responses to the URL, the researcher successfully retrieves AWS keys.

The image is captioned AWS Keys Retrieved Successfully and shows the retrieved keys. The credentials are not reproduced here.
Root cause
The report frames this as a bypass of the two earlier SSRF fixes rather than a new class of bug. The request is rejected with host not allowed, yet repeated runs sometimes reach the metadata path instead. Because the rebinding hostname has two addresses, the check and the fetch can see different destinations. The write-up's evidence is the alternation between the rejection, the metadata response and the 404 across repeated runs.
The report does not show the validation code, so the exact place where the host is resolved and compared is not stated.
Impact
In the demonstration, a URL configured in Create new API or Elasticsearch made the Appsmith server reach the AWS cloud metadata path and retrieve AWS keys. The technique is not deterministic: some attempts are rejected as host not allowed and some hit the wrong address and return 404, so success depends on repeating the request until a useful response arrives.
Fix
The report gives the vulnerable range as Appsmith < v1.8.1 and does not describe a fix. The researcher reported the issue to Appsmith, received acknowledgement, and then reported it to huntr.dev to obtain the CVE, which was assigned as CVE-2022-4096.
Variants to test
- Any feature that fetches a user-supplied URL. Try a rebinding hostname in each URL field. A positive result is a response that differs from the host restriction, especially one containing internal service output or cloud metadata.
- Host allowlists that resolve names once. If a hostname is accepted at save time and fetched later, check whether the resolution can change in between. A positive result is the same hostname being accepted and then reaching a different address.
- Redirect-based bypasses combined with rebinding. The researcher's earlier findings used server-side redirection; combining a permitted host that redirects with a rebinding name may reach internal targets where either technique alone is blocked.
- Repeated requests against a two-address hostname. Where a single attempt returns a rejection or a 404, repeat the request. A positive result is an occasional successful response from the internal target, as happened here with the metadata path and the appended
latestpath. - Cloud metadata endpoints. When a fetcher can reach link-local addresses, request the metadata path and follow any paths returned in the response. A positive result is credentials or instance information in the body.
What happened, in plain words
Appsmith is a tool for building internal apps: dashboards, admin panels, little forms that talk to other systems. It is open source, and the write-up calls it a platform to build, ship and maintain internal tools. One of the things it can do is take a web address (a URL) that a user types in, and then have the Appsmith server itself go and fetch that address. That is convenient, because the server can reach things your browser cannot, such as services inside a private network.
That same convenience is also a security problem. If the server will fetch any address a user gives it, a user can ask it to fetch addresses that are not meant to be reachable from outside, such as internal admin pages or the cloud provider's metadata service. This kind of bug is called SSRF, server-side request forgery: you forge a request that the server makes on your behalf.
The researcher had already found two SSRF issues in Appsmith by using a server-side redirection method. The report does not say how those two were addressed. This write-up is about a way around that check, using a trick called DNS rebinding. The bypass was assigned CVE-2022-4096, a public identifier for a specific security flaw.

The image is captioned SSRF Overview and sits at the start of the write-up, before the description of the target.
The two features that fetch URLs
The report names two Appsmith features as vulnerable: Create new API and Elasticsearch. The report names both as the vulnerable functions.
An API, in this context, is just a way for one program to ask another program for data over the network, usually with a URL. Elasticsearch is a search and analytics engine that stores data and answers queries over HTTP, so connecting to it also means giving Appsmith a URL.
The idea: DNS rebinding
Every time you type a name like example.com into a browser, something has to translate that name into a numeric address, an IP address, so the computer knows where to send the request. That translation service is DNS, the Domain Name System. Normally a name maps to one address, or to a set of addresses that stay the same.
DNS rebinding abuses the fact that the answer can change. You control a hostname, and you make it answer with one address the first time it is looked up and a different address the next time. A security check that looks up the name once, approves it, and then lets the request go ahead can be fooled: the check sees the harmless address, and the actual request goes to the internal one.
The write-up quotes the standard description of DNS rebinding: a malicious web page causes visitors to run a client-side script that attacks machines elsewhere on the network. In theory, the same-origin policy prevents this: client-side scripts are only allowed to access content on the same host that served the script. Comparing domain names is an essential part of enforcing this policy, so DNS rebinding circumvents this protection by abusing the Domain Name System (DNS).
In this case the same idea is applied to a server-side fetcher rather than a browser: a hostname that resolves to two different IP addresses lets the request pass a host-based restriction on one resolution and then reach an internal address on another.
A useful comparison is a club doorman who checks your name against a guest list, then lets you in, and only afterwards asks where you are going. If you can change your name between the check and the walk to the bar, the check was pointless. Here the "name" is the hostname, and the "walk to the bar" is the server actually connecting to the address.
Setup
The report does not describe accounts, roles or a test environment. The only precondition it states is the affected version range: Appsmith < v1.8.1. The tool used to build the rebinding hostname is the public service at https://lock.cmpxchg8b.com/rebinder.html, and the researcher confirms the resulting DNS answers with dig.
dig is a command-line tool for asking DNS servers questions, a bit like a phone book lookup that shows you the raw answers. You do not need it to follow the story; it is there to prove that the hostname really does return two different addresses.
Finding it
The starting point is the two SSRF issues already found through server-side redirection. Those were presumably blocked by a check on the host being requested, so the question the researcher set out to answer was whether the host check could be satisfied at validation time and then resolve somewhere else at fetch time.
In plain words: the fix probably looked at the hostname in the URL, decided it was fine, and then let the server connect. If the hostname can point at two different places, the check and the connection can disagree. That gap between the moment of checking and the moment of use is called a time-of-check to time-of-use problem, or TOCTOU.
Exploitation
Step 1: Generate a rebinding hostname
The researcher generates a hostname with the DNS rebinding service:
https://lock.cmpxchg8b.com/rebinder.html
The report links this public service for generating the hostname. The point of using it is that you do not need to own a domain or run your own DNS server to demonstrate the attack.

The image is captioned DNS Rebinding and shows the generated hostname from the rebinding tool.
Step 2: Confirm the hostname has two addresses
A dig lookup shows that the generated hostname is assigned two different IP addresses.

The image is captioned Dig command and shows the two answers returned for the hostname. Having two addresses is what makes the bypass work: one resolution can pass the host check, and a later one can point at the internal target.
Think of it as a shop with two doors. The security guard checks the address of the door you say you will use, and it is on the approved list. But the building can swap which door that address refers to before you actually walk through, so you end up inside a room the guard never approved.
Step 3: Pick the vulnerable functions
The researcher identifies Create new API and Elasticsearch as the vulnerable functions.

The image is captioned Vulnerable Functions.
Step 4: First attempt is rejected
The generated hostname is put into the URL field of the function and Run is clicked. The response is host not allowed.

The image is captioned Host not allowed response.
If the request had simply gone through, there would be no bypass to demonstrate, just a plain SSRF. The rejection is the baseline the researcher is trying to get around.
Step 5: Run again and reach the metadata path
Running again, the researcher gets a response containing the AWS cloud metadata path.

The image is captioned aws metadata path and shows that response.
Cloud metadata is a special address that cloud servers can reach from inside, and it hands out information about the server itself, including, in some setups, temporary credentials. It is not meant to be reachable from the public internet, which is why SSRF bugs often aim at it. The researcher did not have to guess a password; the server was simply asked to fetch an address that only the server can reach.
Step 6: Append the latest path and get a 404
The latest path is appended to the URL and Run is clicked again. This time the result is 404, because on this attempt the server hit the IP the researcher used in the DNS rebinding rather than the metadata endpoint.

The image is captioned 404 Response and shows that 404.
A 404 is the standard "not found" answer from a web server. Here it means the request went to the researcher's own address, which had nothing at that path, instead of to the metadata service. That is the two-door problem in action: sometimes you get the approved door, sometimes the other one.
Step 7: Repeat until the keys come back
By continuous hit and trial, clicking Run again until a response comes back and appending the paths seen in responses to the URL, the researcher successfully retrieves AWS keys.

The image is captioned AWS Keys Retrieved Successfully and shows the retrieved keys. The credentials are not reproduced here.
Keys, in this sense, are like a username and password rolled into one string that a program uses to prove who it is to a cloud service. If someone else gets them, they can act as that program.
Root cause
The report frames this as a bypass of the two earlier SSRF fixes rather than a new class of bug. The request is rejected with host not allowed, yet repeated runs sometimes reach the metadata path instead. Because the rebinding hostname has two addresses, the check and the fetch can see different destinations. The write-up's evidence is the alternation between the rejection, the metadata response and the 404 across repeated runs.
Impact
In the demonstration, a URL configured in Create new API or Elasticsearch made the Appsmith server reach the AWS cloud metadata path and retrieve AWS keys. The technique is not deterministic: some attempts are rejected as host not allowed and some hit the wrong address and return 404, so success depends on repeating the request until a useful response arrives.
Fix
The report gives the vulnerable range as Appsmith < v1.8.1 and does not describe a fix. The researcher reported the issue to Appsmith, received acknowledgement, and then reported it to huntr.dev to obtain the CVE, which was assigned as CVE-2022-4096.
Variants to test
- Any feature that fetches a user-supplied URL. Try a rebinding hostname in each URL field. A positive result is a response that differs from the host restriction, especially one containing internal service output or cloud metadata.
- Host allowlists that resolve names once. If a hostname is accepted at save time and fetched later, check whether the resolution can change in between. A positive result is the same hostname being accepted and then reaching a different address.
- Redirect-based bypasses combined with rebinding. The researcher's earlier findings used server-side redirection; combining a permitted host that redirects with a rebinding name may reach internal targets where either technique alone is blocked.
- Repeated requests against a two-address hostname. Where a single attempt returns a rejection or a 404, repeat the request. A positive result is an occasional successful response from the internal target, as happened here with the metadata path and the appended
latestpath. - Cloud metadata endpoints. When a fetcher can reach link-local addresses, request the metadata path and follow any paths returned in the response. A positive result is credentials or instance information in the body.
Glossary
- API: a way for one program to ask another program for data over a network, usually by sending a request to a URL.
- Appsmith: an open-source platform for building, shipping and maintaining internal tools.
- AWS: Amazon Web Services, a cloud provider whose servers can be reached from inside their own network.
- Cloud metadata: a special internal address on a cloud server that returns information about the server, sometimes including temporary credentials.
- CVE: a public identifier for a specific security vulnerability, such as CVE-2022-4096.
- dig: a command-line tool that asks DNS servers for the address behind a hostname and shows the raw answers.
- DNS: the Domain Name System, the service that translates names like
example.cominto numeric IP addresses. - DNS rebinding: a technique where a hostname you control answers with different IP addresses at different times, so a check and a later connection can see different destinations.
- Elasticsearch: a search and analytics engine that stores data and answers queries over HTTP.
- Host: the name part of a URL, such as
example.com, which identifies the server being contacted. - Host not allowed: the error message shown when Appsmith's host restriction rejects a URL.
- HTTP 404: the standard "not found" response from a web server when the requested path does not exist.
- IP address: a numeric address that identifies a machine on a network.
- Same-origin policy: a browser rule that scripts from one site may only read content from the same site, enforced partly by comparing domain names.
- SSRF: server-side request forgery, a bug where an attacker can make a server send requests to addresses the attacker cannot reach directly.
- Time-of-check to time-of-use (TOCTOU): a class of bug where something is checked at one moment and used at another, and it can change in between.
- URL: a web address, such as
https://example.com/path.