An open proxy is a proxy server that anyone on the internet can use, with no authentication and no source IP restriction. The server forwards every incoming request to its target from its own IP address. Scanners probe these ports constantly, and soon strangers' traffic leaves from your address. The trap is that it stays silent: the proxy keeps working and never throws an error. This post covers how an open proxy happens, how to test your server from outside, and the four layers that close it.
How an open proxy happens
A proxy makes two decisions: who can connect, and whose requests it forwards. The bind address and the firewall make the first decision. The proxy's own rules, meaning authentication and access lists, make the second. If both say "everyone", the server is an open proxy.
It usually comes down to a single line. The setup doesn't work, someone copies a "fix" from a forum, the error goes away and the door opens. In common software it looks like this:
| Software | Setting that opens it | Safe equivalent |
|---|---|---|
| Squid | http_access allow all | Allowed network + login, deny all at the end |
| 3proxy | Service with no internal interface | A single address with -i |
| nginx | proxy_pass http://$host without allow/deny | listen 127.0.0.1 and an allow list |
| Apache | Unrestricted ProxyRequests On | Require ip inside <Proxy "*"> |
| Docker | -p 3128:3128 | -p 127.0.0.1:3128:3128 |
Squid's recommended configuration only allows localhost and ends with deny all. The local network rule ships commented out as # http_access allow localnet. The 3proxy documentation is more direct: if no internal interface is given, the proxy behaves like an open proxy.
Docker is a separate trap. According to the Docker documentation, traffic to a published port is routed before ufw rules apply. Port 3128 can look closed in the firewall while the container stays reachable from outside.
One more trap. If a load balancer or another proxy sits in front of the proxy, the server may see connections coming from that layer's internal address. In that case an "allow the local network" rule allows everyone on the internet.
Traffic leaving from your IP
Whoever uses an open proxy reaches the target with your server's address, not their own. The target site, the mail server or the attacked system only sees your IP in its logs.
This traffic is usually:
- Spam. A proxy that opens a
CONNECTtunnel to any port relays to mail servers on port 25. - Login attempts. Stolen password lists are tried against login pages from your address.
- Attack and scan traffic. Port scans and vulnerability probes are logged under your IP.
- Access to internal services. The proxy also forwards requests to the server itself. An admin panel that only listens on
127.0.0.1becomes reachable from outside.
The consequences come in a chain. Abuse complaints reach your hosting provider, and the provider may suspend the server. Your IP lands on blocklists, so your own mail and API calls from that address get rejected too. On a server with a traffic quota, the bill grows. We covered the delisting steps in our IP blacklist post.
This post covers the server owner's side. The risks for someone using another person's open proxy are a separate topic, covered in our post on free proxies.
Testing from outside
An open proxy test means sending a request without a password to your server from another network. A test from the same server or the same office network misleads you, because the rules may already allow local addresses. A laptop on your phone's mobile data or another server is enough. Run this test only on your own server.
In the examples, 203.0.113.10 is an address reserved for documentation. Replace it with your server's IP.
# 1) Plain HTTP request without a password
curl -s -o /dev/null -w "%{http_code}\n" \
-x http://203.0.113.10:3128 http://example.com/
# 2) HTTPS tunnel (CONNECT) without a password
curl -sv -o /dev/null -x http://203.0.113.10:3128 \
https://example.com/ 2>&1 | grep -E "^< HTTP|curl:"
# 3) Tunnel to a port other than 443: port 25 of your own server
curl -sv -m 5 -x http://203.0.113.10:3128 \
-p telnet://203.0.113.10:25 2>&1 | grep -E "^< HTTP|curl:"Read the result with this table:
| What you see | Meaning | Status |
|---|---|---|
200 or page content | The proxy served a stranger | ✗ Open |
407 Proxy Authentication Required | The proxy asks for a password | ✓ Login in place |
403 Forbidden | An access rule refused it | ✓ Rule in place |
curl: (7) or (28) | Port closed or firewall drops it | ✓ Unreachable |
The third command should return 403. If the tunnel opens and the mail server's greeting line arrives, the proxy can relay spam.
Check from inside the server as well. On Linux, ss -tlnp | grep 3128 shows the listening address; on Windows, netstat -ano does the same job. 0.0.0.0:3128 means all interfaces, 127.0.0.1:3128 means only the server itself. If you use Nmap, the http-open-proxy script runs the same check.
Four layers to close it
No single setting closes an open proxy; four layers close it together. If one is forgotten, the others remain as a backup.
- Authentication. The proxy asks for a username and password on every request, otherwise it returns
407. Pick a long password unique to the server. - IP allowlist. The proxy only handles requests from known addresses. Even if the password leaks, a stranger's address is refused.
- Bind address. The proxy listens only on the interface it needs. If you use the proxy alone,
127.0.0.1is enough. - Firewall. The port opens only to allowed addresses, for example
ufw allow from 198.51.100.0/24 to any port 3128 proto tcp. If you use Docker, publish the port on127.0.0.1.
Add two more lines to the proxy's own rules. Limit CONNECT tunnels to port 443. Refuse requests to the server itself and to local addresses; in Squid's recommended configuration the deny to_localhost line does this. A complete Squid file is in our Squid setup guide.
If only you use the proxy, an SSH tunnel is the simplest route. The proxy listens on 127.0.0.1:3128, and you connect from your own machine with ssh -N -L 3128:127.0.0.1:3128 user@203.0.113.10. You enter 127.0.0.1:3128 in the browser, and the port never opens to the internet.
If you set up the server only for a fixed exit IP, weigh the maintenance load. Updates, log reviews and rule audits stay with you. A managed Datacenter Proxy authenticates with a username and password, and the provider maintains these layers.
Troubleshooting
An open proxy is usually noticed in the logs and on the bill. If you see one of these signs, test the server right away:
access.logis full of addresses from countries you don't recognize.- The logs show
CONNECTlines to ports:25,:465or:587. - Outbound traffic has climbed beyond anything your own usage explains.
- An abuse notice arrived from your hosting provider.
- Your own mail or API calls are being rejected because of the IP.
Order matters. First close the port in the firewall or stop the service. Then change the passwords, set up the four layers and repeat the test from another network. Don't delete the logs: when you reply to the provider, they show what you closed and when. If your IP landed on a list, send the removal request after the problem is fixed.
How we tested
On December 3, 2026 we used Node.js 24.22.2 and curl 8.23.0 on Windows 11. Instead of Squid, we ran a small forward proxy written in Node. As targets we set up a web server listening only on 127.0.0.1 and a fake mail greeting on port 2525. We sent requests from the machine's local network address. That is not a real external network, but it shows the difference the listening address makes.
| Setup | Request | Result |
|---|---|---|
0.0.0.0, no password | Plain HTTP to the local service | 200, a service open only locally answered |
0.0.0.0, no password | CONNECT to 2525 | Tunnel opened, fake mail greeting arrived |
0.0.0.0, password, CONNECT only 443 | Request without password | 407 |
| Same | CONNECT to 2525 with password | 403 |
127.0.0.1, no password | From the local network address | curl: (7), no connection |
Squid, 3proxy, nginx, Apache and Nmap were not installed on this machine. The settings in the first table and the ss command follow the official documentation and were not run in this test.
The bottom line
If you run a proxy, turn on all four layers together: password, IP allowlist, a narrow bind address and a firewall. After setup, send a request without a password from another network and expect 407, 403 or a connection error. If you are building the proxy only for a fixed exit address, compare it with a ISP Proxy as well. Above all, don't trust an allow all line copied from a forum.
Sources
- mod_proxy, Controlling access to your proxy: httpd.apache.org
- 3proxy HowTo, Service access: 3proxy.org
- Squid configuration directive http_access: squid-cache.org
- Packet filtering and firewalls, Docker and ufw: docs.docker.com
- NSE script http-open-proxy: nmap.org
Frequently asked questions
Is Squid an open proxy out of the box?
No. Squid's recommended configuration only allows requests from the server itself and ends with http_access deny all. Even the local network rule ships as a comment. Squid usually becomes open because of an http_access allow all line added later, or rules written below the deny all line.
Does changing the port number close an open proxy?
No. Scanners don't only check 3128 or 8080; they probe wide port ranges. An unusual port delays discovery a little but refuses no request. Protection comes from authentication, an IP allowlist, the bind address and a firewall. Even if you change the port, set up these four layers.
Is a password alone enough?
No, in most cases it is not enough on its own. A password can leak, and a short one can be guessed. Add an IP allowlist to the password and a leaked password is useless from a stranger's address. The firewall also opens the port only to those addresses. In a single-user setup, binding the proxy to 127.0.0.1 and using it through an SSH tunnel hides the port from the internet entirely.
How do I know my server is being used as an open proxy?
From the logs. If the access log shows many unknown addresses, CONNECT lines to mail ports such as 25 and 587, or an unexplained jump in traffic, the proxy is being used from outside. Then send a request without a password from another network and check whether you get 200. An abuse notice from your provider is also a strong sign.
Is a proxy on my home network a risk too?
Yes, if the port is exposed. Without port forwarding on the router, the proxy can't be reached directly from the internet. The risk starts when you forward the proxy port on the router, or an app opens a port through UPnP. Then your home IP becomes an open proxy. Guest devices on the local network can also use the proxy, so turn on a password at home as well.
Can a SOCKS5 proxy be left open too?
Yes. The SOCKS5 protocol has a separate "no authentication required" method, and if the server accepts it, anyone can connect. Because SOCKS5 carries TCP connections to any port, mail ports stay open as well. Apply the same four layers and enable only the username and password method on the server.




