SSRF via improper validation after DNS name resolution in the link-preview feature
The link-preview feature checked the hostname of a posted URL for local addresses before fetching it, but did not re-check the IP address after DNS resolution. An attacker could point a domain they control at an internal address and have the server fetch it, exposing internal hosts and their responses through the preview.
Originally disclosed on HackerOne
- Disclosed after 8 months
This is a different report from the one I submitted before: #3383079
Summary
In Rocket.Chat version 7.11.0, the link-preview is a feature that displays a preview of a linked page when a link is sent in the chat, and it is enabled by default. On the server side, the hostname of the posted URL is initially checked to see if it is a local IP address. Then if it's a local one, link-preview doesn't work. However, there is no validation of the IP address after DNS resolution. Therefore, By obtaining some domain and pointing it to a local IP address, an attacker can trigger SSRF and access internal hosts that would otherwise be unreachable.
Details
In my test environment, I set up an httpbin server on the same LAN as the Rocket.Chat server to verify whether SSRF was possible. The httpbin server is running at 192.168.100.14:80, and the attacker cannot reach this server directly.
Step 1. An attacker obtains a domain from a domain registration service. In this example, I got " *.conamikan.servegame.com " via https://www.noip.com/ (now disabled).

Step 2. The attacker posts " http://test.conamikan.servegame.com " to any channel or DM. Then the Rocket.Chat server sends a GET request to the httpbin server on the internal network, resulting in SSRF. Additionally, the attacker can view parts of the httpbin server’s web page via the link-preview feature.
PoC
In the attached PoC video (PoC_SSRF_2.mp4), I performed the following three attempts.
・Posting http://example.com Because this is a valid URL, a preview was displayed.
・Posting http://192.168.100.14 Because this is a host on the internal network, the SSRF protection prevented a preview from being displayed.
・Posting http://test.conamikan.servegame.com This domain is associated with the local IP address 192.168.100.14. Rocket.Chat server finally accessed http://192.168.100.14 and displayed a preview.
Impact
Impact
This enables an attacker to reach internal network resources that would normally be inaccessible and to perform network scanning. Because an attacker can receive parts of responses from internal hosts, the risk of data leakage is very high and requires immediate remediation. The same technique can also be used to access cloud services and metadata endpoints, potentially exposing sensitive cloud-side data and credentials, so there is a significant risk of cloud information leakage. To fix this issue, the IP address obtained after DNS resolution must also be validated.
Context
Rocket.Chat is a self-hosted team chat platform. One of its default-on features is link preview: when a user posts a URL in a channel or direct message, the server fetches the linked page and renders a preview of it in the conversation. Because the fetch is performed by the server rather than the client, the feature is a natural SSRF surface: the server may be able to reach hosts that the person posting the link cannot.
The report concerns Rocket.Chat version 7.11.0 and the link-preview feature as shipped in that version. The researcher notes that this is a separate issue from an earlier report, #3383079.
Setup
To test whether the feature could be abused, the researcher built a small lab:
- A Rocket.Chat 7.11.0 server.
- An httpbin server on the same LAN as the Rocket.Chat server, listening at
[redacted]:80. This host is not reachable directly by the attacker. - A domain obtained from a registration service, used to point a public name at the internal address.
The precondition for the attack is simply the ability to post a link in a channel or DM on a server where link preview is enabled, which is the default.
Finding it
The server does perform a check on the hostname of a posted URL before fetching it: if the hostname resolves to a local IP address, link preview is suppressed. That defence is applied to the hostname as supplied, before resolution. What the researcher noticed is that there is no validation of the IP address after DNS resolution. A hostname that looks perfectly ordinary can therefore resolve to an internal address, and the check that ran earlier never sees the internal IP.
Exploitation
Step 1: obtain a domain and point it at the internal host
The attacker registers a domain through a domain registration service. In this example the researcher obtained *.conamikan.servegame.com via https://www.noip.com/ (the report notes the domain is now disabled). The domain is associated with the internal address [redacted].

Step 2: post the link
The attacker posts the following URL to any channel or DM:
http://test.conamikan.servegame.com
The hostname is not a local IP address, so the initial check does not block it. The Rocket.Chat server then resolves it, gets [redacted], and sends a GET request to the httpbin server on the internal network. The result is SSRF: the server makes a request the attacker could not make directly. The attacker can then view parts of the httpbin server's web page through the link-preview rendering in the chat.
PoC: three attempts side by side
The attached video, PoC_SSRF_2.mp4, shows three attempts in sequence:
- Posting
http://example.com. Because this is a valid URL, a preview is displayed. - Posting
http://[redacted]. Because this is a host on the internal network, the SSRF protection prevents a preview from being displayed. - Posting
http://test.conamikan.servegame.com. This domain is associated with the local IP address[redacted]. The Rocket.Chat server accesseshttp://[redacted]and displays a preview.
Root cause
The validation is performed on the hostname of the posted URL before DNS resolution. Once the name is resolved, the resulting IP address is not checked again, so a name that resolves to a private address is fetched anyway. The existing defence checks the hostname before resolution, so it does not catch names that resolve to a local address. The report states the fix directly: the IP address obtained after DNS resolution must also be validated.
Impact
An attacker who can post a link can reach internal network resources that would normally be inaccessible, and can perform network scanning. Because parts of responses from internal hosts are rendered back through the preview, the risk of data leakage is described as very high and as requiring immediate remediation. The same technique can be used to reach cloud services and metadata endpoints, which could expose sensitive cloud-side data and credentials, so there is a significant risk of cloud information leakage. The attack requires only the ability to post a link on a server with link preview enabled, which is the default.
Fix
The report recommends validating the IP address obtained after DNS resolution, in addition to the existing check on the hostname. That would close the gap between the name that is checked and the address that is actually fetched.
- Wildcard DNS to internal ranges. Point a wildcard record at a private address and post several subdomains. A positive result is a preview rendered from the internal host.
- Redirect chains. Post a URL on an external host that redirects to an internal address. A positive result is a preview whose content comes from the internal target, showing that the post-resolution check is missing on redirect hops too.
- Cloud metadata endpoints. Point a domain at the metadata address used by the target's cloud provider and post it. A positive result is preview content containing metadata or credentials.
- DNS rebinding. Serve a name that resolves to a public address at check time and to an internal address at fetch time. A positive result is a preview from the internal host despite a passing initial check.
- IPv6 and alternative encodings. Use names resolving to IPv6 private ranges or to addresses written in unusual forms. A positive result is a preview from an internal host that the literal-IP check would have blocked.
What happened, in plain words
Rocket.Chat is a chat program that a company can run on its own server, rather than using a hosted service. One of its features, turned on by default, is link preview: when someone posts a web address in a channel or a direct message, the Rocket.Chat server itself visits that address, downloads the page, and shows a small preview of it in the conversation.
That is convenient, but it creates a security problem. The server that runs Rocket.Chat often sits inside a private company network, where it can reach other internal machines that people on the internet cannot reach. If an attacker can make the Rocket.Chat server visit an internal address, the server becomes a kind of proxy: the attacker asks the server to fetch something, and the server does it from inside the network. This class of bug is called Server-Side Request Forgery, or SSRF. "Server-side" means the request is made by the server, not by the attacker's browser. "Forgery" means the attacker has tricked the server into making a request it should not have made.
The researcher found that Rocket.Chat version 7.11.0 does check the address a user posts, but only before looking up what that address actually points to. If the posted address is a name (like example.com), the server first checks the name, then later looks up the real numeric address behind it. The check happens too early, so a name that looks harmless but points to an internal machine slips through. The attacker only needs to be able to post a link in a channel or direct message on a server where link preview is enabled, which is the default.
The report notes that this is a different issue from an earlier report, #3383079.
The setup
To test whether the feature could be abused, the researcher built a small lab:
- A Rocket.Chat 7.11.0 server.
- An httpbin server on the same local network (LAN) as the Rocket.Chat server, listening at
[redacted]:80. httpbin is a simple test web service that returns information about the request it receives. This host is not reachable directly by the attacker. - A domain obtained from a registration service, used to point a public name at the internal address.
A LAN is a local network, like the network inside an office or a data centre. Machines on the same LAN can often talk to each other even when the outside world cannot reach them. The precondition for the attack is simply the ability to post a link in a channel or DM on a server where link preview is enabled, which is the default.
Finding it
The server does perform a check on the hostname of a posted URL before fetching it: if the hostname resolves to a local IP address, link preview is suppressed. That defence is applied to the hostname as supplied, before resolution. What the researcher noticed is that there is no validation of the IP address after DNS resolution. A hostname that looks perfectly ordinary can therefore resolve to an internal address, and the check that ran earlier never sees the internal IP.
A hostname is the human-friendly name in a URL, such as example.com. DNS, the Domain Name System, is the internet's phone book: it translates a hostname into a numeric IP address, such as [redacted], which is what computers actually use to connect. "Resolution" is that translation step. A local IP address is one that belongs to a private network, not to the public internet; the 192.168.x.x range is a common example. The check the server performs looks at the text of the hostname before DNS resolution, so it only catches URLs that literally contain a local IP address. It does not catch a name that later resolves to one.
Exploitation
Step 1: obtain a domain and point it at the internal host
The attacker registers a domain through a domain registration service. In this example the researcher obtained *.conamikan.servegame.com via https://www.noip.com/ (the report notes the domain is now disabled). The domain is associated with the internal address [redacted].
A domain is a name you rent, like example.com. A wildcard record, written *.something, means "any subdomain of this name". So *.conamikan.servegame.com covers names like test.conamikan.servegame.com, foo.conamikan.servegame.com, and so on. Pointing the record at an address means telling DNS that this name should resolve to that IP address. Here, the attacker tells DNS that the name resolves to [redacted], the internal httpbin server.

Step 2: post the link
The attacker posts the following URL to any channel or DM:
http://test.conamikan.servegame.com
This is a URL: http is the protocol (the language browsers and servers use to fetch web pages), and test.conamikan.servegame.com is the hostname. The hostname is not a local IP address, so the initial check does not block it. The Rocket.Chat server then resolves it, gets [redacted], and sends a GET request to the httpbin server on the internal network. A GET request is the basic "please give me this page" request that a browser makes when you open a web address. The result is SSRF: the server makes a request the attacker could not make directly. The attacker can then view parts of the httpbin server's web page through the link-preview rendering in the chat.
PoC: three attempts side by side
The attached video, PoC_SSRF_2.mp4, shows three attempts in sequence:
- Posting
http://example.com. Because this is a valid URL, a preview is displayed. - Posting
http://[redacted]. Because this is a host on the internal network, the SSRF protection prevents a preview from being displayed. - Posting
http://test.conamikan.servegame.com. This domain is associated with the local IP address[redacted]. The Rocket.Chat server accesseshttp://[redacted]and displays a preview.
Root cause
The validation is performed on the hostname of the posted URL before DNS resolution. Once the name is resolved, the resulting IP address is not checked again, so a name that resolves to a private address is fetched anyway. The existing defence checks the hostname before resolution, so it does not catch names that resolve to a local address. The report states the fix directly: the IP address obtained after DNS resolution must also be validated.
In everyday terms: the guard checks the label on the parcel, not what is inside. A label that says "public address" passes, even if the parcel actually contains an internal address. The recommended fix is to check the real address after DNS resolution before fetching it.
Impact
An attacker who can post a link can reach internal network resources that would normally be inaccessible, and can perform network scanning. Network scanning means probing many addresses to discover which machines exist and which services they run. Because parts of responses from internal hosts are rendered back through the preview, the risk of data leakage is described as very high and as requiring immediate remediation. The same technique can be used to reach cloud services and metadata endpoints, which could expose sensitive cloud-side data and credentials, so there is a significant risk of cloud information leakage. The attack requires only the ability to post a link on a server with link preview enabled, which is the default.
A metadata endpoint is a special internal web address that cloud providers make available to machines running in their cloud. It returns information about the machine and sometimes temporary credentials. Because it is only reachable from inside the cloud network, an SSRF bug that lets the server fetch internal addresses can also reach it. Credentials are the secrets (like passwords or tokens) that prove identity; if they leak, an attacker can act as the machine or service.
Fix
The report recommends validating the IP address obtained after DNS resolution, in addition to the existing check on the hostname. That would close the gap between the name that is checked and the address that is actually fetched.
- Wildcard DNS to internal ranges. Point a wildcard record at a private address and post several subdomains. A positive result is a preview rendered from the internal host.
- Redirect chains. Post a URL on an external host that redirects to an internal address. A positive result is a preview whose content comes from the internal target, showing that the post-resolution check is missing on redirect hops too. A redirect is when one web address tells the browser (or server) to go to a different address instead.
- Cloud metadata endpoints. Point a domain at the metadata address used by the target's cloud provider and post it. A positive result is preview content containing metadata or credentials.
- DNS rebinding. Serve a name that resolves to a public address at check time and to an internal address at fetch time. A positive result is a preview from the internal host despite a passing initial check. DNS rebinding is a trick where the DNS answer changes between the moment it is checked and the moment it is used.
- IPv6 and alternative encodings. Use names resolving to IPv6 private ranges or to addresses written in unusual forms. A positive result is a preview from an internal host that the literal-IP check would have blocked. IPv6 is the newer version of the internet's addressing system, with longer addresses than the older IPv4.
Glossary
- API: a way for one program to talk to another, like a menu of requests a service accepts.
- Cookie: a small piece of data a website stores in your browser to remember who you are between requests.
- Credentials: secrets such as passwords or tokens that prove your identity to a system.
- DNS: the Domain Name System, the internet's phone book that turns names like
example.cominto numeric IP addresses. - DNS rebinding: a technique where a name resolves to one address when checked and a different address when used.
- Domain: a name you rent, such as
example.com, used to identify a website or service. - GET request: the basic request a browser makes to ask a web server for a page.
- Hostname: the name part of a URL, such as
example.comortest.conamikan.servegame.com. - httpbin: a simple test web service that returns information about the request it receives.
- IP address: a numeric address that identifies a machine on a network, such as
[redacted]. - IPv6: the newer version of the internet's addressing system, with longer addresses than IPv4.
- LAN: a local network, such as the network inside an office or data centre.
- Link preview: a feature that fetches a posted URL and shows a small preview of the page in the chat.
- Local IP address: an IP address on a private network, not directly reachable from the public internet.
- Metadata endpoint: a special internal web address provided by cloud platforms that returns information about the machine, sometimes including credentials.
- Network scanning: probing many addresses to discover which machines exist and which services they run.
- Redirect: when one web address tells the client to go to a different address instead.
- Resolution: the process of turning a hostname into an IP address using DNS.
- Rocket.Chat: a chat platform that organisations can run on their own servers.
- SSRF (Server-Side Request Forgery): a bug where an attacker tricks a server into making a request to a destination the attacker could not reach directly.
- Token: a piece of data used like a temporary password to prove identity or authorise an action.
- URL: a web address, such as
http://example.com. - Wildcard record: a DNS entry written
*.somethingthat covers any subdomain of that name.