# Is ngrok safe? What a tunnel exposes, why IT flags it, and how to share safely

November 24, 2026, The Expose team

**Yes, ngrok is safe in the sense most people mean. It is legitimate software from ngrok Inc., not malware.** The risk is what you put behind it. A tunnel gives one port on your machine a public URL, and everything that port serves is open to anyone who has the URL. Security tools flag ngrok because attackers use the same kind of tunnel on computers they have broken into. A flag means "a tunnel is running here". It doesn't mean "this laptop is infected".

Most pages on this topic mix up three questions. This one answers them in turn: is the software legitimate, what does a tunnel expose, and why does IT flag it. After that come a checklist for any tunnel, how to do each step in Expose, and a section for IT and security teams.

We make Expose, a tunnel that competes with ngrok. Everything on this page applies to Expose as well. We read every outside source linked here on November 24, 2026.

## Is ngrok legitimate software?

Yes. The researchers who document how attackers abuse ngrok call it legitimate:

- Sophos's Rapid Response team: "Ngrok is a legitimate remote-access tool."
- MITRE ATT&CK, entry S0508: a "legitimate reverse proxy tool that can create a secure tunnel to servers located behind firewalls".

ngrok's [security page](https://ngrok.com/security) says the company is SOC 2 Type 2 compliant and that "connections from the ngrok CLI and SDKs to the edge use TLS 1.2+". Two more lines on that page tell you what happens to the traffic you send through it:

- "By default, ngrok terminates TLS at the edge." ngrok's servers decrypt HTTPS traffic before they pass it on to your machine.
- "ngrok doesn't store traffic content by default." Full Capture is an option you turn on, and it stores headers and bodies for up to 3 days.

The same page gives part of the job to you: "You're responsible for securing how you use ngrok." That holds for every tunnel. The software can be sound while the app behind it is open to anyone. If you're also asking what ngrok costs, [is ngrok free?](https://expose.dev/blog/is-ngrok-free) covers every limit of the free plan.

## What does a tunnel expose?

A tunnel exposes everything on the port you share, to anyone who has the URL. `ngrok http 3000` and `expose share http://localhost:3000` don't publish one page. They publish every route that the app on port 3000 answers:

- the page you meant to show
- `/admin`, and any other route whose only protection was that the app ran on your laptop
- error pages in debug mode, which can show stack traces, file paths and configuration
- debug tools such as a profiler, a query log or a web console
- API routes that change data, with whatever is in your local database

A TCP tunnel goes further. `ngrok tcp 5432` or `expose share-port 5432` puts a database port on the internet. The database password is then all that stands between a stranger and your data.

### Your app thinks every visitor is local

The tunnel client on your machine forwards each request to your app, so the connection reaches the app from `127.0.0.1`. Code and dev tools that trust local requests can then treat a stranger as you. Before you share, check any setting that grants access by IP address, such as a debug toolbar limited to `127.0.0.1`.

### A random URL is not access control

A free tunnel URL is hard to guess, so it is tempting to treat it as private. It doesn't stay private for long:

- You paste the URL into Slack, an issue or an email, and the chat app fetches it to build a link preview.
- It stays in browser histories, proxy logs and the logs of every service that called it.
- Anyone who gets the link can open it. The tunnel can't tell your client from the person your client forwarded it to.

A random name only makes the URL hard to guess. It doesn't decide who gets in. A password or a login does.

### What a tunnel doesn't expose

A tunnel is narrower than port forwarding. It opens no port on your router. The internet reaches only the port you shared, and only while the tunnel runs. Visitors connect to the tunnel provider's server, not to your IP address. When you stop the command, the URL stops working.

## Why do security tools flag ngrok?

Security tools flag ngrok because attackers use it. A developer starts a tunnel to show a client a preview. Someone who has broken into a computer can start the same tunnel to get back in, with no firewall change. Three sources document this:

- **Sophos.** Sophos's [ngrok incident guide](https://www.sophos.com/en-us/blog/rapid-response-the-ngrok-incident-guide), written by Alexander Giles, draws on two incident response investigations in which attackers brought ngrok onto a network. In one, a scheduled task named `MicrosoftSync` started `C:\Windows\Temp\rk\ngrok.exe` with `tcp 3389`, which put the computer's Remote Desktop port on the internet. In the other, the attacker queried ngrok's local API at `http://127.0.0.1:4040/api/tunnels` and downloaded a file through the tunnel to `C:\tmp\beacon.exe`. Sophos lists why attackers pick it. ngrok is "not classed as malware by default", runs over common open ports, has no file dependencies and is easy to configure.
- **Huntress, March 16, 2021.** In [Abusing Ngrok: Hackers at the End of the Tunnel](https://www.huntress.com/blog/abusing-ngrok-hackers-at-the-end-of-the-tunnel), John Hammond describes ngrok renamed to `conhost.exe` in `C:\ProgramData\WindNT\` and started by a hidden PowerShell command from a VBScript. Its config opened tunnels to Remote Desktop on port 3389, a VNC server on port 6300 and a proxy on port 3128.
- **MITRE ATT&CK.** The [S0508 entry for ngrok](https://attack.mitre.org/software/S0508/), last modified October 16, 2025, lists five threat groups that have used ngrok, among them Scattered Spider and OilRig. It maps ngrok to techniques such as Protocol Tunneling.

None of these reports describes a flaw in ngrok. They describe what a public tunnel does in the wrong hands. That is why the same kind of alert can fire for any tunnel tool, Expose included.

### Developer use or an intrusion?

The cases in the Sophos and Huntress reports look different from a developer at work:

| What you find | Typical developer use | What the Sophos and Huntress reports describe |
| --- | --- | --- |
| Local port | A web app on a port such as 3000, 5173, 8000 or 8080 | Remote Desktop on 3389, VNC on 6300, a proxy on 3128 |
| The program | `ngrok` or `expose` under its own name, installed by the user | ngrok renamed to `conhost.exe`, or run from `C:\Windows\Temp\rk\` |
| How it starts | Typed in a terminal by the developer | A hidden PowerShell command, a scheduled task, a VBScript |
| How long it runs | While the developer works on something | Starts again on its own, so the attacker keeps access |

## A safe-sharing checklist for any tunnel

These steps work for ngrok, Expose, localtunnel, Cloudflare Tunnel and every other tunnel:

1. **Gate the URL.** Put a password or a login in front of anything a person opens. A random URL doesn't count.
2. **Share one app, not the machine's tools.** Never tunnel admin panels, databases, debug consoles, Remote Desktop or SSH. If the app has an admin area, keep it behind its own login.
3. **Turn off debug output and use test data.** A shared dev server should hold nothing you'd mind a stranger reading.
4. **Verify webhook signatures in your handler.** Your webhook route is public as soon as the tunnel is. The signature is how your code tells a real Stripe or GitHub event from a forged one.
5. **Close tunnels when you're done.** A tunnel left running overnight keeps your app public while nobody looks at the requests.
6. **Keep the request inspector local.** It shows every header and body, tokens included.
7. **Stay on your local network when that's enough.** Testing on your own phone doesn't need a public URL.
8. **Use an account your company knows about.** Then IT can see what's running and doesn't have to guess.

## How to do each step in Expose

| Step | In Expose |
| --- | --- |
| Gate the URL with a password | `expose share http://localhost:3000 --basicAuth="user:secret"` |
| Gate the URL with an email login | `expose share http://localhost:3000 --magic-auth=@company.com,client@example.com` |
| Stay on your network | `expose share http://localhost:3000 --lan` |
| Close the tunnel | Stop `expose share`, or click Disconnect on the Active tunnels page |
| Keep the inspector local | The dashboard runs at `http://127.0.0.1:4040` |
| Let a coding agent read requests | The MCP server shows the last 50 requests of a tunnel, without secrets |

### A password: `--basicAuth`

```bash
expose share http://localhost:3000 --basicAuth="user:secret"
```

The browser asks for the username and password before it shows anything. Use it for a client preview or a staging link. It doesn't work on a site that already uses basic authentication.

A webhook provider only gets past the password if it can send those credentials. For a webhook endpoint, rely on the signature instead. See [password protection](https://expose.dev/docs/client/basic-authentication).

### An email login: `--magic-auth`

```bash
expose share http://localhost:3000 --magic-auth=@company.com,client@example.com
```

Visitors see an "Access Required" page that asks for their email address. This command accepts every address at `company.com` and exactly one other address, `client@example.com`. A domain entry matches only that exact domain, so `@company.com` doesn't let in `jane@mail.company.com`. An accepted visitor gets a cookie that lasts 7 days, or until you restart Expose.

Know the limit before you rely on it. Expose doesn't send an email to confirm the address, so it can't check that the visitor owns it. Anyone who knows or guesses an accepted address gets in. Magic authentication limits who you invite. It doesn't prove who they are.

When that matters, pass both flags. Visitors then need the password first and an accepted address after it. See [magic authentication](https://expose.dev/docs/client/magic-authentication).

### Your own network only: `--lan`

```bash
expose share http://localhost:3000 --lan --qr-code
```

`--lan` serves the site from your computer to devices on the same network. There is no tunnel and no Expose server in between. Expose prints a LAN URL such as `http://192.168.1.23:8080`, and `--qr-code` shows it as a QR code for your phone.

Everyone on that network can open the LAN URL, so add `--basicAuth` on shared Wi-Fi. LAN shares use plain HTTP. See [local network sharing](https://expose.dev/docs/client/lan-sharing).

### Close the tunnel when you're done

Stop the `expose share` command, and the public URL stops answering. On the free Hobby plan, each connection also ends after a time limit, and the next connection gets a new random URL. On a team, a teammate can close a tunnel you forgot from the Active tunnels page on expose.dev. The section for IT below describes that page.

### The dashboard stays on your machine

The [request dashboard](https://expose.dev/docs/client/dashboard) runs at `http://127.0.0.1:4040`. That is a loopback address, so only your own computer can open it, and visitors to your public URL can't reach it. The dashboard shows full headers and bodies. That is what you want while you debug, and not what you want on the internet. Expose keeps each site's requests for up to 72 hours, and `expose requests:clear` deletes them.

### Verify webhook signatures in your handler

The Expose dashboard shows every webhook that arrived. Only your handler can decide which ones are real. GitHub, for example, signs each delivery with your webhook secret and sends the result in the `X-Hub-Signature-256` header. A check in Node.js:

```js
import crypto from "node:crypto";

function isFromGitHub(rawBody, signatureHeader, secret) {
  const expected = "sha256=" + crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
  const a = Buffer.from(expected);
  const b = Buffer.from(signatureHeader ?? "");
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}
```

Compute the signature over the raw request body, before any JSON parsing, and reject the request when the check fails. Stripe, Paddle and Shopify sign their webhooks too. The guides for [Stripe](https://expose.dev/docs/guides/stripe-webhooks), [GitHub](https://expose.dev/docs/guides/github-webhooks), [Paddle](https://expose.dev/docs/guides/paddle-webhooks) and [Shopify](https://expose.dev/docs/guides/shopify-webhooks) show where each provider puts its signature.

### Coding agents see requests without secrets

The [Expose MCP server](https://expose.dev/agentic-engineering) lets a coding agent such as Claude Code or Codex read the requests that reached your tunnels, so it can debug a failing webhook for you. Its access is limited:

- The agent sees the last 50 requests of an open tunnel in full for 30 minutes. For tunnels opened with Expose 4, it also sees the method, path, status and sizes of requests for 24 hours, or 72 hours on Pro and Team.
- Expose removes authorization headers, cookies, signatures, secret query values and visitor IP addresses before it stores a request.
- The agent sees only the tunnels you opened, never a teammate's.
- The MCP server tells the agent that request contents come from the public internet and that it must never follow instructions found in them.
- The agent can't open a tunnel or replay a request. Tunnels start with `expose share`.

## For IT and security teams

### What to ask the developer

When you find a tunnel on a laptop, these questions sort normal work from a problem:

1. **Which tool, and whose account?** A personal free account, or one your company pays for.
2. **Which local port, and what runs on it?** A web app on port 3000 is normal. Remote Desktop on 3389 or a database port is not.
3. **Who has the URL, and what's in front of it?** A password, a login, or nothing.
4. **How long has it been running?** An hour while they test a webhook, or since last month.
5. **What data does the app hold?** Test data, or a copy of production.

### Where to look

Sophos's guide lists the places it checks for ngrok on Windows: `ngrok.exe` in process logs with command lines such as `tcp 3389`, DNS lookups of `tunnel.us.ngrok.com`, PowerShell history, Prefetch files, and the `ngrok.yml` file that holds the authtoken.

ngrok's [guide to securing tunnels](https://ngrok.com/docs/gateway/security-dev-productivity/securing-your-tunnels) names the hosts its agent connects to: `connect.ngrok-agent.com` and `tunnel.ngrok.com`, with regional versions such as `connect.eu.ngrok-agent.com`. It says that blocking DNS lookups to those hosts is the fastest way to block ngrok accounts outside your organization.

The Expose client connects to servers at `sharedwithexpose.com` and regional names such as `eu-1.sharedwithexpose.com`. Public URLs on the Expose network end in `sharedwithexpose.com`, unless the account uses its own domain. A self-hosted Expose server uses whatever domain it was set up with.

### See your developers' tunnels with Expose Team

If your developers need tunnels, give them one you can see. On Expose Team, $229 per team per year for up to 10 users, the team owner invites developers to the team. The Active tunnels page on expose.dev then lists every open HTTP tunnel of the team:

- the public URL
- the local site it points to
- the team member who opened it, and when

Any team member can disconnect a tunnel from that page, and the owner can remove a member from the team. Reserved subdomains and custom domains are [shared across the team](https://expose.dev/docs/expose-network/teams), so your URLs stay on names the team controls.

The page has limits:

- It lists tunnels opened with the team's accounts. A developer who signs in to a personal account on a work laptop doesn't appear.
- It lists HTTP tunnels. TCP tunnels started with `expose share-port` aren't on it.
- It shows tunnels that are open now. It isn't a log of who opened what last month.

For how Expose and ngrok compare on plans and features, see [Expose vs ngrok](https://expose.dev/ngrok-alternative).

## Is localtunnel safe?

localtunnel is open-source software under the MIT license, installed from npm. The three answers above apply to it too. Its [README](https://github.com/localtunnel/localtunnel) lists no option for a password or a login, so anyone with the URL can open your app for as long as `lt` runs. Put a login in the app itself, verify webhook signatures and stop `lt` when you're done. For the differences from Expose, see [Expose vs localtunnel](https://expose.dev/localtunnel-alternative).

## Questions

### Can someone hack my computer through an ngrok tunnel?

Only through what you share. A tunnel to port 3000 reaches the app on port 3000. It doesn't reach your files, your other ports or your router. If that app has a hole, the tunnel puts the hole on the internet: an admin route with no login, a debug console that runs code, or a file upload with no checks.

### Does the tunnel provider see my traffic?

With ngrok's default setup, yes. ngrok says it "terminates TLS at the edge". Expose works the same way for HTTP tunnels. The Expose server ends the HTTPS connection and passes each request to your machine. Expose servers keep the last 50 requests of an open tunnel in full for 30 minutes, with credentials and visitor IP addresses removed, so that the MCP server and the Traffic Inspector on expose.dev can show them. If traffic must not pass through a third party, you can run the [open-source Expose server](https://github.com/exposedev/server) on your own infrastructure.

### Is it safe to use a localhost tunnel at work?

Yes, if your company knows about it and you follow the checklist above. To a security team, an unknown tunnel on a work laptop looks like the attacks described above. Ask before you start one. Use the account your company approves, share only the app you're working on, put a login in front of it, and stop the tunnel when you're done.
